]> git.neil.brown.name Git - history.git/commitdiff
Import 2.4.0-test5pre4 2.4.0-test5pre4
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:37:03 +0000 (15:37 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:37:03 +0000 (15:37 -0500)
182 files changed:
Documentation/Configure.help
arch/i386/defconfig
arch/i386/kernel/apm.c
arch/sh/Makefile
arch/sh/boot/compressed/Makefile
arch/sh/boot/compressed/misc.c
arch/sh/config.in
arch/sh/defconfig
arch/sh/kernel/Makefile
arch/sh/kernel/cf-enabler.c
arch/sh/kernel/entry.S
arch/sh/kernel/io_generic.c
arch/sh/kernel/irq.c
arch/sh/kernel/process.c
arch/sh/kernel/setup.c
arch/sh/kernel/setup_se.c
arch/sh/kernel/sh_bios.c [new file with mode: 0644]
arch/sh/kernel/sh_ksyms.c
arch/sh/kernel/signal.c
arch/sh/kernel/time.c
arch/sh/mm/cache.c
arch/sh/mm/fault.c
arch/sh/mm/init.c
arch/sh/vmlinux.lds.S
arch/sparc64/kernel/ioctl32.c
drivers/block/linear.c
drivers/block/md.c
drivers/block/raid0.c
drivers/char/Config.in
drivers/char/Makefile
drivers/char/drm/Makefile
drivers/char/drm/agpsupport.c [new file with mode: 0644]
drivers/char/drm/auth.c
drivers/char/drm/bufs.c
drivers/char/drm/context.c
drivers/char/drm/ctxbitmap.c [new file with mode: 0644]
drivers/char/drm/dma.c
drivers/char/drm/drawable.c
drivers/char/drm/drm.h
drivers/char/drm/drmP.h
drivers/char/drm/fops.c
drivers/char/drm/gamma_dma.c
drivers/char/drm/gamma_drv.c
drivers/char/drm/gamma_drv.h
drivers/char/drm/i810_bufs.c [new file with mode: 0644]
drivers/char/drm/i810_context.c [new file with mode: 0644]
drivers/char/drm/i810_dma.c [new file with mode: 0644]
drivers/char/drm/i810_drm.h [new file with mode: 0644]
drivers/char/drm/i810_drv.c [new file with mode: 0644]
drivers/char/drm/i810_drv.h [new file with mode: 0644]
drivers/char/drm/init.c
drivers/char/drm/ioctl.c
drivers/char/drm/lists.c
drivers/char/drm/lock.c
drivers/char/drm/memory.c
drivers/char/drm/mga_bufs.c [new file with mode: 0644]
drivers/char/drm/mga_context.c [new file with mode: 0644]
drivers/char/drm/mga_dma.c [new file with mode: 0644]
drivers/char/drm/mga_drm.h [new file with mode: 0644]
drivers/char/drm/mga_drv.c [new file with mode: 0644]
drivers/char/drm/mga_drv.h [new file with mode: 0644]
drivers/char/drm/mga_state.c [new file with mode: 0644]
drivers/char/drm/proc.c
drivers/char/drm/r128_bufs.c [new file with mode: 0644]
drivers/char/drm/r128_context.c [new file with mode: 0644]
drivers/char/drm/r128_dma.c [new file with mode: 0644]
drivers/char/drm/r128_drm.h [new file with mode: 0644]
drivers/char/drm/r128_drv.c [new file with mode: 0644]
drivers/char/drm/r128_drv.h [new file with mode: 0644]
drivers/char/drm/tdfx_context.c
drivers/char/drm/tdfx_drv.c
drivers/char/drm/tdfx_drv.h
drivers/char/drm/vm.c
drivers/char/hp600_keyb.c
drivers/char/rtc.c
drivers/char/scan_keyb.c
drivers/char/scan_keyb.h
drivers/char/serial.c
drivers/char/sh-sci.c
drivers/char/sh-sci.h
drivers/char/tty_io.c
drivers/ide/ide-tape.c
drivers/parport/daisy.c
drivers/parport/ieee1284.c
drivers/parport/share.c
drivers/s390/misc/chandev.c
drivers/scsi/3w-xxxx.c
drivers/scsi/3w-xxxx.h
drivers/scsi/scsi.c
drivers/usb/Config.in
drivers/usb/devices.c
drivers/usb/serial/Makefile
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan.h
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/omninet.c
drivers/usb/serial/usb-serial.h
drivers/usb/serial/usbserial.c
drivers/usb/serial/visor.c
drivers/usb/serial/whiteheat.c
drivers/usb/storage/Makefile
drivers/usb/storage/debug.c
drivers/usb/storage/debug.h
drivers/usb/storage/protocol.c
drivers/usb/storage/scm.c [new file with mode: 0644]
drivers/usb/storage/scm.h [new file with mode: 0644]
drivers/usb/storage/scsiglue.c
drivers/usb/storage/scsiglue.h
drivers/usb/storage/transport.c
drivers/usb/storage/transport.h
drivers/usb/storage/usb.c
drivers/usb/storage/usb.h
drivers/usb/usb-ohci.c
drivers/usb/usb.c
drivers/video/hitfb.c
fs/fat/inode.c
fs/file_table.c
fs/nls/nls_cp437.c
fs/nls/nls_cp737.c
fs/nls/nls_cp775.c
fs/nls/nls_cp850.c
fs/nls/nls_cp852.c
fs/nls/nls_cp855.c
fs/nls/nls_cp857.c
fs/nls/nls_cp860.c
fs/nls/nls_cp861.c
fs/nls/nls_cp862.c
fs/nls/nls_cp863.c
fs/nls/nls_cp864.c
fs/nls/nls_cp865.c
fs/nls/nls_cp866.c
fs/nls/nls_cp869.c
fs/nls/nls_cp874.c
fs/nls/nls_cp932.c
fs/nls/nls_cp936.c
fs/nls/nls_cp949.c
fs/nls/nls_cp950.c
fs/nls/nls_iso8859-15.c
fs/nls/nls_iso8859-2.c
fs/nls/nls_iso8859-3.c
fs/nls/nls_iso8859-4.c
fs/nls/nls_iso8859-5.c
fs/nls/nls_iso8859-6.c
fs/nls/nls_iso8859-7.c
fs/nls/nls_iso8859-8.c
fs/nls/nls_iso8859-9.c
fs/nls/nls_koi8-r.c
fs/partitions/check.c
fs/select.c
include/asm-sh/bitops.h
include/asm-sh/checksum.h
include/asm-sh/hardirq.h
include/asm-sh/mmu_context.h
include/asm-sh/serial.h [new file with mode: 0644]
include/asm-sh/sh_bios.h [new file with mode: 0644]
include/asm-sh/softirq.h
include/asm-sh/timex.h
include/linux/blkdev.h
include/linux/file.h
include/linux/genhd.h
include/linux/kmod.h
include/linux/mm.h
include/linux/ncp_fs.h
include/linux/poll.h
include/linux/raid/md.h
include/linux/raid/md_p.h
include/linux/sched.h
include/linux/serialP.h
include/linux/sysctl.h
include/linux/usb.h
kernel/fork.c
kernel/kmod.c
kernel/ksyms.c
kernel/sched.c
kernel/sys.c
kernel/sysctl.c
mm/filemap.c
mm/page_alloc.c
net/econet/af_econet.c
net/khttpd/main.c

index 8c765fd52d88939f4a41a985e24a0ba4d000beb7..e8430908af208a9833a00f4cb5451777df3a4e3a 100644 (file)
@@ -2531,12 +2531,20 @@ CONFIG_ISAPNP
 
 Support for hot-pluggable devices
 CONFIG_HOTPLUG
-  Say Y here if you want to attach devices to your computer that can
-  be attached and detached while the system is running. The most
-  prominent example of this are PCMCIA- or PC-cards, credit-card size
-  devices such as network cards, modems or hard drives which are
+  Say Y here if you want to plug devices into your computer while
+  the system is running, and be able to use them quickly.  In many
+  cases, the devices can likewise be unplugged at any time too.
+
+  One well known example of this is PCMCIA- or PC-cards, credit-card
+  size devices such as network cards, modems or hard drives which are
   plugged into slots found on all modern laptop computers.
 
+  Another example, used on modern desktops as well as laptops, is USB.
+  Enable HOTPLUG with USB and KMOD, and your kernel will automatically
+  call out to a user mode "policy agent" to load modules and set up
+  software needed to use USB devices you plug in.  Get agent software
+  (at http://www.linux-usb.org/policy.html) and install it.
+
 PCMCIA/Cardbus support
 CONFIG_PCMCIA
   Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
@@ -12608,21 +12616,40 @@ CONFIG_FT_FDC_MAX_RATE
 Direct Rendering Manager (XFree86 DRI support)
 CONFIG_DRM
   Kernel-level support for the Direct Rendering Infrastructure (DRI)
-  introduced in XFree86 4.x. If you say Y here, you need to select 
+  introduced in XFree86 4.0. If you say Y here, you need to select
   the module that's right for your graphics card from the list below.
-  These modules provide support for synchronization, security, and 
-  DMA transfers. Please read drivers/char/drm/README.drm for more 
-  details. 
+  These modules provide support for synchronization, security, and
+  DMA transfers. Please see http://dri.sourceforge.net for more
+  details.  You should also select and configure AGP
+  (/dev/agpgart) support.
 
-3dfx Banshee/Voodoo3
+3dfx Banshee/Voodoo3+
 CONFIG_DRM_TDFX
-  Choose M here if you have a 3dfx Banshee/Voodoo3 graphics card.
-  The module will be called tdfx.o.
+  Choose this option if you have a 3dfx Banshee or Voodoo3 (or later),
+  graphics card.  If M is selected, the module will be called tdfx.o.
 
-3dlabs GMX 2000 Direct Rendering Driver (XFree86 DRI support)
+3dlabs GMX 2000
 CONFIG_DRM_GAMMA
-  Choose M here if you have a 3dlabs GMX 2000 graphics card.
-  The module will be called gamma.o.
+  Choose this option if you have a 3dlabs GMX 2000 graphics card.
+  If M is selected, the module will be called gamma.o.
+
+ATI Rage 128
+CONFIG_DRM_R128
+  Choose this option if you have an ATI Rage 128 graphics card.  If M
+  is selected, the module will be called r128.o.  AGP support for
+  this card is strongly suggested (unless you have a PCI version).
+
+Intel I810
+CONFIG_DRM_I810
+  Choose this option if you have an Intel I810 graphics card.  If M is
+  selected, the module will be called i810.o.  AGP support is required
+  for this driver to work.
+
+Matrox g200/g400
+CONFIG_DRM_MGA
+  Choose this option if you have a Matrox g200 or g400 graphics card.  If M
+  is selected, the module will be called mga.o.  AGP support is required
+  for this driver to work.
 
 MTRR control and configuration
 CONFIG_MTRR
index b99d0cec3d62f39f77718a60ab97d1e2957a611f..1055ed5e33b496f1d195af70aa909577e36c24b4 100644 (file)
@@ -481,6 +481,10 @@ CONFIG_PSMOUSE=y
 CONFIG_DRM=y
 CONFIG_DRM_TDFX=y
 # CONFIG_DRM_GAMMA is not set
+# CONFIG_DRM_R128 is not set
+# CONFIG_DRM_I810 is not set
+# CONFIG_DRM_MGA is not set
+# CONFIG_AGP is not set
 CONFIG_PCMCIA_SERIAL=y
 
 #
index b1debd5fe54e69cd585a37a110508c5c44a53214..039ba695c87b0d3cc7e83b3e44df8d4c54468193 100644 (file)
@@ -1423,6 +1423,8 @@ static int apm(void *unused)
        kapmd_running = 1;
 
        exit_files(current);    /* daemonize doesn't do exit_files */
+       current->files = init_task.files;
+       atomic_inc(&current->files->count);
        daemonize();
 
        strcpy(current->comm, "kapmd");
index 05cc371011580a6e0ddac390e36f413b47f8565c..7be14e89948392216ca1e64e10beee63d537db9e 100644 (file)
@@ -15,9 +15,9 @@
 #
 # Select the object file format to substitute into the linker script.
 #
-tool-prefix    = sh-linux-gnu-
+tool_prefix    = sh-linux-gnu-
 
-ifdef CONFIG_LITTLE_ENDIAN
+ifdef CONFIG_CPU_LITTLE_ENDIAN
 CFLAGS         += -ml
 AFLAGS         += -ml
 # LINKFLAGS    += -EL
@@ -30,7 +30,7 @@ LDFLAGS               := -EB
 endif
 
 # ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE  = $(tool-prefix)
+CROSS_COMPILE  = $(tool_prefix)
 # endif
 
 LD     =$(CROSS_COMPILE)ld $(LDFLAGS)
index 7a5b5b22f2adba84ab5d89bfedf3627524e1e044..d62db272223d2b0619c177205e9583f465aec3a1 100644 (file)
@@ -9,12 +9,16 @@ SYSTEM = $(TOPDIR)/vmlinux
 
 OBJECTS = $(HEAD) misc.o
 
+ifdef CONFIG_SH_STANDARD_BIOS
+OBJECTS += ../../kernel/sh_bios.o
+endif
+
 ZLDFLAGS = -e startup -T $(TOPDIR)/arch/sh/vmlinux.lds
 
 #
 # ZIMAGE_OFFSET is the load offset of the compression loader
 #
-ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[0x80000000+0x$(CONFIG_MEMORY_START)+0x200000])
+ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[0x80000000+0x$(CONFIG_MEMORY_START)+0x200000+0x10000+0x400])
 
 ZLINKFLAGS = -Ttext $(ZIMAGE_OFFSET) $(ZLDFLAGS)
 
index aab7985053c3e218e405ef34943b6b8c66028759..a2da3fe75ad044cad6fdfe508729c3ebe5b5f4b3 100644 (file)
@@ -7,10 +7,15 @@
  * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
  *
  * Adapted for SH by Stuart Menefy, Aug 1999
+ *
+ * Modified to use standard LinuxSH BIOS by Greg Banks 7Jul2000
  */
 
 #include <linux/config.h>
 #include <asm/uaccess.h>
+#ifdef CONFIG_SH_STANDARD_BIOS
+#include <asm/sh_bios.h>
+#endif
 
 /*
  * gzip declarations
@@ -128,12 +133,7 @@ static void gzip_release(void **ptr)
        free_mem_ptr = (long) *ptr;
 }
 
-#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-#define IN_GDB 1
-#endif
-#include <asm/io.h>
-#include "../../../../drivers/char/sh-sci.h"
-
+#ifdef CONFIG_SH_STANDARD_BIOS
 static int strlen(const char *s)
 {
        int i = 0;
@@ -145,8 +145,14 @@ static int strlen(const char *s)
 
 void puts(const char *s)
 {
-       put_string(s, strlen(s));
+       sh_bios_console_write(s, strlen(s));
 }
+#else
+void puts(const char *s)
+{
+  /* This should be updated to use the sh-sci routines */
+}
+#endif
 
 void* memset(void* s, int c, size_t n)
 {
index 0a83038dcb40e33adc29f1d906a527c5ba618e75..2d0790bde548a4cfabbba672d6f089d3c81edacc 100644 (file)
@@ -46,7 +46,7 @@ if [ "$CONFIG_CPU_SUBTYPE_SH7750" = "y" ]; then
    define_bool CONFIG_CPU_SH3 n
    define_bool CONFIG_CPU_SH4 y
 fi
-bool 'Little Endian' CONFIG_LITTLE_ENDIAN
+bool 'Little Endian' CONFIG_CPU_LITTLE_ENDIAN
 if [ "$CONFIG_SH_SOLUTION_ENGINE" = "y" -o "$CONFIG_SH_HP600" = "y" -o \
      "$CONFIG_SH_OVERDRIVE" = "y" ]; then
   define_hex CONFIG_MEMORY_START 0c000000
@@ -168,8 +168,9 @@ if [ "$CONFIG_VT" = "y" ]; then
    bool '  Support for console on virtual terminal' CONFIG_VT_CONSOLE
 fi
 
-tristate 'Serial support' CONFIG_SERIAL
-if [ "$CONFIG_SERIAL" = "y" ]; then
+tristate 'Serial (8250, 16450, 16550 or compatible) support' CONFIG_SERIAL
+tristate 'Serial (SCI, SCIF) support' CONFIG_SH_SCI
+if [ "$CONFIG_SERIAL" = "y" -o "$CONFIG_SH_SCI" = "y" ]; then
    bool '  Support for console on serial port' CONFIG_SERIAL_CONSOLE
 fi
 comment 'Unix 98 PTY support'
@@ -218,5 +219,9 @@ mainmenu_option next_comment
 comment 'Kernel hacking'
 
 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
-bool 'GDB Stub kernel debug' CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+bool 'Use LinuxSH standard BIOS' CONFIG_SH_STANDARD_BIOS
+if [ "$CONFIG_SH_STANDARD_BIOS" = "y" ]; then
+    bool 'GDB Stub kernel debug' CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+    bool 'Early printk support' CONFIG_SH_EARLY_PRINTK
+fi
 endmenu
index be2685bd78498184c18ff97ea7b8ae582d7154fa..e1d9d172591620942d44307ab2793dd141e333c2 100644 (file)
@@ -9,6 +9,11 @@ CONFIG_UID16=y
 #
 # CONFIG_EXPERIMENTAL is not set
 
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
 #
 # Processor type and features
 #
@@ -21,15 +26,10 @@ CONFIG_CPU_SUBTYPE_SH7708=y
 # CONFIG_CPU_SUBTYPE_SH7750 is not set
 CONFIG_CPU_SH3=y
 # CONFIG_CPU_SH4 is not set
-CONFIG_LITTLE_ENDIAN=y
+CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_MEMORY_START=0c000000
 CONFIG_IOPORT_START=ba000000
 
-#
-# Loadable module support
-#
-# CONFIG_MODULES is not set
-
 #
 # General setup
 #
@@ -54,6 +54,11 @@ CONFIG_BINFMT_ELF=y
 #
 # CONFIG_PARPORT is not set
 
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
 #
 # Block devices
 #
@@ -126,7 +131,8 @@ CONFIG_BLK_DEV_IDEDISK=y
 # Character devices
 #
 # CONFIG_VT is not set
-CONFIG_SERIAL=y
+# CONFIG_SERIAL is not set
+CONFIG_SH_SCI=y
 CONFIG_SERIAL_CONSOLE=y
 
 #
@@ -150,6 +156,7 @@ CONFIG_SERIAL_CONSOLE=y
 # 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_CRAMFS is not set
 # CONFIG_RAMFS is not set
 # CONFIG_ISO9660_FS is not set
@@ -191,4 +198,6 @@ CONFIG_MSDOS_PARTITION=y
 # Kernel hacking
 #
 # CONFIG_MAGIC_SYSRQ is not set
+CONFIG_SH_STANDARD_BIOS=y
 CONFIG_DEBUG_KERNEL_WITH_GDB_STUB=y
+CONFIG_SH_EARLY_PRINTK=y
index 95b6c5f134cf3c3198a15228c33cfe168baa6273..7b38522958cdc6958a39d04feff2041879834804 100644 (file)
@@ -44,6 +44,10 @@ ifdef CONFIG_HD64461
 O_OBJS += setup_hd64461.o
 endif
 
+ifdef CONFIG_SH_STANDARD_BIOS
+O_OBJS += sh_bios.o
+endif
+
 all: kernel.o head.o init_task.o
 
 entry.o: entry.S
index d5c7437ae8f6ed3fdf81f7fec33261f75ed1343c..3727c7264810e585043196bfecb2642666cb4b3d 100644 (file)
@@ -84,7 +84,7 @@ int __init cf_init(void)
 int __init cf_init(void)
 {
        /* Enable the card, and set the level interrupt */
-       outw(0x0042, CF_CIS_BASE+0x0200);
+       ctrl_outw(0x0042, CF_CIS_BASE+0x0200);
        make_imask_irq(14);
        disable_irq(14);
        return 0;
index e54c37b09269d68296c6bbd75d886390748ffdc8..cbca87e694ab9c74b6f96cb11ad2d0b6f5fc943c 100644 (file)
@@ -52,7 +52,7 @@
 flags          =  4
 sigpending     =  8
 need_resched   = 20
-tsk_ptrace     = 60
+tsk_ptrace     = 24
 
 PT_TRACESYS  = 0x00000002
 PF_USEDFPU   = 0x00100000
@@ -275,12 +275,26 @@ ENTRY(ret_from_fork)
  *     Arguments #4 to #6: R0, R1, R2
  *     TRA: (number of arguments + 0x10) x 4
  *
+ * This code also handles delegating other traps to the BIOS/gdb stub
+ * according to:
+ *
+ * Trap number
+ * (TRA>>2)        Purpose
+ * --------        -------
+ * 0x0-0xf         old syscall ABI
+ * 0x10-0x1f       new syscall ABI
+ * 0x20-0xff       delegated through debug_trap to BIOS/gdb stub.
+ *
+ * Note: When we're first called, the TRA value must be shifted
+ * right 2 bits in order to get the value that was used as the "trapa"
+ * argument.
  */
 
 system_call:
        mov.l   1f, $r9
        mov.l   @$r9, $r8
        !
+       ! Is the trap argument >= 0x20? (TRA will be >= 0x80)
        mov     #0x20, $r9
        extu.b  $r9, $r9
        shll2   $r9
@@ -531,9 +545,9 @@ restore_all:
        shlr2   $k0
        and     #0x3c, $k0
        cmp/eq  #0x3c, $k0
-       bf/s    7f
-        mov    $g_imask, $k0
-       shll2   $k0
+       bt/s    7f
+        shll2  $k0
+       mov     $g_imask, $k0
        !
 7:     or      $k0, $k2        ! Set the IMASK-bits
        ldc     $k2, $ssr
@@ -648,19 +662,20 @@ handle_exception:
        ! save all registers onto stack.
        !
        stc     $ssr, $k0       ! from kernel space?
-       shll    $k0             ! Check MD bit (bit30)
+       shll    $k0             ! Check MD bit (bit30) by shifting it into the T bit
        shll    $k0
 #if defined(__SH4__)
        bf/s    8f              ! it's from user to kernel transition
         mov    $r15, $k0       ! save original stack to k0
-       /* Kernel to kernel transition */
+       /* It's a kernel to kernel transition. */
+       /* Is the FPU disabled? */
        mov.l   2f, $k1
        stc     $ssr, $k0
        tst     $k1, $k0
        mov.l   4f, $k1
-       bf/s    9f              ! FPU is not used
+       bf/s    9f              ! FPU is not enabled, no need to save it
         mov    $r15, $k0       ! save original stack to k0
-       ! FPU is used, save FPU
+       ! FPU is enabled, save it
        ! /* XXX: Need to save another bank of FPU if all FPU feature is used */
        ! /* Currently it's not the case for GCC (only udivsi3_i4, divsi3_i4) */
        sts.l   $fpul,  @-$r15
@@ -687,7 +702,7 @@ handle_exception:
         fmov.s $fr0, @-$r15
 #else
        mov.l   3f, $k1
-       bt/s    9f              ! it's from kernel to kernel transition
+       bt/s    9f              ! it's a kernel to kernel transition, and skip the FPU save.
         mov    $r15, $k0       ! save original stack to k0 anyway
 #endif
 8:     /* User space to kernel */
@@ -697,7 +712,9 @@ handle_exception:
        mov     $k1, $r15               ! change to kernel stack
        !
        mov.l   4f, $k1                 ! let kernel release FPU
-9:     mov     #-1, $k4
+9:     ! Save the user registers on the stack.
+       ! At this point, k1 should have been set to the new SR value
+       mov     #-1, $k4
        mov.l   $k4, @-$r15             ! syscall_nr (default: -1)
        !
        sts.l   $macl, @-$r15
index 2465bc28c31f95466b4bcd875e2f4d03df1b38e2..1faa01ce33bd65863ab62552288d2b2429c7286e 100644 (file)
@@ -6,11 +6,21 @@
  *
  * Generic I/O routine.
  *
+ * 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/config.h>
 #include <asm/io.h>
 
+#if defined(__sh3__)
+/* I'm not sure SH7709 has this kind of bug */
+#define SH3_PCMCIA_BUG_WORKAROUND 1
+#define DUMMY_READ_AREA6         0xba000000
+#endif
+
 #define PORT2ADDR(x) (CONFIG_IOPORT_START+(x))
 
 static inline void delay(void)
@@ -51,12 +61,18 @@ void insw(unsigned int port, void *buffer, unsigned long count)
 {
        unsigned short *buf=buffer;
        while(count--) *buf++=inw(port);
+#ifdef SH3_PCMCIA_BUG_WORKAROUND
+       ctrl_inb (DUMMY_READ_AREA6);
+#endif
 }
 
 void insl(unsigned int port, void *buffer, unsigned long count)
 {
        unsigned long *buf=buffer;
        while(count--) *buf++=inl(port);
+#ifdef SH3_PCMCIA_BUG_WORKAROUND
+       ctrl_inb (DUMMY_READ_AREA6);
+#endif
 }
 
 void outb(unsigned long b, unsigned int port)
@@ -90,10 +106,16 @@ void outsw(unsigned int port, const void *buffer, unsigned long count)
 {
        const unsigned short *buf=buffer;
        while(count--) outw(*buf++, port);
+#ifdef SH3_PCMCIA_BUG_WORKAROUND
+       ctrl_inb (DUMMY_READ_AREA6);
+#endif
 }
 
 void outsl(unsigned int port, const void *buffer, unsigned long count)
 {
        const unsigned long *buf=buffer;
        while(count--) outl(*buf++, port);
+#ifdef SH3_PCMCIA_BUG_WORKAROUND
+       ctrl_inb (DUMMY_READ_AREA6);
+#endif
 }
index f21d0e4517d1d5ebaa3052ab43fc0cd58bb4e3ef..399d435af13a2d84c90b0f4af915f62e53db11f2 100644 (file)
@@ -41,8 +41,8 @@
 #include <asm/hd64461.h>
 #endif
 
-unsigned int local_bh_count[NR_CPUS];
-unsigned int local_irq_count[NR_CPUS];
+unsigned int __local_bh_count[NR_CPUS];
+unsigned int __local_irq_count[NR_CPUS];
 
 /*
  * Micro-access to controllers is serialized over the whole
@@ -183,7 +183,7 @@ void disable_irq(unsigned int irq)
 {
        disable_irq_nosync(irq);
 
-       if (!local_irq_count[smp_processor_id()]) {
+       if (!__local_irq_count[smp_processor_id()]) {
                do {
                        barrier();
                } while (irq_desc[irq].status & IRQ_INPROGRESS);
index 6a949883c224161e4df6a8b6e122105d829b4da6..60205379c506544436c141d6de164b903f4625c9 100644 (file)
@@ -331,7 +331,6 @@ asmlinkage int sys_execve(char *ufilename, char **uargv,
        int error;
        char *filename;
 
-       lock_kernel();
        filename = getname(ufilename);
        error = PTR_ERR(filename);
        if (IS_ERR(filename))
@@ -342,7 +341,6 @@ asmlinkage int sys_execve(char *ufilename, char **uargv,
                current->ptrace &= ~PT_DTRACE;
        putname(filename);
 out:
-       unlock_kernel();
        return error;
 }
 
index c8c04ec12402859e847f5d0124b466ccb179492b..69988d8739d1593e0ccf83fb8934a15573101855 100644 (file)
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/smp.h>
-
+#ifdef CONFIG_SH_EARLY_PRINTK
+#include <linux/console.h>
+#include <asm/sh_bios.h>
+#endif
 
 /*
  * Machine setup..
@@ -101,14 +104,83 @@ static struct resource ram_resources[] = {
        { "Kernel data", 0, 0 }
 };
 
-/* System ROM resources */
-#define MAXROMS 6
-static struct resource rom_resources[MAXROMS] = {
-       { "System ROM", 0xF0000, 0xFFFFF, IORESOURCE_BUSY },
-       { "Video ROM", 0xc0000, 0xc7fff }
+static unsigned long memory_start, memory_end;
+
+#ifdef CONFIG_SH_EARLY_PRINTK
+/*
+ *     Print a string through the BIOS
+ */
+static void sh_console_write(struct console *co, const char *s,
+                                unsigned count)
+{
+       sh_bios_console_write(s, count);
+}
+
+/*
+ *     Receive character from the serial port
+ */
+static int sh_console_wait_key(struct console *co)
+{
+       /* Not implemented yet */
+       return 0;
+}
+
+static kdev_t sh_console_device(struct console *c)
+{
+       /* TODO: this is totally bogus */
+       /* return MKDEV(SCI_MAJOR, SCI_MINOR_START + c->index); */
+       return 0;
+}
+
+/*
+ *     Setup initial baud/bits/parity. We do two things here:
+ *     - construct a cflag setting for the first rs_open()
+ *     - initialize the serial port
+ *     Return non-zero if we didn't find a serial port.
+ */
+static int __init sh_console_setup(struct console *co, char *options)
+{
+       int     cflag = CREAD | HUPCL | CLOCAL;
+
+       /*
+        *      Now construct a cflag setting.
+        *      TODO: this is a totally bogus cflag, as we have
+        *      no idea what serial settings the BIOS is using, or
+        *      even if its using the serial port at all.
+        */
+       cflag |= B115200 | CS8 | /*no parity*/0;
+
+       co->cflag = cflag;
+
+       return 0;
+}
+
+static struct console sh_console = {
+       "bios",
+       sh_console_write,
+       NULL,
+       sh_console_device,
+       sh_console_wait_key,
+       NULL,
+       sh_console_setup,
+       CON_PRINTBUFFER,
+       -1,
+       0,
+       NULL
 };
 
-static unsigned long memory_start, memory_end;
+void sh_console_init(void)
+{
+       register_console(&sh_console);
+}
+
+void sh_console_unregister(void)
+{
+       unregister_console(&sh_console);
+}
+
+#endif
+
 
 static inline void parse_mem_cmdline (char ** cmdline_p)
 {
@@ -153,6 +225,10 @@ void __init setup_arch(char **cmdline_p)
        unsigned long bootmap_size;
        unsigned long start_pfn, max_pfn, max_low_pfn;
 
+#ifdef CONFIG_SH_EARLY_PRINTK
+       sh_console_init();
+#endif
+       
        ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV);
 
 #ifdef CONFIG_BLK_DEV_RAM
index bcb9b64140a0fb30ba3692103e6229850213d2fe..cd9436fff55e459567caf9b3ebd37b4421b4470d 100644 (file)
@@ -52,6 +52,13 @@ static void __init init_smsc(void)
        smsc_config(ACTIVATE_INDEX, 0x01);
        smsc_config(IO_BASE_HI_INDEX, 0x03);
        smsc_config(IO_BASE_LO_INDEX, 0xf8);
+       smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
+
+       /* COM2 */
+       smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
+       smsc_config(ACTIVATE_INDEX, 0x01);
+       smsc_config(IO_BASE_HI_INDEX, 0x02);
+       smsc_config(IO_BASE_LO_INDEX, 0xf8);
        smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
 
        /* RTC */
@@ -59,7 +66,7 @@ static void __init init_smsc(void)
        smsc_config(ACTIVATE_INDEX, 0x01);
        smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
 
-       /* XXX: COM2, PARPORT, KBD, and MOUSE will come here... */
+       /* XXX: PARPORT, KBD, and MOUSE will come here... */
        outb_p(CONFIG_EXIT, CONFIG_PORT);
 }
 
diff --git a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c
new file mode 100644 (file)
index 0000000..9c6b107
--- /dev/null
@@ -0,0 +1,70 @@
+/* $Id$
+ *
+ *  linux/arch/sh/kernel/sh_bios.c
+ *  C interface for trapping into the standard LinuxSH BIOS.
+ *
+ *  Copyright (C) 2000 Greg Banks, Mitch Davis
+ *
+ */
+
+#include <config/sh/standard/bios.h>
+#include <asm/sh_bios.h>
+
+#ifdef CONFIG_SH_STANDARD_BIOS
+
+#define BIOS_CALL_CONSOLE_WRITE        0
+#define BIOS_CALL_READ_BLOCK           1       /* not implemented */
+#define BIOS_CALL_CHAR_OUT                     0x1f    /* TODO: hack */
+#define BIOS_CALL_GDB_GET_MODE_PTR             0xfe
+#define BIOS_CALL_GDB_DETACH           0xff
+
+static __inline__ long sh_bios_call(long func, long arg0, long arg1, long arg2, long arg3)
+{
+    register long r0 __asm__("$r0") = func;
+    register long r4 __asm__("$r4") = arg0;
+    register long r5 __asm__("$r5") = arg1;
+    register long r6 __asm__("$r6") = arg2;
+    register long r7 __asm__("$r7") = arg3;
+    __asm__ __volatile__("trapa        #0x3f"
+        : "=z" (r0)
+        : "0" (r0), "r" (r4), "r" (r5), "r" (r6), "r" (r7)
+        : "memory");
+    return r0;
+}
+
+
+void sh_bios_console_write(const char *buf, unsigned int len)
+{
+    sh_bios_call(BIOS_CALL_CONSOLE_WRITE, (long)buf, (long)len, 0, 0);
+}
+
+
+void sh_bios_char_out(char ch)
+{
+    sh_bios_call(BIOS_CALL_CHAR_OUT, ch, 0, 0, 0);
+}
+
+
+int sh_bios_in_gdb_mode(void)
+{
+    static char queried = 0;
+    static char *gdb_mode_p = 0;
+
+    if (!queried)
+    {
+       /* Query the gdb stub for address of its gdb mode variable */
+       long r = sh_bios_call(BIOS_CALL_GDB_GET_MODE_PTR, 0, 0, 0, 0);
+       if (r != ~0)    /* BIOS returns -1 for unknown function */
+           gdb_mode_p = (char *)r;
+       queried = 1;
+    }
+    return (gdb_mode_p != 0 ? *gdb_mode_p : 0);
+}
+
+void sh_bios_gdb_detach(void)
+{
+    sh_bios_call(BIOS_CALL_GDB_DETACH, 0, 0, 0, 0);
+}
+
+#endif
+
index 2b1b9ea2e945b402f50ecc77cd8993f429ce0fc8..73d9719825d7446226a3c4925f7d3d2631e202a7 100644 (file)
 extern void dump_thread(struct pt_regs *, struct user *);
 extern int dump_fpu(elf_fpregset_t *);
 
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
-extern struct drive_info_struct drive_info;
-EXPORT_SYMBOL(drive_info);
-#endif
-
 /* platform dependent support */
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(iounmap);
-EXPORT_SYMBOL(local_bh_count);
-EXPORT_SYMBOL(local_irq_count);
 EXPORT_SYMBOL(enable_irq);
 EXPORT_SYMBOL(disable_irq);
 EXPORT_SYMBOL(kernel_thread);
index 65469f7e19f3dd0465df8fede0a27c711ac59744..221af3022170ed3229e0afeef90a698901220ff7 100644 (file)
@@ -669,7 +669,6 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
                                /* FALLTHRU */
 
                        default:
-                               lock_kernel();
                                sigaddset(&current->signal, signr);
                                recalc_sigpending(current);
                                current->flags |= PF_SIGNALED;
index 3861fec7d4a174b40e49d13fae27d29e56a27ae1..2c73255f4785551ed87af3c1adcfe675d2154b07 100644 (file)
 #endif
 
 extern rwlock_t xtime_lock;
+extern unsigned long wall_jiffies;
 #define TICK_SIZE tick
 
 void do_gettimeofday(struct timeval *tv)
 {
-       extern volatile unsigned long lost_ticks;
        unsigned long flags;
        unsigned long usec, sec;
 
        read_lock_irqsave(&xtime_lock, flags);
        usec = 0;
        {
-               unsigned long lost = lost_ticks;
+               unsigned long lost = jiffies - wall_jiffies;
                if (lost)
                        usec += lost * (1000000 / HZ);
        }
@@ -142,9 +142,28 @@ void do_gettimeofday(struct timeval *tv)
        tv->tv_usec = usec;
 }
 
+/*
+ * Could someone please implement this...
+ */
+#define do_gettimeoffset() 0
+
 void do_settimeofday(struct timeval *tv)
 {
        write_lock_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_usec -= do_gettimeoffset();
+       tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
+
+       while (tv->tv_usec < 0) {
+               tv->tv_usec += 1000000;
+               tv->tv_sec--;
+       }
+
        xtime = *tv;
        time_adjust = 0;                /* stop active adjtime() */
        time_status |= STA_UNSYNC;
index 895681fc6fb210db94161194f3034d8c25162b40..56f444bf41cb985e9c91cf3a8acd0dcdd0b0a5f6 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  linux/arch/sh/mm/cache.c
  *
- * Copyright (C) 1999  Niibe Yutaka
+ * Copyright (C) 1999, 2000  Niibe Yutaka
  *
  */
 
@@ -36,7 +36,10 @@ struct _cache_system_info {
        int num_entries;
 };
 
-static struct _cache_system_info cache_system_info;
+/* Data at BSS is cleared after setting this variable.
+   So, we Should not placed this variable at BSS section.
+   Initialize this, it is placed at data section. */
+static struct _cache_system_info cache_system_info = {0,};
 
 #define CACHE_OC_WAY_SHIFT     (cache_system_info.way_shift)
 #define CACHE_IC_WAY_SHIFT     (cache_system_info.way_shift)
@@ -97,7 +100,7 @@ static inline void cache_wback_all(void)
        }
 }
 
-static void
+static void __init
 detect_cpu_and_cache_system(void)
 {
 #if defined(__sh3__)
@@ -338,6 +341,7 @@ void flush_cache_range(struct mm_struct *mm, unsigned long start,
 
 void flush_cache_page(struct vm_area_struct *vma, unsigned long addr)
 {
+       /* XXX: Umm... this flush out all the cache lines.  Any improvement? */
        flush_cache_range(vma->vm_mm, addr, addr+PAGE_SIZE);
 }
 
index 428bec21c9c798c7d8ba17da49119290f25c6fa2..9dd6ae4516967d4b2612e77bb5e355deda7e96d7 100644 (file)
@@ -29,6 +29,9 @@
 
 extern void die(const char *,struct pt_regs *,long);
 static void __flush_tlb_page(struct mm_struct *mm, unsigned long page);
+#if defined(__SH4__)
+static void __flush_tlb_phys(struct mm_struct *mm, unsigned long phys);
+#endif
 
 /*
  * Ugly, ugly, but the goto's result in better assembly..
@@ -277,6 +280,19 @@ void update_mmu_cache(struct vm_area_struct * vma,
 
        save_and_cli(flags);
 
+#if defined(__SH4__)
+       if ((vma->vm_flags & VM_SHARED)) {
+               pteval = pte_val(pte);
+               pteval &= PAGE_MASK; /* Physicall page address */
+
+               __flush_tlb_phys(vma->vm_mm, pteval);
+
+               /* It would be good we had routine which takes
+                  physical memory as argument */
+               flush_cache_page(vma, address&PAGE_MASK);
+       }
+#endif
+
        /* Set PTEH register */
        if (vma) {
                pteaddr = (address & MMU_VPN_MASK) |
@@ -328,6 +344,33 @@ static void __flush_tlb_page(struct mm_struct *mm, unsigned long page)
                set_asid(saved_asid);
 }
 
+#if defined(__SH4__)
+static void __flush_tlb_phys(struct mm_struct *mm, unsigned long phys)
+{
+       int i;
+       unsigned long addr, data;
+
+       jump_to_P2();
+       for (i = 0; i < MMU_UTLB_ENTRIES; i++) {
+               addr = MMU_UTLB_DATA_ARRAY | (i<<MMU_U_ENTRY_SHIFT);
+               data = ctrl_inl(addr);
+               if ((data & MMU_UTLB_VALID) && (data&PAGE_MASK) == phys) {
+                       data &= ~MMU_UTLB_VALID;
+                       ctrl_outl(data, addr);
+               }
+       }
+       for (i = 0; i < MMU_ITLB_ENTRIES; i++) {
+               addr = MMU_ITLB_DATA_ARRAY | (i<<MMU_I_ENTRY_SHIFT);
+               data = ctrl_inl(addr);
+               if ((data & MMU_ITLB_VALID) && (data&PAGE_MASK) == phys) {
+                       data &= ~MMU_ITLB_VALID;
+                       ctrl_outl(data, addr);
+               }
+       }
+       back_to_P1();
+}
+#endif
+
 void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
 {
        unsigned long flags;
index 931564cac0a580bb89767ef431f9e2111efd58b9..f798ef968a5bb78afd7e3fd917a13bd2c6d9ff0b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: init.c,v 1.16 2000/02/14 15:19:05 gniibe Exp $
+/* $Id: init.c,v 1.17 2000-04-08 15:38:54+09 gniibe Exp $
  *
  *  linux/arch/sh/mm/init.c
  *
@@ -207,6 +207,9 @@ void __init paging_init(void)
        /* Enable MMU */
        ctrl_outl(MMU_CONTROL_INIT, MMUCR);
 
+       /* The manual suggests doing some nops after turning on the MMU */
+       asm volatile("nop;nop;nop;nop;nop;nop;");
+
        mmu_context_cache = MMU_CONTEXT_FIRST_VERSION;
        set_asid(mmu_context_cache & MMU_CONTEXT_ASID_MASK);
 
index 736e4301f0f13a74a96b84a1940b4f04ecb2ad1c..1a7c2e8206701fdf417f044b58bafe199f9c97de 100644 (file)
@@ -3,7 +3,7 @@
  * Written by Niibe Yutaka
  */
 #include <linux/config.h>
-#ifdef CONFIG_LITTLE_ENDIAN
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
 OUTPUT_FORMAT("elf32-shl", "elf32-shl", "elf32-shl")
 #else
 OUTPUT_FORMAT("elf32-sh", "elf32-sh", "elf32-sh")
@@ -78,6 +78,16 @@ SECTIONS
   . = ALIGN(4);
   _end = . ;
 
+  /* When something in the kernel is NOT compiled as a module, the
+   * module cleanup code and data are put into these segments.  Both
+   * can then be thrown away, as cleanup code is never called unless
+   * it's a module.
+   */
+  /DISCARD/ : {
+       *(.text.exit)
+       *(.data.exit)
+       }
+
   /* Stabs debugging sections.  */
   .stab 0 : { *(.stab) }
   .stabstr 0 : { *(.stabstr) }
index c424722a599dc481f76f7e24e8821cc074a1f5c2..795960fea5bdcec35f630465133427426880f9a9 100644 (file)
@@ -1085,7 +1085,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                {
                        struct floppy_struct *f;
 
-                       f = karg = kmalloc(GFP_KERNEL, sizeof(struct floppy_struct));
+                       f = karg = kmalloc(sizeof(struct floppy_struct), GFP_KERNEL);
                        if (!karg)
                                return -ENOMEM;
                        if (cmd == FDGETPRM32)
@@ -1111,7 +1111,7 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                {
                        struct floppy_drive_params *f;
 
-                       f = karg = kmalloc(GFP_KERNEL, sizeof(struct floppy_drive_params));
+                       f = karg = kmalloc(sizeof(struct floppy_drive_params), GFP_KERNEL);
                        if (!karg)
                                return -ENOMEM;
                        if (cmd == FDGETDRVPRM32)
@@ -1143,17 +1143,17 @@ static int fd_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
                }
                case FDGETDRVSTAT32:
                case FDPOLLDRVSTAT32:
-                       karg = kmalloc(GFP_KERNEL, sizeof(struct floppy_drive_struct));
+                       karg = kmalloc(sizeof(struct floppy_drive_struct), GFP_KERNEL);
                        if (!karg)
                                return -ENOMEM;
                        break;
                case FDGETFDCSTAT32:
-                       karg = kmalloc(GFP_KERNEL, sizeof(struct floppy_fdc_state));
+                       karg = kmalloc(sizeof(struct floppy_fdc_state), GFP_KERNEL);
                        if (!karg)
                                return -ENOMEM;
                        break;
                case FDWERRORGET32:
-                       karg = kmalloc(GFP_KERNEL, sizeof(struct floppy_write_errors));
+                       karg = kmalloc(sizeof(struct floppy_write_errors), GFP_KERNEL);
                        if (!karg)
                                return -ENOMEM;
                        break;
index 26d159473290bdb0ddc469d8a737136aaba1e081..b429e1bbff5dc3ed20c3c73fa95c54155e7993f7 100644 (file)
@@ -148,7 +148,7 @@ static int linear_make_request (request_queue_t *q, mddev_t *mddev,
                return -1;
        }
        bh->b_rdev = tmp_dev->dev;
-       bh->b_rsector = ((block - tmp_dev->offset) << 1) + (bh->b_rsector & 1);
+       bh->b_rsector = bh->b_rsector - (tmp_dev->offset << 1);
 
        return 1;
 }
index de977bdf02170005871a3faa21c67e6e9f6dc080..2eb6cea4b572f3eac8a2ed829bb0cfd13ff5ca1f 100644 (file)
@@ -100,6 +100,7 @@ static ctl_table raid_root_table[] = {
  */
 struct hd_struct md_hd_struct[MAX_MD_DEVS];
 static int md_blocksizes[MAX_MD_DEVS];
+static int md_hardsect_sizes[MAX_MD_DEVS];
 static int md_maxreadahead[MAX_MD_DEVS];
 static mdk_thread_t *md_recovery_thread = NULL;
 
@@ -569,7 +570,7 @@ static int read_disk_sb (mdk_rdev_t * rdev)
                printk (NO_SB,partition_name(rdev->dev));
                goto abort;
        }
-       printk(" [events: %08lx]\n", (unsigned long)get_unaligned(&rdev->sb->events));
+       printk(" [events: %08lx]\n", (unsigned long)rdev->sb->events_lo);
        ret = 0;
 abort:
        if (bh)
@@ -834,7 +835,7 @@ static void print_sb(mdp_super_t *sb)
        printk("     UT:%08x ST:%d AD:%d WD:%d FD:%d SD:%d CSUM:%08x E:%08lx\n",
                sb->utime, sb->state, sb->active_disks, sb->working_disks,
                sb->failed_disks, sb->spare_disks,
-               sb->sb_csum, (unsigned long)get_unaligned(&sb->events));
+               sb->sb_csum, (unsigned long)sb->events_lo);
 
        for (i = 0; i < MD_SB_DISKS; i++) {
                mdp_disk_t *desc;
@@ -1064,22 +1065,20 @@ int md_update_sb(mddev_t * mddev)
        int first, err, count = 100;
        struct md_list_head *tmp;
        mdk_rdev_t *rdev;
-       __u64 ev;
 
 repeat:
        mddev->sb->utime = CURRENT_TIME;
-       ev = get_unaligned(&mddev->sb->events);
-       ++ev;
-       put_unaligned(ev,&mddev->sb->events);
-       if (ev == (__u64)0) {
+       if ((++mddev->sb->events_lo)==0)
+               ++mddev->sb->events_hi;
+
+       if ((mddev->sb->events_lo|mddev->sb->events_hi)==0) {
                /*
                 * oops, this 64-bit counter should never wrap.
                 * Either we are in around ~1 trillion A.C., assuming
                 * 1 reboot per second, or we have a bug:
                 */
                MD_BUG();
-               --ev;
-               put_unaligned(ev,&mddev->sb->events);
+               mddev->sb->events_lo = mddev->sb->events_hi = 0xffffffff;
        }
        sync_sbs(mddev);
 
@@ -1105,7 +1104,7 @@ repeat:
                printk("%s ", partition_name(rdev->dev));
                if (!rdev->faulty) {
                        printk("[events: %08lx]",
-                               (unsigned long)get_unaligned(&rdev->sb->events));
+                               (unsigned long)rdev->sb->events_lo);
                        err += write_disk_sb(rdev);
                } else
                        printk(")\n");
@@ -1288,15 +1287,13 @@ static int analyze_sbs (mddev_t * mddev)
                 * one event)
                 */
                if (calc_sb_csum(rdev->sb) != rdev->sb->sb_csum) {
-                       __u64 ev = get_unaligned(&rdev->sb->events);
-                       if (ev != (__u64)0) {
-                               --ev;
-                               put_unaligned(ev,&rdev->sb->events);
-                       }
+                       if (rdev->sb->events_lo || rdev->sb->events_hi)
+                               if ((rdev->sb->events_lo--)==0)
+                                       rdev->sb->events_hi--;
                }
 
                printk("%s's event counter: %08lx\n", partition_name(rdev->dev),
-                       (unsigned long)get_unaligned(&rdev->sb->events));
+                       (unsigned long)rdev->sb->events_lo);
                if (!freshest) {
                        freshest = rdev;
                        continue;
@@ -1304,8 +1301,8 @@ static int analyze_sbs (mddev_t * mddev)
                /*
                 * Find the newest superblock version
                 */
-               ev1 = get_unaligned(&rdev->sb->events);
-               ev2 = get_unaligned(&freshest->sb->events);
+               ev1 = md_event(rdev->sb);
+               ev2 = md_event(freshest->sb);
                if (ev1 != ev2) {
                        out_of_date = 1;
                        if (ev1 > ev2)
@@ -1329,8 +1326,8 @@ static int analyze_sbs (mddev_t * mddev)
                 * Kick all non-fresh devices faulty
                 */
                __u64 ev1, ev2;
-               ev1 = get_unaligned(&rdev->sb->events);
-               ev2 = get_unaligned(&sb->events);
+               ev1 = md_event(rdev->sb);
+               ev2 = md_event(sb);
                ++ev1;
                if (ev1 < ev2) {
                        printk("md: kicking non-fresh %s from array!\n",
@@ -1350,8 +1347,8 @@ static int analyze_sbs (mddev_t * mddev)
                        MD_BUG();
                        goto abort;
                }
-               ev1 = get_unaligned(&rdev->sb->events);
-               ev2 = get_unaligned(&sb->events);
+               ev1 = md_event(rdev->sb);
+               ev2 = md_event(sb);
                ev3 = ev2;
                --ev3;
                if ((rdev->dev != rdev->old_dev) &&
@@ -1694,14 +1691,22 @@ static int do_md_run (mddev_t * mddev)
         * Drop all container device buffers, from now on
         * the only valid external interface is through the md
         * device.
+        * Also find largest hardsector size
         */
+       md_hardsect_sizes[mdidx(mddev)] = 512;
        ITERATE_RDEV(mddev,rdev,tmp) {
                if (rdev->faulty)
                        continue;
                fsync_dev(rdev->dev);
                invalidate_buffers(rdev->dev);
-       }
-
+               if (get_hardsect_size(rdev->dev)
+                   > md_hardsect_sizes[mdidx(mddev)]) 
+                       md_hardsect_sizes[mdidx(mddev)] =
+                               get_hardsect_size(rdev->dev);
+       }
+       md_blocksizes[mdidx(mddev)] = 1024;
+       if (md_blocksizes[mdidx(mddev)] < md_hardsect_sizes[mdidx(mddev)])
+               md_blocksizes[mdidx(mddev)] = md_hardsect_sizes[mdidx(mddev)];
        mddev->pers = pers[pnum];
 
        err = mddev->pers->run(mddev);
@@ -3578,7 +3583,7 @@ struct notifier_block md_notifier = {
        0
 };
 
-void md__init raid_setup(char *str)
+static int md__init raid_setup(char *str)
 {
        int len, pos;
 
@@ -3597,7 +3602,7 @@ void md__init raid_setup(char *str)
                pos += wlen+1;
        }
        raid_setup_args.set = 1;
-       return;
+       return 1;
 }
 __setup("raid=", raid_setup);
 
@@ -3608,12 +3613,14 @@ static void md_geninit (void)
        for(i = 0; i < MAX_MD_DEVS; i++) {
                md_blocksizes[i] = 1024;
                md_size[i] = 0;
+               md_hardsect_sizes[i] = 512;
                md_maxreadahead[i] = MD_READAHEAD;
                register_disk(&md_gendisk, MKDEV(MAJOR_NR,i), 1, &md_fops, 0);
        }
-       blksize_size[MD_MAJOR] = md_blocksizes;
+       blksize_size[MAJOR_NR] = md_blocksizes;
        blk_size[MAJOR_NR] = md_size;
-       max_readahead[MD_MAJOR] = md_maxreadahead;
+       max_readahead[MAJOR_NR] = md_maxreadahead;
+       hardsect_size[MAJOR_NR] = md_hardsect_sizes;
 
        printk("md.c: sizeof(mdp_super_t) = %d\n", (int)sizeof(mdp_super_t));
 
@@ -3636,9 +3643,9 @@ int md__init md_init (void)
                        MD_MAJOR_VERSION, MD_MINOR_VERSION,
                        MD_PATCHLEVEL_VERSION, MAX_MD_DEVS, MAX_REAL);
 
-       if (devfs_register_blkdev (MD_MAJOR, "md", &md_fops))
+       if (devfs_register_blkdev (MAJOR_NR, "md", &md_fops))
        {
-               printk (KERN_ALERT "Unable to get major %d for md\n", MD_MAJOR);
+               printk (KERN_ALERT "Unable to get major %d for md\n", MAJOR_NR);
                return (-1);
        }
        devfs_handle = devfs_mk_dir (NULL, "md", NULL);
@@ -3646,9 +3653,9 @@ int md__init md_init (void)
                                MAJOR_NR, 0, S_IFBLK | S_IRUSR | S_IWUSR,
                                &md_fops, NULL);
 
-       blk_dev[MD_MAJOR].queue = md_get_queue;
+       blk_dev[MAJOR_NR].queue = md_get_queue;
 
-       read_ahead[MD_MAJOR] = INT_MAX;
+       read_ahead[MAJOR_NR] = INT_MAX;
        md_gendisk.next = gendisk_head;
 
        gendisk_head = &md_gendisk;
index f06ddc3558ea6fb130cbd2f9afc33f122e6601ce..f37d8e5fba925fcbb9fd3631400cf16d678e3f31 100644 (file)
@@ -226,12 +226,12 @@ static int raid0_stop (mddev_t *mddev)
 static int raid0_make_request (request_queue_t *q, mddev_t *mddev,
                                        int rw, struct buffer_head * bh)
 {
-       int blk_in_chunk, chunksize_bits, chunk, chunk_size;
+       unsigned int sect_in_chunk, chunksize_bits, chunk, chunk_size;
        raid0_conf_t *conf = mddev_to_conf(mddev);
        struct raid0_hash *hash;
        struct strip_zone *zone;
        mdk_rdev_t *tmp_dev;
-       long block, rblock;
+       unsigned long block, rsect;
 
        chunk_size = mddev->param.chunk_size >> 10;
        chunksize_bits = ffz(~chunk_size);
@@ -255,17 +255,18 @@ static int raid0_make_request (request_queue_t *q, mddev_t *mddev,
        } else
                zone = hash->zone0;
     
-       blk_in_chunk = block & (chunk_size -1);
+       sect_in_chunk = bh->b_rsector & ((chunk_size<<1) -1);
        chunk = (block - zone->zone_offset) / (zone->nb_dev << chunksize_bits);
        tmp_dev = zone->dev[(block >> chunksize_bits) % zone->nb_dev];
-       rblock = (chunk << chunksize_bits) + blk_in_chunk + zone->dev_offset;
+       rsect = ((chunk << chunksize_bits) + zone->dev_offset)<<1
+               + sect_in_chunk;
  
        /*
         * The new BH_Lock semantics in ll_rw_blk.c guarantee that this
         * is the only IO operation happening on this bh.
         */
        bh->b_rdev = tmp_dev->dev;
-       bh->b_rsector = rblock << 1;
+       bh->b_rsector = rsect;
 
        /*
         * Let the main block layer submit the IO and resolve recursion:
index f1815800409d25ed4fad182e2fdbc0105e0c7cfa..ae79962f4e79e1969643f7c82498844c9835a319 100644 (file)
@@ -258,24 +258,25 @@ fi
 endmenu
 
 bool 'Direct Rendering Manager (XFree86 DRI support)' CONFIG_DRM
-dep_tristate '  3dfx Banshee/Voodoo3' CONFIG_DRM_TDFX $CONFIG_DRM
 if [ "$CONFIG_DRM" = "y" ]; then
-  dep_tristate '  3dlabs GMX 2000' CONFIG_DRM_GAMMA m
+    tristate '  3dfx Banshee/Voodoo3+' CONFIG_DRM_TDFX
+    tristate '  3dlabs GMX 2000' CONFIG_DRM_GAMMA
+    tristate '  ATI Rage 128' CONFIG_DRM_R128
+    tristate '  Intel I810' CONFIG_DRM_I810
+    tristate '  Matrox g200/g400' CONFIG_DRM_MGA
 fi
 
-if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
-   source drivers/char/pcmcia/Config.in
+tristate '/dev/agpgart (AGP Support)' CONFIG_AGP $CONFIG_DRM_AGP
+if [ "$CONFIG_AGP" != "n" ]; then
+   bool '  Intel 440LX/BX/GX support' CONFIG_AGP_INTEL
+   bool '  Intel I810/I810 DC100/I810e support' CONFIG_AGP_I810
+   bool '  VIA chipset support' CONFIG_AGP_VIA
+   bool '  AMD Irongate support' CONFIG_AGP_AMD
+   bool '  Generic SiS support' CONFIG_AGP_SIS
+   bool '  ALI M1541 support' CONFIG_AGP_ALI
 fi
 
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-   tristate '/dev/agpgart (AGP Support) (EXPERIMENTAL)' CONFIG_AGP
-   if [ "$CONFIG_AGP" != "n" ]; then
-      bool '  Intel 440LX/BX/GX support' CONFIG_AGP_INTEL
-      bool '  Intel I810/I810 DC100/I810e support' CONFIG_AGP_I810
-      bool '  VIA chipset support' CONFIG_AGP_VIA
-      bool '  AMD Irongate support' CONFIG_AGP_AMD
-      bool '  Generic SiS support' CONFIG_AGP_SIS
-      bool '  ALI M1541 support' CONFIG_AGP_ALI
-   fi
+if [ "$CONFIG_HOTPLUG" = "y" -a "$CONFIG_PCMCIA" != "n" ]; then
+   source drivers/char/pcmcia/Config.in
 fi
 endmenu
index 9bba10cf4a588d038161b7fc54ca209d5441f27c..085c48c8fa3013fd796b69ae8502524c71cdd2df 100644 (file)
@@ -76,19 +76,11 @@ ifeq ($(ARCH),sh)
   KEYMAP   =
   KEYBD    =
   CONSOLE  =
-  SERIAL =
   ifeq ($(CONFIG_SH_HP600),y)
   KEYMAP   = defkeymap.o
   KEYBD    = scan_keyb.o hp600_keyb.o
   CONSOLE  = console.o
   endif
-  ifeq ($(CONFIG_SERIAL),y)
-  SERIAL = generic_serial.o sh-sci.o
-  else
-    ifeq ($(CONFIG_SERIAL),m)
-    SERIAL = sh-sci.o
-    endif
-  endif
 endif
 
 ifeq ($(CONFIG_DECSTATION),y)
@@ -149,7 +141,7 @@ obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
 # So this should simply provide the wanted functionality!
 obj-$(CONFIG_SX) += sx.o generic_serial.o
 obj-$(CONFIG_RIO) += rio/rio.o generic_serial.o
-
+obj-$(CONFIG_SH_SCI) += sh-sci.o generic_serial.o
 
 ifeq ($(CONFIG_RIO),y)
   SUB_DIRS += rio
index 1c68f0cd2a957d3411107058c27725a37123e4b2..3bb727c27cf67a23a6bf8c7119f011976039ec85 100644 (file)
 # parent makes..
 #
 
-O_TARGET       := drm.o
+O_OBJS         :=
+OX_OBJS                :=
+M_OBJS         :=
+MX_OBJS                :=
 
-L_OBJS         := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
-                       lists.o lock.o ioctl.o fops.o vm.o dma.o
+# Object file lists.
 
-M_OBJS         := 
+obj-y          :=
+obj-m          :=
+obj-n          :=
+obj-           :=
 
-ifeq ($(CONFIG_DRM_GAMMA),y)
- OX_OBJS += gamma_drv.o
- O_OBJS += gamma_dma.o
-else
-  ifeq ($(CONFIG_DRM_GAMMA),m)
-    MIX_OBJS += gamma_drv.o
-    MI_OBJS += gamma_dma.o
-    M_OBJS += gamma.o
-  endif
-endif
+SUB_DIRS     := 
+MOD_SUB_DIRS := $(SUB_DIRS)
+ALL_SUB_DIRS := $(SUB_DIRS)
+
+O_TARGET       := drm.o
+module-list     := gamma.o tdfx.o r128.o ffb.o mga.o i810.o
+export-objs     := $(patsubst %.o,%_drv.o,$(module-list))
 
-ifeq ($(CONFIG_DRM_TDFX),y)
- OX_OBJS += tdfx_drv.o
- O_OBJS += tdfx_context.o
-else
-  ifeq ($(CONFIG_DRM_TDFX),m)
-    MIX_OBJS += tdfx_drv.o
-    MI_OBJS += tdfx_context.o
-    M_OBJS += tdfx.o
-  endif
+lib-objs   := init.o memory.o proc.o auth.o context.o drawable.o bufs.o
+lib-objs   += lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
+
+ifneq ($(CONFIG_AGP),)
+ lib-objs  += agpsupport.o
 endif
 
-ifeq ($(CONFIG_DRM_FFB),y)
- OX_OBJS += ffb_drv.o
- O_OBJS += ffb_context.o
-else
-  ifeq ($(CONFIG_DRM_FFB),m)
-    MIX_OBJC += ffb_drv.o
-    MI_OBJS += ffb_context.o
-    M_OBJS += ffb.o
-  endif
+gamma-objs := $(lib-objs) gamma_drv.o gamma_dma.o
+tdfx-objs  := $(lib-objs) tdfx_drv.o                tdfx_context.o
+r128-objs  := $(lib-objs) r128_drv.o  r128_dma.o    r128_context.o r128_bufs.o
+ffb-objs   := $(lib-objs) ffb_drv.o                 ffb_context.o
+mga-objs   := $(lib-objs) mga_drv.o   mga_dma.o     mga_context.o  mga_bufs.o \
+             mga_state.o
+i810-objs  := $(lib-objs) i810_drv.o  i810_dma.o    i810_context.o i810_bufs.o
+
+obj-$(CONFIG_DRM_GAMMA) += gamma.o $(gamma-objs)
+obj-$(CONFIG_DRM_TDFX)  += tdfx.o  $(tdfx-objs)
+obj-$(CONFIG_DRM_R128)  += r128.o  $(r128-objs)
+obj-$(CONFIG_DRM_FFB)   += ffb.o   $(ffb-objs)
+
+ifneq ($CONFIG_AGP),)
+obj-$(CONFIG_DRM_MGA)   += mga.o   $(mga-objs)
+obj-$(CONFIG_DRM_I810)  += i810.o  $(i810-objs)
 endif
 
-O_OBJS += $(L_OBJS)
+# Take module names out of obj-y and int-m
+
+obj-y           := $(filter-out $(module-list), $(obj-y))
+int-m           := $(filter-out $(module-list), $(obj-m))
+
+# Translate to Rules.make lists.
+
+O_OBJS          := $(filter-out $(export-objs), $(obj-y))
+OX_OBJS         := $(filter     $(export-objs), $(obj-y))
+M_OBJS          := $(sort $(filter     $(module-list), $(obj-m)))
+MI_OBJS         := $(sort $(filter-out $(export-objs), $(int-m)))
+MIX_OBJS        := $(sort $(filter     $(export-objs), $(int-m)))
 
 include $(TOPDIR)/Rules.make
 
-gamma.o : gamma_drv.o gamma_dma.o $(L_OBJS)
-       $(LD) $(LD_RFLAG) -r -o $@ gamma_drv.o gamma_dma.o $(L_OBJS)
+gamma.o: $(gamma-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(gamma-objs)
+
+tdfx.o: $(tdfx-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(tdfx-objs)
+
+mga.o: $(mga-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(mga-objs)
+
+i810.o: $(i810-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(i810-objs)
 
-tdfx.o: tdfx_drv.o tdfx_context.o $(L_OBJS)
-       $(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o $(L_OBJS)
+r128.o: $(r128-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(r128-objs)
 
-ffb.o: ffb_drv.o ffb_context.o $(L_OBJS)
-       $(LD) $(LD_RFLAG) -r -o $@ ffb_drv.o ffb_context.o $(L_OBJS)
+ffb.o: $(ffb-objs)
+       $(LD) $(LD_RFLAG) -r -o $@ $(ffb-objs)
diff --git a/drivers/char/drm/agpsupport.c b/drivers/char/drm/agpsupport.c
new file mode 100644 (file)
index 0000000..628e8ca
--- /dev/null
@@ -0,0 +1,327 @@
+/* agpsupport.c -- DRM support for AGP/GART backend -*- linux-c -*-
+ * Created: Mon Dec 13 09:56:45 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Author: Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+
+drm_agp_func_t drm_agp = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
+
+/* The C standard says that 'void *' is not guaranteed to hold a function
+   pointer, so we use this union to define a generic pointer that is
+   guaranteed to hold any of the function pointers we care about. */
+typedef union {
+       void          (*free_memory)(agp_memory *);
+       agp_memory    *(*allocate_memory)(size_t, u32);
+       int           (*bind_memory)(agp_memory *, off_t);
+       int           (*unbind_memory)(agp_memory *);
+       void          (*enable)(u32);
+       int           (*acquire)(void);
+       void          (*release)(void);
+       void          (*copy_info)(agp_kern_info *);
+       unsigned long address;
+} drm_agp_func_u;
+
+typedef struct drm_agp_fill {
+        const char     *name;
+       drm_agp_func_u *f;
+} drm_agp_fill_t;
+
+static drm_agp_fill_t drm_agp_fill[] = {
+       { __MODULE_STRING(agp_free_memory),
+          (drm_agp_func_u *)&drm_agp.free_memory     },
+       { __MODULE_STRING(agp_allocate_memory), 
+          (drm_agp_func_u *)&drm_agp.allocate_memory },
+       { __MODULE_STRING(agp_bind_memory),     
+          (drm_agp_func_u *)&drm_agp.bind_memory     },
+       { __MODULE_STRING(agp_unbind_memory),   
+          (drm_agp_func_u *)&drm_agp.unbind_memory   },
+       { __MODULE_STRING(agp_enable),          
+          (drm_agp_func_u *)&drm_agp.enable          },
+       { __MODULE_STRING(agp_backend_acquire), 
+          (drm_agp_func_u *)&drm_agp.acquire         },
+       { __MODULE_STRING(agp_backend_release), 
+          (drm_agp_func_u *)&drm_agp.release         },
+       { __MODULE_STRING(agp_copy_info),       
+          (drm_agp_func_u *)&drm_agp.copy_info       },
+       { NULL, NULL }
+};
+
+int drm_agp_info(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;
+       agp_kern_info    *kern;
+       drm_agp_info_t   info;
+
+       if (!dev->agp->acquired || !drm_agp.copy_info) return -EINVAL;
+
+       kern                   = &dev->agp->agp_info;
+       info.agp_version_major = kern->version.major;
+       info.agp_version_minor = kern->version.minor;
+       info.mode              = kern->mode;
+       info.aperture_base     = kern->aper_base;
+       info.aperture_size     = kern->aper_size * 1024 * 1024;
+       info.memory_allowed    = kern->max_memory << PAGE_SHIFT;
+       info.memory_used       = kern->current_memory << PAGE_SHIFT;
+       info.id_vendor         = kern->device->vendor;
+       info.id_device         = kern->device->device;
+
+       copy_to_user_ret((drm_agp_info_t *)arg, &info, sizeof(info), -EFAULT);
+       return 0;
+}
+
+int drm_agp_acquire(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;
+       int              retcode;
+
+       if (dev->agp->acquired || !drm_agp.acquire) return -EINVAL;
+       if ((retcode = (*drm_agp.acquire)())) return retcode;
+       dev->agp->acquired = 1;
+       return 0;
+}
+
+int drm_agp_release(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;
+
+       if (!dev->agp->acquired || !drm_agp.release) return -EINVAL;
+       (*drm_agp.release)();
+       dev->agp->acquired = 0;
+       return 0;
+       
+}
+
+int drm_agp_enable(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_agp_mode_t   mode;
+
+       if (!dev->agp->acquired || !drm_agp.enable) return -EINVAL;
+
+       copy_from_user_ret(&mode, (drm_agp_mode_t *)arg, sizeof(mode),
+                          -EFAULT);
+       
+       dev->agp->mode    = mode.mode;
+       (*drm_agp.enable)(mode.mode);
+       dev->agp->base    = dev->agp->agp_info.aper_base;
+       dev->agp->enabled = 1;
+       return 0;
+}
+
+int drm_agp_alloc(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_agp_buffer_t request;
+       drm_agp_mem_t    *entry;
+       agp_memory       *memory;
+       unsigned long    pages;
+       u32              type;
+       if (!dev->agp->acquired) return -EINVAL;
+       copy_from_user_ret(&request, (drm_agp_buffer_t *)arg, sizeof(request),
+                          -EFAULT);
+       if (!(entry = drm_alloc(sizeof(*entry), DRM_MEM_AGPLISTS)))
+               return -ENOMEM;
+   
+       memset(entry, 0, sizeof(*entry));
+
+       pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
+       type = (u32) request.type;
+
+       if (!(memory = drm_alloc_agp(pages, type))) {
+               drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+               return -ENOMEM;
+       }
+       
+       entry->handle    = (unsigned long)memory->memory;
+       entry->memory    = memory;
+       entry->bound     = 0;
+       entry->pages     = pages;
+       entry->prev      = NULL;
+       entry->next      = dev->agp->memory;
+       if (dev->agp->memory) dev->agp->memory->prev = entry;
+       dev->agp->memory = entry;
+
+       request.handle   = entry->handle;
+        request.physical = memory->physical;
+
+       if (copy_to_user((drm_agp_buffer_t *)arg, &request, sizeof(request))) {
+               dev->agp->memory       = entry->next;
+               dev->agp->memory->prev = NULL;
+               drm_free_agp(memory, pages);
+               drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+               return -EFAULT;
+       }
+       return 0;
+}
+
+static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t *dev,
+                                          unsigned long handle)
+{
+       drm_agp_mem_t *entry;
+
+       for (entry = dev->agp->memory; entry; entry = entry->next) {
+               if (entry->handle == handle) return entry;
+       }
+       return NULL;
+}
+
+int drm_agp_unbind(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_agp_binding_t request;
+       drm_agp_mem_t     *entry;
+
+       if (!dev->agp->acquired) return -EINVAL;
+       copy_from_user_ret(&request, (drm_agp_binding_t *)arg, sizeof(request),
+                          -EFAULT);
+       if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
+               return -EINVAL;
+       if (!entry->bound) return -EINVAL;
+       return drm_unbind_agp(entry->memory);
+}
+
+int drm_agp_bind(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_agp_binding_t request;
+       drm_agp_mem_t     *entry;
+       int               retcode;
+       int               page;
+       
+       if (!dev->agp->acquired || !drm_agp.bind_memory) return -EINVAL;
+       copy_from_user_ret(&request, (drm_agp_binding_t *)arg, sizeof(request),
+                          -EFAULT);
+       if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
+               return -EINVAL;
+       if (entry->bound) return -EINVAL;
+       page = (request.offset + PAGE_SIZE - 1) / PAGE_SIZE;
+       if ((retcode = drm_bind_agp(entry->memory, page))) return retcode;
+       entry->bound = dev->agp->base + (page << PAGE_SHIFT);
+       DRM_DEBUG("base = 0x%lx entry->bound = 0x%lx\n", 
+                 dev->agp->base, entry->bound);
+       return 0;
+}
+
+int drm_agp_free(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_agp_buffer_t request;
+       drm_agp_mem_t    *entry;
+       
+       if (!dev->agp->acquired) return -EINVAL;
+       copy_from_user_ret(&request, (drm_agp_buffer_t *)arg, sizeof(request),
+                          -EFAULT);
+       if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
+               return -EINVAL;
+       if (entry->bound) drm_unbind_agp(entry->memory);
+   
+       if (entry->prev) entry->prev->next = entry->next;
+       else             dev->agp->memory  = entry->next;
+       if (entry->next) entry->next->prev = entry->prev;
+       drm_free_agp(entry->memory, entry->pages);
+       drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+       return 0;
+}
+
+drm_agp_head_t *drm_agp_init(void)
+{
+       drm_agp_fill_t *fill;
+       drm_agp_head_t *head         = NULL;
+       int            agp_available = 1;
+
+       for (fill = &drm_agp_fill[0]; fill->name; fill++) {
+               char *n  = (char *)fill->name;
+               *fill->f = (drm_agp_func_u)get_module_symbol(NULL, n);
+               DRM_DEBUG("%s resolves to 0x%08lx\n", n, (*fill->f).address);
+               if (!(*fill->f).address) agp_available = 0;
+       }
+   
+       DRM_DEBUG("agp_available = %d\n", agp_available);
+
+       if (agp_available) {
+               if (!(head = drm_alloc(sizeof(*head), DRM_MEM_AGPLISTS)))
+                       return NULL;
+               memset((void *)head, 0, sizeof(*head));
+               (*drm_agp.copy_info)(&head->agp_info);
+               head->memory = NULL;
+               switch (head->agp_info.chipset) {
+               case INTEL_GENERIC:  head->chipset = "Intel";          break;
+               case INTEL_LX:       head->chipset = "Intel 440LX";    break;
+               case INTEL_BX:       head->chipset = "Intel 440BX";    break;
+               case INTEL_GX:       head->chipset = "Intel 440GX";    break;
+               case INTEL_I810:     head->chipset = "Intel i810";     break;
+               case VIA_GENERIC:    head->chipset = "VIA";            break;
+               case VIA_VP3:        head->chipset = "VIA VP3";        break;
+               case VIA_MVP3:       head->chipset = "VIA MVP3";       break;
+               case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro"; break;
+               case SIS_GENERIC:    head->chipset = "SiS";            break;
+               case AMD_GENERIC:    head->chipset = "AMD";            break;
+               case AMD_IRONGATE:   head->chipset = "AMD Irongate";   break;
+               case ALI_GENERIC:    head->chipset = "ALi";            break;
+               case ALI_M1541:      head->chipset = "ALi M1541";      break;
+               default:
+               }
+               DRM_INFO("AGP %d.%d on %s @ 0x%08lx %dMB\n",
+                        head->agp_info.version.major,
+                        head->agp_info.version.minor,
+                        head->chipset,
+                        head->agp_info.aper_base,
+                        head->agp_info.aper_size);
+       }
+       return head;
+}
+
+void drm_agp_uninit(void)
+{
+       drm_agp_fill_t *fill;
+       
+       for (fill = &drm_agp_fill[0]; fill->name; fill++) {
+#if LINUX_VERSION_CODE >= 0x020400
+               if ((*fill->f).address) put_module_symbol((*fill->f).address);
+#endif
+               (*fill->f).address = 0;
+       }
+}
index ebf0671f44209d38516e5dec72157b68b172e581..9f81c5391dde9182c66004629fe5ee7936c4b3e1 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Tue Feb  2 08:37:54 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
@@ -44,7 +45,6 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic)
 
        down(&dev->struct_sem);
        for (pt = dev->magiclist[hash].head; pt; pt = pt->next) {
-               if (pt->priv->authenticated) continue;
                if (pt->magic == magic) {
                        retval = pt->priv;
                        break;
index 3d4c402224d69620ca345255fd08343e4eb75eed..fd3b12488d02466c3831ed4257771495241ca74a 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Tue Feb  2 08:37:54 1999 by faith@precisioninsight.com
  *
  * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
@@ -71,7 +72,7 @@ int drm_addmap(struct inode *inode, struct file *filp, unsigned int cmd,
 
        switch (map->type) {
        case _DRM_REGISTERS:
-       case _DRM_FRAME_BUFFER: 
+       case _DRM_FRAME_BUFFER:
 #ifndef __sparc__
                if (map->offset + map->size < map->offset
                    || map->offset < virt_to_phys(high_memory)) {
@@ -105,6 +106,11 @@ int drm_addmap(struct inode *inode, struct file *filp, unsigned int cmd,
                        dev->lock.hw_lock = map->handle; /* Pointer to lock */
                }
                break;
+#ifdef DRM_AGP
+       case _DRM_AGP:
+               map->offset = map->offset + dev->agp->base;
+               break;
+#endif
        default:
                drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                return -EINVAL;
@@ -175,7 +181,7 @@ int drm_addbufs(struct inode *inode, struct file *filp, unsigned int cmd,
        if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
        if (dev->queue_count) return -EBUSY; /* Not while in use */
 
-       alignment  = (request.flags & DRM_PAGE_ALIGN) ? PAGE_ALIGN(size) :size;
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size):size;
        page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
        total      = PAGE_SIZE << page_order;
 
index a8919d83d9b0489dfc0fff5d621497ed3668702f..ca491094eb369cb2a4fa410204de91d333155b8b 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Tue Feb  2 08:37:54 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
diff --git a/drivers/char/drm/ctxbitmap.c b/drivers/char/drm/ctxbitmap.c
new file mode 100644 (file)
index 0000000..6155059
--- /dev/null
@@ -0,0 +1,85 @@
+/* ctxbitmap.c -- Context bitmap management -*- linux-c -*-
+ * Created: Thu Jan 6 03:56:42 2000 by jhartmann@precisioninsight.com
+ * 
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+
+void drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle)
+{
+       if (ctx_handle < 0) goto failed;
+
+       if (ctx_handle < DRM_MAX_CTXBITMAP) {
+               clear_bit(ctx_handle, dev->ctx_bitmap);
+               return;
+       }
+failed:
+               DRM_ERROR("Attempt to free invalid context handle: %d\n",
+                 ctx_handle);
+               return;
+}
+
+int drm_ctxbitmap_next(drm_device_t *dev)
+{
+       int bit;
+
+       bit = find_first_zero_bit(dev->ctx_bitmap, DRM_MAX_CTXBITMAP);
+       if (bit < DRM_MAX_CTXBITMAP) {
+               set_bit(bit, dev->ctx_bitmap);
+               DRM_DEBUG("drm_ctxbitmap_next bit : %d\n", bit);
+               return bit;
+       }
+       return -1;
+}
+
+int drm_ctxbitmap_init(drm_device_t *dev)
+{
+       int i;
+       int temp;
+
+       dev->ctx_bitmap = (unsigned long *) drm_alloc(PAGE_SIZE, 
+                                                     DRM_MEM_CTXBITMAP);
+       if(dev->ctx_bitmap == NULL) {
+               return -ENOMEM;
+       }
+       memset((void *) dev->ctx_bitmap, 0, PAGE_SIZE);
+       for(i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
+               temp = drm_ctxbitmap_next(dev);
+               DRM_DEBUG("drm_ctxbitmap_init : %d\n", temp);
+       }
+
+       return 0;
+}
+
+void drm_ctxbitmap_cleanup(drm_device_t *dev)
+{
+       drm_free((void *)dev->ctx_bitmap, PAGE_SIZE,
+                DRM_MEM_CTXBITMAP);
+}
+
index 0ec14ede5d5bc34e3129e775b04208d4ca2416df..ac2d1bc5aac7325056596748a1071e4d73846c4f 100644 (file)
@@ -1,7 +1,8 @@
 /* dma.c -- DMA IOCTL and function support -*- linux-c -*-
  * Created: Fri Mar 19 14:30:16 1999 by faith@precisioninsight.com
  *
- * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinuxa.com>
  *
  */
 
@@ -63,15 +64,24 @@ void drm_dma_takedown(drm_device_t *dev)
                                               dma->bufs[i].page_order,
                                               DRM_MEM_DMA);
                        }
-                       drm_free(dma->bufs[i].buflist,
-                                dma->buf_count
-                                * sizeof(*dma->bufs[0].buflist),
-                                DRM_MEM_BUFS);
                        drm_free(dma->bufs[i].seglist,
-                                dma->buf_count
+                                dma->bufs[i].seg_count
                                 * sizeof(*dma->bufs[0].seglist),
                                 DRM_MEM_SEGS);
-                       drm_freelist_destroy(&dma->bufs[i].freelist);
+               }
+               if(dma->bufs[i].buf_count) {
+                       for(j = 0; j < dma->bufs[i].buf_count; j++) {
+                          if(dma->bufs[i].buflist[j].dev_private) {
+                             drm_free(dma->bufs[i].buflist[j].dev_private,
+                                      dma->bufs[i].buflist[j].dev_priv_size,
+                                      DRM_MEM_BUFS);
+                          }
+                       }
+                       drm_free(dma->bufs[i].buflist,
+                                dma->bufs[i].buf_count *
+                                sizeof(*dma->bufs[0].buflist),
+                                DRM_MEM_BUFS);
+                       drm_freelist_destroy(&dma->bufs[i].freelist);
                }
        }
        
index 19e5da3b7baf0043eefbcfed7ba6f543766e6930..03839f5be544403907adb7e878e663a721fc7c75 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Tue Feb  2 08:37:54 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
index fe0f8defec232f8174cef19f7b52e07a535e215f..5a979e1cbf96cbf2f57b54fd3f31be70ac9c2988 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan  4 10:05:05 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  * Acknowledgements:
  * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
@@ -61,6 +62,20 @@ typedef unsigned int  drm_context_t;
 typedef unsigned int  drm_drawable_t;
 typedef unsigned int  drm_magic_t;
 
+/* Warning: If you change this structure, make sure you change
+ * XF86DRIClipRectRec in the server as well */
+
+typedef struct drm_clip_rect {
+           unsigned short x1;
+           unsigned short y1;
+           unsigned short x2;
+           unsigned short y2;
+} drm_clip_rect_t;
+
+/* Seperate include files for the i810/mga/r128 specific structures */
+#include "mga_drm.h"
+#include "i810_drm.h"
+#include "r128_drm.h"
 
 typedef struct drm_version {
        int    version_major;     /* Major version                          */
@@ -101,7 +116,8 @@ typedef struct drm_control {
 typedef enum drm_map_type {
        _DRM_FRAME_BUFFER = 0,    /* WC (no caching), no core dump          */
        _DRM_REGISTERS    = 1,    /* no caching, no core dump               */
-       _DRM_SHM          = 2     /* shared, cached                         */
+       _DRM_SHM          = 2,    /* shared, cached                         */
+       _DRM_AGP          = 3     /* AGP/GART                               */
 } drm_map_type_t;
 
 typedef enum drm_map_flags {
@@ -165,8 +181,11 @@ typedef struct drm_buf_desc {
        int           low_mark;  /* Low water mark                           */
        int           high_mark; /* High water mark                          */
        enum {
-               DRM_PAGE_ALIGN = 0x01  /* Align on page boundaries for DMA   */
+               _DRM_PAGE_ALIGN = 0x01, /* Align on page boundaries for DMA  */
+               _DRM_AGP_BUFFER = 0x02  /* Buffer is in agp space            */
        }             flags;
+       unsigned long agp_start; /* Start address of where the agp buffers
+                                 * are in the agp aperture */
 } drm_buf_desc_t;
 
 typedef struct drm_buf_info {
@@ -237,6 +256,38 @@ typedef struct drm_irq_busid {
        int funcnum;
 } drm_irq_busid_t;
 
+typedef struct drm_agp_mode {
+       unsigned long mode;
+} drm_agp_mode_t;
+
+                               /* For drm_agp_alloc -- allocated a buffer */
+typedef struct drm_agp_buffer {
+       unsigned long size;     /* In bytes -- will round to page boundary */
+       unsigned long handle;   /* Used for BIND/UNBIND ioctls */
+       unsigned long type;     /* Type of memory to allocate  */
+        unsigned long physical; /* Physical used by i810       */
+} drm_agp_buffer_t;
+
+                               /* For drm_agp_bind */
+typedef struct drm_agp_binding {
+       unsigned long handle;   /* From drm_agp_buffer */
+       unsigned long offset;   /* In bytes -- will round to page boundary */
+} drm_agp_binding_t;
+
+typedef struct drm_agp_info {
+       int            agp_version_major;
+       int            agp_version_minor;
+       unsigned long  mode;
+       unsigned long  aperture_base;  /* physical address */
+       unsigned long  aperture_size;  /* bytes */
+       unsigned long  memory_allowed; /* bytes */
+       unsigned long  memory_used;
+
+                               /* PCI information */
+       unsigned short id_vendor;
+       unsigned short id_device;
+} drm_agp_info_t;
+
 #define DRM_IOCTL_BASE      'd'
 #define DRM_IOCTL_NR(n)             _IOC_NR(n)
 #define DRM_IO(nr)          _IO(DRM_IOCTL_BASE,nr)
@@ -247,7 +298,7 @@ typedef struct drm_irq_busid {
 
 #define DRM_IOCTL_VERSION    DRM_IOWR(0x00, drm_version_t)
 #define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm_unique_t)
-#define DRM_IOCTL_GET_MAGIC  DRM_IOW( 0x02, drm_auth_t)
+#define DRM_IOCTL_GET_MAGIC  DRM_IOR( 0x02, drm_auth_t)
 #define DRM_IOCTL_IRQ_BUSID  DRM_IOWR(0x03, drm_irq_busid_t)
 
 #define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm_unique_t)
@@ -276,4 +327,41 @@ typedef struct drm_irq_busid {
 #define DRM_IOCTL_UNLOCK     DRM_IOW( 0x2b, drm_lock_t)
 #define DRM_IOCTL_FINISH     DRM_IOW( 0x2c, drm_lock_t)
 
+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO(  0x30)
+#define DRM_IOCTL_AGP_RELEASE DRM_IO(  0x31)
+#define DRM_IOCTL_AGP_ENABLE  DRM_IOW( 0x32, drm_agp_mode_t)
+#define DRM_IOCTL_AGP_INFO    DRM_IOR( 0x33, drm_agp_info_t)
+#define DRM_IOCTL_AGP_ALLOC   DRM_IOWR(0x34, drm_agp_buffer_t)
+#define DRM_IOCTL_AGP_FREE    DRM_IOW( 0x35, drm_agp_buffer_t)
+#define DRM_IOCTL_AGP_BIND    DRM_IOW( 0x36, drm_agp_binding_t)
+#define DRM_IOCTL_AGP_UNBIND  DRM_IOW( 0x37, drm_agp_binding_t)
+
+/* Mga specific ioctls */
+#define DRM_IOCTL_MGA_INIT    DRM_IOW( 0x40, drm_mga_init_t)
+#define DRM_IOCTL_MGA_SWAP    DRM_IOW( 0x41, drm_mga_swap_t)
+#define DRM_IOCTL_MGA_CLEAR   DRM_IOW( 0x42, drm_mga_clear_t)
+#define DRM_IOCTL_MGA_ILOAD   DRM_IOW( 0x43, drm_mga_iload_t)
+#define DRM_IOCTL_MGA_VERTEX  DRM_IOW( 0x44, drm_mga_vertex_t)
+#define DRM_IOCTL_MGA_FLUSH   DRM_IOW( 0x45, drm_lock_t )
+#define DRM_IOCTL_MGA_INDICES DRM_IOW( 0x46, drm_mga_indices_t)
+
+/* I810 specific ioctls */
+#define DRM_IOCTL_I810_INIT    DRM_IOW( 0x40, drm_i810_init_t)
+#define DRM_IOCTL_I810_VERTEX  DRM_IOW( 0x41, drm_i810_vertex_t)
+#define DRM_IOCTL_I810_CLEAR   DRM_IOW( 0x42, drm_i810_clear_t)
+#define DRM_IOCTL_I810_FLUSH   DRM_IO ( 0x43)
+#define DRM_IOCTL_I810_GETAGE  DRM_IO ( 0x44)
+#define DRM_IOCTL_I810_GETBUF  DRM_IOWR(0x45, drm_i810_dma_t)
+#define DRM_IOCTL_I810_SWAP    DRM_IO ( 0x46)
+#define DRM_IOCTL_I810_COPY    DRM_IOW( 0x47, drm_i810_copy_t)
+#define DRM_IOCTL_I810_DOCOPY  DRM_IO ( 0x48)
+
+/* Rage 128 specific ioctls */
+#define DRM_IOCTL_R128_INIT    DRM_IOW( 0x40, drm_r128_init_t)
+#define DRM_IOCTL_R128_RESET   DRM_IO(  0x41)
+#define DRM_IOCTL_R128_FLUSH   DRM_IO(  0x42)
+#define DRM_IOCTL_R128_IDLE    DRM_IO(  0x43)
+#define DRM_IOCTL_R128_PACKET  DRM_IOW( 0x44, drm_r128_packet_t)
+#define DRM_IOCTL_R128_VERTEX  DRM_IOW( 0x45, drm_r128_vertex_t)
+
 #endif
index b39fec3f704abca89dae1ee923b393482b9db17d..d8791bf95b9507f82a6da2dcff639ae7afc57c18 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan  4 10:05:05 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  * 
  */
 
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
 #endif
+#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+#define DRM_AGP
+#endif
+#ifdef DRM_AGP
+#include <linux/types.h>
+#include <linux/agp_backend.h>
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+#include <linux/tqueue.h>
 #include <linux/poll.h>
 #endif
 #include "drm.h"
 #define DRM_FLAG_DEBUG   0x01
 #define DRM_FLAG_NOCTX   0x02
 
-#define DRM_MEM_DMA      0
-#define DRM_MEM_SAREA    1
-#define DRM_MEM_DRIVER   2
-#define DRM_MEM_MAGIC    3
-#define DRM_MEM_IOCTLS   4
-#define DRM_MEM_MAPS     5
-#define DRM_MEM_VMAS     6
-#define DRM_MEM_BUFS     7
-#define DRM_MEM_SEGS     8
-#define DRM_MEM_PAGES    9
-#define DRM_MEM_FILES   10
-#define DRM_MEM_QUEUES  11
-#define DRM_MEM_CMDS    12
-#define DRM_MEM_MAPPINGS 13
-#define DRM_MEM_BUFLISTS 14
+#define DRM_MEM_DMA       0
+#define DRM_MEM_SAREA     1
+#define DRM_MEM_DRIVER    2
+#define DRM_MEM_MAGIC     3
+#define DRM_MEM_IOCTLS    4
+#define DRM_MEM_MAPS      5
+#define DRM_MEM_VMAS      6
+#define DRM_MEM_BUFS      7
+#define DRM_MEM_SEGS      8
+#define DRM_MEM_PAGES     9
+#define DRM_MEM_FILES    10
+#define DRM_MEM_QUEUES   11
+#define DRM_MEM_CMDS     12
+#define DRM_MEM_MAPPINGS  13
+#define DRM_MEM_BUFLISTS  14
+#define DRM_MEM_AGPLISTS  15
+#define DRM_MEM_TOTALAGP  16
+#define DRM_MEM_BOUNDAGP  17
+#define DRM_MEM_CTXBITMAP 18
+
+#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
 
                                /* Backward compatibility section */
                                /* _PAGE_WT changed to _PAGE_PWT in 2.2.6 */
@@ -115,6 +130,14 @@ typedef struct wait_queue *wait_queue_head_t;
 #endif
 #ifndef NOPAGE_OOM
 #define NOPAGE_OOM 0
+#endif
+
+                               /* module_init/module_exit added in 2.3.13 */
+#ifndef module_init
+#define module_init(x)  int init_module(void) { return x(); }
+#endif
+#ifndef module_exit
+#define module_exit(x)  void cleanup_module(void) { x(); }
 #endif
 
                                /* Generic cmpxchg added in 2.3.x */
@@ -213,8 +236,8 @@ typedef struct drm_magic_entry {
 } drm_magic_entry_t;
 
 typedef struct drm_magic_head {
-       struct drm_magic_entry *head;
-       struct drm_magic_entry *tail;
+       struct drm_magic_entry *head;
+       struct drm_magic_entry *tail;
 } drm_magic_head_t;
 
 typedef struct drm_vma_entry {
@@ -230,6 +253,7 @@ typedef struct drm_buf {
        int               used;        /* Amount of buffer in use (for DMA)  */
        unsigned long     offset;      /* Byte offset (used internally)      */
        void              *address;    /* Address of buffer                  */
+       unsigned long     bus_address; /* Bus address of buffer              */
        struct drm_buf    *next;       /* Kernel-only: used for free list    */
        __volatile__ int  waiting;     /* On kernel DMA queue                */
        __volatile__ int  pending;     /* On hardware DMA queue              */
@@ -245,12 +269,16 @@ typedef struct drm_buf {
                DRM_LIST_PRIO    = 4,
                DRM_LIST_RECLAIM = 5
        }                 list;        /* Which list we're on                */
+
 #if DRM_DMA_HISTOGRAM
        cycles_t          time_queued;     /* Queued to kernel DMA queue     */
        cycles_t          time_dispatched; /* Dispatched to hardware         */
        cycles_t          time_completed;  /* Completed by hardware          */
        cycles_t          time_freed;      /* Back on freelist               */
 #endif
+
+       int               dev_priv_size; /* Size of buffer private stoarge   */
+       void              *dev_private;  /* Per-buffer private storage       */
 } drm_buf_t;
 
 #if DRM_DMA_HISTOGRAM
@@ -371,6 +399,9 @@ typedef struct drm_device_dma {
        int               page_count;
        unsigned long     *pagelist;
        unsigned long     byte_count;
+       enum {
+          _DRM_DMA_USE_AGP = 0x01
+       } flags;
 
                                /* DMA support */
        drm_buf_t         *this_buffer; /* Buffer being sent               */
@@ -379,6 +410,41 @@ typedef struct drm_device_dma {
        wait_queue_head_t waiting;      /* Processes waiting on free bufs  */
 } drm_device_dma_t;
 
+#ifdef DRM_AGP
+typedef struct drm_agp_mem {
+       unsigned long      handle;
+       agp_memory         *memory;
+       unsigned long      bound; /* address */
+       int                pages;
+       struct drm_agp_mem *prev;
+       struct drm_agp_mem *next;
+} drm_agp_mem_t;
+
+typedef struct drm_agp_head {
+       agp_kern_info      agp_info;
+       const char         *chipset;
+       drm_agp_mem_t      *memory;
+       unsigned long      mode;
+       int                enabled;
+       int                acquired;
+       unsigned long      base;
+       int                agp_mtrr;
+} drm_agp_head_t;
+
+typedef struct {
+       void       (*free_memory)(agp_memory *);
+       agp_memory *(*allocate_memory)(size_t, u32);
+       int        (*bind_memory)(agp_memory *, off_t);
+       int        (*unbind_memory)(agp_memory *);
+       void       (*enable)(u32);
+       int        (*acquire)(void);
+       void       (*release)(void);
+       void       (*copy_info)(agp_kern_info *);
+} drm_agp_func_t;
+
+extern drm_agp_func_t drm_agp;
+#endif
+
 typedef struct drm_device {
        const char        *name;        /* Simple driver name              */
        char              *unique;      /* Unique identifier: e.g., busid  */
@@ -433,9 +499,9 @@ typedef struct drm_device {
 
                                /* Context support */
        int               irq;          /* Interrupt used by board         */
-       __volatile__ long context_flag;  /* Context swapping flag          */
-       __volatile__ long interrupt_flag;/* Interruption handler flag      */
-       __volatile__ long dma_flag;      /* DMA dispatch flag              */
+       __volatile__ int  context_flag;  /* Context swapping flag          */
+       __volatile__ int  interrupt_flag;/* Interruption handler flag      */
+       __volatile__ int  dma_flag;      /* DMA dispatch flag              */
        struct timer_list timer;        /* Timer for delaying ctx switch   */
        wait_queue_head_t context_wait; /* Processes waiting on ctx switch */
        int               last_checked; /* Last context checked for DMA    */
@@ -457,6 +523,12 @@ typedef struct drm_device {
        struct fasync_struct *buf_async;/* Processes waiting for SIGIO     */
        wait_queue_head_t buf_readers;  /* Processes waiting to read       */
        wait_queue_head_t buf_writers;  /* Processes waiting to ctx switch */
+       
+#ifdef DRM_AGP
+       drm_agp_head_t    *agp;
+#endif
+       unsigned long     *ctx_bitmap;
+       void              *dev_private;
 } drm_device_t;
 
 
@@ -529,6 +601,14 @@ extern void             drm_free_pages(unsigned long address, int order,
 extern void         *drm_ioremap(unsigned long offset, unsigned long size);
 extern void         drm_ioremapfree(void *pt, unsigned long size);
 
+#ifdef DRM_AGP
+extern agp_memory    *drm_alloc_agp(int pages, u32 type);
+extern int           drm_free_agp(agp_memory *handle, int pages);
+extern int           drm_bind_agp(agp_memory *handle, unsigned int start);
+extern int           drm_unbind_agp(agp_memory *handle);
+#endif
+
+
                                /* Buffer management support (bufs.c) */
 extern int          drm_order(unsigned long size);
 extern int          drm_addmap(struct inode *inode, struct file *filp,
@@ -638,5 +718,33 @@ extern int      drm_flush_unblock(drm_device_t *dev, int context,
                                       drm_lock_flags_t flags);
 extern int          drm_flush_block_and_flush(drm_device_t *dev, int context,
                                               drm_lock_flags_t flags);
+
+                               /* Context Bitmap support (ctxbitmap.c) */
+extern int          drm_ctxbitmap_init(drm_device_t *dev);
+extern void         drm_ctxbitmap_cleanup(drm_device_t *dev);
+extern int          drm_ctxbitmap_next(drm_device_t *dev);
+extern void         drm_ctxbitmap_free(drm_device_t *dev, int ctx_handle);
+
+#ifdef DRM_AGP
+                               /* AGP/GART support (agpsupport.c) */
+extern drm_agp_head_t *drm_agp_init(void);
+extern void           drm_agp_uninit(void);
+extern int            drm_agp_acquire(struct inode *inode, struct file *filp,
+                                     unsigned int cmd, unsigned long arg);
+extern int            drm_agp_release(struct inode *inode, struct file *filp,
+                                     unsigned int cmd, unsigned long arg);
+extern int            drm_agp_enable(struct inode *inode, struct file *filp,
+                                    unsigned int cmd, unsigned long arg);
+extern int            drm_agp_info(struct inode *inode, struct file *filp,
+                                  unsigned int cmd, unsigned long arg);
+extern int            drm_agp_alloc(struct inode *inode, struct file *filp,
+                                   unsigned int cmd, unsigned long arg);
+extern int            drm_agp_free(struct inode *inode, struct file *filp,
+                                  unsigned int cmd, unsigned long arg);
+extern int            drm_agp_unbind(struct inode *inode, struct file *filp,
+                                    unsigned int cmd, unsigned long arg);
+extern int            drm_agp_bind(struct inode *inode, struct file *filp,
+                                  unsigned int cmd, unsigned long arg);
+#endif
 #endif
 #endif
index 76e0dc2c1950c4165624563b00075a5b0cb942ce..f3966d96b8d34df69b0c25c239e1186b90cc31ea 100644 (file)
@@ -1,7 +1,8 @@
 /* fops.c -- File operations for DRM -*- linux-c -*-
  * Created: Mon Jan  4 08:58:31 1999 by faith@precisioninsight.com
  *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
- *    Daryll Strauss <daryll@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
+ *    Daryll Strauss <daryll@valinux.com>
  *
  */
 
 #define __NO_VERSION__
 #include "drmP.h"
+#include <linux/poll.h>
 
 /* drm_open is called whenever a process opens /dev/drm. */
 
@@ -92,7 +94,7 @@ int drm_release(struct inode *inode, struct file *filp)
        DRM_DEBUG("pid = %d, device = 0x%x, open_count = %d\n",
                  current->pid, dev->device, dev->open_count);
 
-       if (dev->lock.hw_lock != NULL
+       if (dev->lock.hw_lock
            && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)
            && dev->lock.pid == current->pid) {
                DRM_ERROR("Process %d dead, freeing lock for context %d\n",
@@ -213,11 +215,23 @@ int drm_write_string(drm_device_t *dev, const char *s)
                send -= count;
        }
 
-#if LINUX_VERSION_CODE < 0x020315
+#if LINUX_VERSION_CODE < 0x020315 && !defined(KILLFASYNCHASTHREEPARAMETERS)
+       /* The extra parameter to kill_fasync was added in 2.3.21, and is
+           _not_ present in _stock_ 2.2.14 and 2.2.15.  However, some
+           distributions patch 2.2.x kernels to add this parameter.  The
+           Makefile.linux attempts to detect this addition and defines
+           KILLFASYNCHASTHREEPARAMETERS if three parameters are found. */
        if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO);
 #else
-                               /* Parameter added in 2.3.21 */
-       kill_fasync(&dev->buf_async, SIGIO, POLL_IN);
+
+                               /* Parameter added in 2.3.21. */
+#if LINUX_VERSION_CODE < 0x020400
+       if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN);
+#else
+                               /* Type of first parameter changed in
+                                   Linux 2.4.0-test2... */
+       if (dev->buf_async) kill_fasync(&dev->buf_async, SIGIO, POLL_IN);
+#endif
 #endif
        DRM_DEBUG("waking\n");
        wake_up_interruptible(&dev->buf_readers);
index 1f8c0a7de90e55b09030111a70164715f790664d..a99f24caeef1c5b91802a3cb2ed948db37f0e19e 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Fri Mar 19 14:30:16 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
@@ -87,13 +88,31 @@ static inline void gamma_dma_dispatch(drm_device_t *dev, unsigned long address,
        GAMMA_WRITE(GAMMA_DMACOUNT, length / 4);
 }
 
-static inline void gamma_dma_quiescent(drm_device_t *dev)
+static inline void gamma_dma_quiescent_single(drm_device_t *dev)
 {
        while (GAMMA_READ(GAMMA_DMACOUNT))
                ;
        while (GAMMA_READ(GAMMA_INFIFOSPACE) < 3)
                ;
+
+       GAMMA_WRITE(GAMMA_FILTERMODE, 1 << 10);
+       GAMMA_WRITE(GAMMA_SYNC, 0);
+       
+       do {
+               while (!GAMMA_READ(GAMMA_OUTFIFOWORDS))
+                       ;
+       } while (GAMMA_READ(GAMMA_OUTPUTFIFO) != GAMMA_SYNC_TAG);
+}
+
+static inline void gamma_dma_quiescent_dual(drm_device_t *dev)
+{
+       while (GAMMA_READ(GAMMA_DMACOUNT))
+               ;
+       while (GAMMA_READ(GAMMA_INFIFOSPACE) < 3)
+               ;
+
        GAMMA_WRITE(GAMMA_BROADCASTMASK, 3);
+
        GAMMA_WRITE(GAMMA_FILTERMODE, 1 << 10);
        GAMMA_WRITE(GAMMA_SYNC, 0);
        
@@ -103,7 +122,6 @@ static inline void gamma_dma_quiescent(drm_device_t *dev)
                        ;
        } while (GAMMA_READ(GAMMA_OUTPUTFIFO) != GAMMA_SYNC_TAG);
        
-
                                /* Read from second MX */
        do {
                while (!GAMMA_READ(GAMMA_OUTFIFOWORDS + 0x10000))
@@ -788,8 +806,13 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd,
        if (!ret) {
                if (lock.flags & _DRM_LOCK_READY)
                        gamma_dma_ready(dev);
-               if (lock.flags & _DRM_LOCK_QUIESCENT)
-                       gamma_dma_quiescent(dev);
+               if (lock.flags & _DRM_LOCK_QUIESCENT) {
+                       if (gamma_found() == 1) {
+                               gamma_dma_quiescent_single(dev);
+                       } else {
+                               gamma_dma_quiescent_dual(dev);
+                       }
+               }
        }
        DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
 
index 8809d18101d533025efa28be7c21cc3f33f23222..2450d3a7b689c432aaf0769b5d7084af19333a30 100644 (file)
@@ -1,7 +1,8 @@
 /* gamma.c -- 3dlabs GMX 2000 driver -*- linux-c -*-
  * Created: Mon Jan  4 08:58:31 1999 by faith@precisioninsight.com
  *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
 #include <linux/config.h>
-#include <linux/sched.h>
-#include <linux/smp_lock.h>
+#ifndef EXPORT_SYMTAB
+#define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "gamma_drv.h"
+#include <linux/pci.h>
+#include <linux/smp_lock.h>    /* For (un)lock_kernel */
 EXPORT_SYMBOL(gamma_init);
 EXPORT_SYMBOL(gamma_cleanup);
 
+#ifndef PCI_DEVICE_ID_3DLABS_GAMMA
+#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008
+#endif
+#ifndef PCI_DEVICE_ID_3DLABS_MX
+#define PCI_DEVICE_ID_3DLABS_MX 0x0006
+#endif
+
 #define GAMMA_NAME      "gamma"
 #define GAMMA_DESC      "3dlabs GMX 2000"
-#define GAMMA_DATE      "19990830"
-#define GAMMA_MAJOR     0
+#define GAMMA_DATE      "20000719"
+#define GAMMA_MAJOR     1
 #define GAMMA_MINOR     0
-#define GAMMA_PATCHLEVEL 5
+#define GAMMA_PATCHLEVEL 0
 
 static drm_device_t          gamma_device;
 
 static struct file_operations gamma_fops = {
-       owner:          THIS_MODULE,
-       open:           gamma_open,
-       flush:          drm_flush,
-       release:        gamma_release,
-       ioctl:          gamma_ioctl,
-       mmap:           drm_mmap,
-       read:           drm_read,
-       fasync:         drm_fasync,
-       poll:           drm_poll,
+#if LINUX_VERSION_CODE >= 0x020322
+                               /* This started being used approx. 2.3.34 */
+       owner:   THIS_MODULE,
+#endif
+       open:    gamma_open,
+       flush:   drm_flush,
+       release: gamma_release,
+       ioctl:   gamma_ioctl,
+       mmap:    drm_mmap,
+       read:    drm_read,
+       fasync:  drm_fasync,
+       poll:    drm_poll,
 };
 
 static struct miscdevice      gamma_misc = {
@@ -98,46 +112,34 @@ static drm_ioctl_desc_t          gamma_ioctls[] = {
 #define GAMMA_IOCTL_COUNT DRM_ARRAY_SIZE(gamma_ioctls)
 
 #ifdef MODULE
-int                          init_module(void);
-void                         cleanup_module(void);
 static char                  *gamma = NULL;
+#endif
+static int                   devices = 0;
 
-MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
+MODULE_AUTHOR("VA Linux Systems, Inc.");
 MODULE_DESCRIPTION("3dlabs GMX 2000");
 MODULE_PARM(gamma, "s");
+MODULE_PARM(devices, "i");
+MODULE_PARM_DESC(devices,
+                "devices=x, where x is the number of MX chips on card\n");
 
-/* init_module is called when insmod is used to load the module */
-
-int init_module(void)
-{
-       return gamma_init();
-}
-
-/* cleanup_module is called when rmmod is used to unload the module */
-
-void cleanup_module(void)
-{
-       gamma_cleanup();
-}
-#endif
+module_init(gamma_init);
+module_exit(gamma_cleanup);
 
 #ifndef MODULE
-/* gamma_setup is called by the kernel to parse command-line options passed
- * via the boot-loader (e.g., LILO).  It calls the insmod option routine,
- * drm_parse_options.
- *
- * This is not currently supported, since it requires changes to
- * linux/init/main.c. */
+/* gamma_options is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO).  It calls the insmod option
+ * routine, drm_parse_options.
+ */
  
 
-void __init gamma_setup(char *str, int *ints)
+static int __init gamma_options(char *str)
 {
-       if (ints[0] != 0) {
-               DRM_ERROR("Illegal command line format, ignored\n");
-               return;
-       }
        drm_parse_options(str);
+       return 1;
 }
+
+__setup("gamma=", gamma_options);
 #endif
 
 static int gamma_setup(drm_device_t *dev)
@@ -274,6 +276,10 @@ static int gamma_takedown(drm_device_t *dev)
                                               - PAGE_SHIFT,
                                               DRM_MEM_SAREA);
                                break;
+                       case _DRM_AGP:
+                               /* Do nothing here, because this is all
+                                   handled in the AGP/GART driver. */
+                               break;
                        }
                        drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                }
@@ -313,6 +319,34 @@ static int gamma_takedown(drm_device_t *dev)
        return 0;
 }
 
+int gamma_found(void)
+{
+       return devices;
+}
+
+int gamma_find_devices(void)
+{
+       struct pci_dev *d = NULL, *one = NULL, *two = NULL;
+
+       d = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_GAMMA,d);
+       if (!d) return 0;
+
+       one = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_MX,d);
+       if (!one) return 0;
+
+       /* Make sure it's on the same card, if not - no MX's found */
+       if (PCI_SLOT(d->devfn) != PCI_SLOT(one->devfn)) return 0;
+
+       two = pci_find_device(PCI_VENDOR_ID_3DLABS,PCI_DEVICE_ID_3DLABS_MX,one);
+       if (!two) return 1;
+
+       /* Make sure it's on the same card, if not - only 1 MX found */
+       if (PCI_SLOT(d->devfn) != PCI_SLOT(two->devfn)) return 1;
+
+       /* Two MX's found - we don't currently support more than 2 */
+       return 2;
+}
+
 /* gamma_init is called via init_module at module load time, or via
  * linux/init/main.c (this is not currently supported). */
 
@@ -330,6 +364,8 @@ int gamma_init(void)
 #ifdef MODULE
        drm_parse_options(gamma);
 #endif
+       devices = gamma_find_devices();
+       if (devices == 0) return -1;
 
        if ((retcode = misc_register(&gamma_misc))) {
                DRM_ERROR("Cannot register \"%s\"\n", GAMMA_NAME);
@@ -341,13 +377,14 @@ int gamma_init(void)
        drm_mem_init();
        drm_proc_init(dev);
 
-       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
+       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d with %d MX devices\n",
                 GAMMA_NAME,
                 GAMMA_MAJOR,
                 GAMMA_MINOR,
                 GAMMA_PATCHLEVEL,
                 GAMMA_DATE,
-                gamma_misc.minor);
+                gamma_misc.minor,
+                devices);
        
        return 0;
 }
@@ -410,6 +447,7 @@ int gamma_open(struct inode *inode, struct file *filp)
        
        DRM_DEBUG("open_count = %d\n", dev->open_count);
        if (!(retcode = drm_open_helper(inode, filp, dev))) {
+               MOD_INC_USE_COUNT;
                atomic_inc(&dev->total_open);
                spin_lock(&dev->count_lock);
                if (!dev->open_count++) {
@@ -424,13 +462,13 @@ int gamma_open(struct inode *inode, struct file *filp)
 int gamma_release(struct inode *inode, struct file *filp)
 {
        drm_file_t    *priv   = filp->private_data;
-       drm_device_t  *dev;
+       drm_device_t  *dev    = priv->dev;
        int           retcode = 0;
 
-       lock_kernel();
-       dev    = priv->dev;
        DRM_DEBUG("open_count = %d\n", dev->open_count);
+       lock_kernel();
        if (!(retcode = drm_release(inode, filp))) {
+               MOD_DEC_USE_COUNT;
                atomic_inc(&dev->total_close);
                spin_lock(&dev->count_lock);
                if (!--dev->open_count) {
index a87655cb975369100234ac0213b5d4c8454a45af..2cfbf6c8d1009d71bffb4de9e755efe2b3f4330a 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan  4 10:05:05 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  * 
  */
 
@@ -53,5 +54,7 @@ extern int  gamma_irq_install(drm_device_t *dev, int irq);
 extern int  gamma_irq_uninstall(drm_device_t *dev);
 extern int  gamma_control(struct inode *inode, struct file *filp,
                          unsigned int cmd, unsigned long arg);
+extern int  gamma_find_devices(void);
+extern int  gamma_found(void);
 
 #endif
diff --git a/drivers/char/drm/i810_bufs.c b/drivers/char/drm/i810_bufs.c
new file mode 100644 (file)
index 0000000..fa1f84d
--- /dev/null
@@ -0,0 +1,334 @@
+/* i810_bufs.c -- IOCTLs to manage buffers -*- linux-c -*-
+ * Created: Thu Jan 6 01:47:26 2000 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ * 
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "i810_drv.h"
+#include "linux/un.h"
+
+int i810_addbufs_agp(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_device_dma_t *dma = dev->dma;
+       drm_buf_desc_t request;
+       drm_buf_entry_t *entry;
+       drm_buf_t *buf;
+       unsigned long offset;
+       unsigned long agp_offset;
+       int count;
+       int order;
+       int size;
+       int alignment;
+       int page_order;
+       int total;
+       int byte_count;
+       int i;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       count = request.count;
+       order = drm_order(request.size);
+       size    = 1 << order;
+       agp_offset = request.agp_start;
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size) :size;
+       page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
+       total = PAGE_SIZE << page_order;
+       byte_count = 0;
+   
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       if (dev->queue_count) return -EBUSY; /* Not while in use */
+       spin_lock(&dev->count_lock);
+       if (dev->buf_use) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       atomic_inc(&dev->buf_alloc);
+       spin_unlock(&dev->count_lock);
+   
+       down(&dev->struct_sem);
+       entry = &dma->bufs[order];
+       if (entry->buf_count) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM; /* May only call once for each order */
+       }
+   
+       entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+                                  DRM_MEM_BUFS);
+       if (!entry->buflist) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM;
+       }
+       memset(entry->buflist, 0, count * sizeof(*entry->buflist));
+   
+       entry->buf_size   = size;
+       entry->page_order = page_order;
+       offset = 0;
+   
+       while(entry->buf_count < count) {
+               buf = &entry->buflist[entry->buf_count];
+               buf->idx = dma->buf_count + entry->buf_count;
+               buf->total = alignment;
+               buf->order = order;
+               buf->used = 0;
+               buf->offset = offset;
+               buf->bus_address = dev->agp->base + agp_offset + offset;
+               buf->address = (void *)(agp_offset + offset + dev->agp->base);
+               buf->next = NULL;
+               buf->waiting = 0;
+               buf->pending = 0;
+               init_waitqueue_head(&buf->dma_wait);
+               buf->pid = 0;
+
+               buf->dev_private = drm_alloc(sizeof(drm_i810_buf_priv_t), 
+                                            DRM_MEM_BUFS);
+               buf->dev_priv_size = sizeof(drm_i810_buf_priv_t);
+               memset(buf->dev_private, 0, sizeof(drm_i810_buf_priv_t));
+
+#if DRM_DMA_HISTOGRAM
+               buf->time_queued = 0;
+               buf->time_dispatched = 0;
+               buf->time_completed = 0;
+               buf->time_freed = 0;
+#endif
+               offset = offset + alignment;
+               entry->buf_count++;
+               byte_count += PAGE_SIZE << page_order;
+      
+               DRM_DEBUG("buffer %d @ %p\n",
+                         entry->buf_count, buf->address);
+       }
+   
+       dma->buflist = drm_realloc(dma->buflist,
+                                  dma->buf_count * sizeof(*dma->buflist),
+                                  (dma->buf_count + entry->buf_count)
+                                  * sizeof(*dma->buflist),
+                                  DRM_MEM_BUFS);
+       for (i = dma->buf_count; i < dma->buf_count + entry->buf_count; i++)
+               dma->buflist[i] = &entry->buflist[i - dma->buf_count];
+   
+       dma->buf_count  += entry->buf_count;
+       dma->byte_count += byte_count;
+       drm_freelist_create(&entry->freelist, entry->buf_count);
+       for (i = 0; i < entry->buf_count; i++) {
+               drm_freelist_put(dev, &entry->freelist, &entry->buflist[i]);
+       }
+   
+       up(&dev->struct_sem);
+   
+       request.count = entry->buf_count;
+       request.size  = size;
+   
+       copy_to_user_ret((drm_buf_desc_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+   
+       atomic_dec(&dev->buf_alloc);
+       dma->flags = _DRM_DMA_USE_AGP;
+       return 0;
+}
+
+int i810_addbufs(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       drm_buf_desc_t   request;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       if(request.flags & _DRM_AGP_BUFFER)
+               return i810_addbufs_agp(inode, filp, cmd, arg);
+       else
+               return -EINVAL;
+}
+
+int i810_infobufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_info_t   request;
+       int              i;
+       int              count;
+
+       if (!dma) return -EINVAL;
+
+       spin_lock(&dev->count_lock);
+       if (atomic_read(&dev->buf_alloc)) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       ++dev->buf_use;         /* Can't allocate more after this call */
+       spin_unlock(&dev->count_lock);
+
+       copy_from_user_ret(&request,
+                          (drm_buf_info_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       for (i = 0, count = 0; i < DRM_MAX_ORDER+1; i++) {
+               if (dma->bufs[i].buf_count) ++count;
+       }
+       
+       DRM_DEBUG("count = %d\n", count);
+       
+       if (request.count >= count) {
+               for (i = 0, count = 0; i < DRM_MAX_ORDER+1; i++) {
+                       if (dma->bufs[i].buf_count) {
+                               copy_to_user_ret(&request.list[count].count,
+                                                &dma->bufs[i].buf_count,
+                                                sizeof(dma->bufs[0]
+                                                       .buf_count),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count].size,
+                                                &dma->bufs[i].buf_size,
+                                                sizeof(dma->bufs[0].buf_size),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count].low_mark,
+                                                &dma->bufs[i]
+                                                .freelist.low_mark,
+                                                sizeof(dma->bufs[0]
+                                                       .freelist.low_mark),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count]
+                                                .high_mark,
+                                                &dma->bufs[i]
+                                                .freelist.high_mark,
+                                                sizeof(dma->bufs[0]
+                                                       .freelist.high_mark),
+                                                -EFAULT);
+                               DRM_DEBUG("%d %d %d %d %d\n",
+                                         i,
+                                         dma->bufs[i].buf_count,
+                                         dma->bufs[i].buf_size,
+                                         dma->bufs[i].freelist.low_mark,
+                                         dma->bufs[i].freelist.high_mark);
+                               ++count;
+                       }
+               }
+       }
+       request.count = count;
+
+       copy_to_user_ret((drm_buf_info_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+       
+       return 0;
+}
+
+int i810_markbufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_desc_t   request;
+       int              order;
+       drm_buf_entry_t  *entry;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       DRM_DEBUG("%d, %d, %d\n",
+                 request.size, request.low_mark, request.high_mark);
+       order = drm_order(request.size);
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       entry = &dma->bufs[order];
+
+       if (request.low_mark < 0 || request.low_mark > entry->buf_count)
+               return -EINVAL;
+       if (request.high_mark < 0 || request.high_mark > entry->buf_count)
+               return -EINVAL;
+
+       entry->freelist.low_mark  = request.low_mark;
+       entry->freelist.high_mark = request.high_mark;
+       
+       return 0;
+}
+
+int i810_freebufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_free_t   request;
+       int              i;
+       int              idx;
+       drm_buf_t        *buf;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_free_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       DRM_DEBUG("%d\n", request.count);
+       for (i = 0; i < request.count; i++) {
+               copy_from_user_ret(&idx,
+                                  &request.list[i],
+                                  sizeof(idx),
+                                  -EFAULT);
+               if (idx < 0 || idx >= dma->buf_count) {
+                       DRM_ERROR("Index %d (of %d max)\n",
+                                 idx, dma->buf_count - 1);
+                       return -EINVAL;
+               }
+               buf = dma->buflist[idx];
+               if (buf->pid != current->pid) {
+                       DRM_ERROR("Process %d freeing buffer owned by %d\n",
+                                 current->pid, buf->pid);
+                       return -EINVAL;
+               }
+               drm_free_buffer(dev, buf);
+       }
+       
+       return 0;
+}
+
diff --git a/drivers/char/drm/i810_context.c b/drivers/char/drm/i810_context.c
new file mode 100644 (file)
index 0000000..689814d
--- /dev/null
@@ -0,0 +1,205 @@
+/* i810_context.c -- IOCTLs for i810 contexts -*- linux-c -*-
+ * Created: Mon Dec 13 09:51:35 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#include <linux/sched.h>
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "i810_drv.h"
+
+static int i810_alloc_queue(drm_device_t *dev)
+{
+       int temp = drm_ctxbitmap_next(dev);
+       DRM_DEBUG("i810_alloc_queue: %d\n", temp);
+       return temp;
+}
+
+int i810_context_switch(drm_device_t *dev, int old, int new)
+{
+        char        buf[64];
+
+        atomic_inc(&dev->total_ctx);
+
+        if (test_and_set_bit(0, &dev->context_flag)) {
+                DRM_ERROR("Reentering -- FIXME\n");
+                return -EBUSY;
+        }
+
+#if DRM_DMA_HISTOGRAM
+        dev->ctx_start = get_cycles();
+#endif
+        
+        DRM_DEBUG("Context switch from %d to %d\n", old, new);
+
+        if (new == dev->last_context) {
+                clear_bit(0, &dev->context_flag);
+                return 0;
+        }
+        
+        if (drm_flags & DRM_FLAG_NOCTX) {
+                i810_context_switch_complete(dev, new);
+        } else {
+                sprintf(buf, "C %d %d\n", old, new);
+                drm_write_string(dev, buf);
+        }
+        
+        return 0;
+}
+
+int i810_context_switch_complete(drm_device_t *dev, int new)
+{
+        dev->last_context = new;  /* PRE/POST: This is the _only_ writer. */
+        dev->last_switch  = jiffies;
+        
+        if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+                DRM_ERROR("Lock isn't held after context switch\n");
+        }
+
+                               /* If a context switch is ever initiated
+                                   when the kernel holds the lock, release
+                                   that lock here. */
+#if DRM_DMA_HISTOGRAM
+        atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
+                                                      - dev->ctx_start)]);
+                   
+#endif
+        clear_bit(0, &dev->context_flag);
+        wake_up(&dev->context_wait);
+        
+        return 0;
+}
+
+int i810_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
+              unsigned long arg)
+{
+       drm_ctx_res_t   res;
+       drm_ctx_t       ctx;
+       int             i;
+
+       DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
+       copy_from_user_ret(&res, (drm_ctx_res_t *)arg, sizeof(res), -EFAULT);
+       if (res.count >= DRM_RESERVED_CONTEXTS) {
+               memset(&ctx, 0, sizeof(ctx));
+               for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
+                       ctx.handle = i;
+                       copy_to_user_ret(&res.contexts[i],
+                                        &i,
+                                        sizeof(i),
+                                        -EFAULT);
+               }
+       }
+       res.count = DRM_RESERVED_CONTEXTS;
+       copy_to_user_ret((drm_ctx_res_t *)arg, &res, sizeof(res), -EFAULT);
+       return 0;
+}
+
+int i810_addctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       if ((ctx.handle = i810_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
+                               /* Skip kernel's context and get a new one. */
+               ctx.handle = i810_alloc_queue(dev);
+       }
+        if (ctx.handle == -1) {
+               DRM_DEBUG("Not enough free contexts.\n");
+                               /* Should this return -EBUSY instead? */
+               return -ENOMEM;
+       }
+       DRM_DEBUG("%d\n", ctx.handle);
+       copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int i810_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       /* This does nothing for the i810 */
+       return 0;
+}
+
+int i810_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       drm_ctx_t ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT);
+       /* This is 0, because we don't hanlde any context flags */
+       ctx.flags = 0;
+       copy_to_user_ret((drm_ctx_t*)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int i810_switchctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       return i810_context_switch(dev, dev->last_context, ctx.handle);
+}
+
+int i810_newctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       i810_context_switch_complete(dev, ctx.handle);
+
+       return 0;
+}
+
+int i810_rmctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       if(ctx.handle != DRM_KERNEL_CONTEXT) {
+               drm_ctxbitmap_free(dev, ctx.handle);
+       }
+       
+       return 0;
+}
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
new file mode 100644 (file)
index 0000000..901be55
--- /dev/null
@@ -0,0 +1,1411 @@
+/* i810_dma.c -- DMA support for the i810 -*- linux-c -*-
+ * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *          Keith Whitwell <keithw@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "i810_drv.h"
+
+#include <linux/interrupt.h>   /* For task queue support */
+
+/* in case we don't have a 2.3.99-pre6 kernel or later: */
+#ifndef VM_DONTCOPY
+#define VM_DONTCOPY 0
+#endif
+
+#define I810_BUF_FREE          2
+#define I810_BUF_CLIENT                1
+#define I810_BUF_HARDWARE              0
+
+#define I810_BUF_UNMAPPED 0
+#define I810_BUF_MAPPED   1
+
+#define I810_REG(reg)          2
+#define I810_BASE(reg)         ((unsigned long) \
+                               dev->maplist[I810_REG(reg)]->handle)
+#define I810_ADDR(reg)         (I810_BASE(reg) + reg)
+#define I810_DEREF(reg)                *(__volatile__ int *)I810_ADDR(reg)
+#define I810_READ(reg)         I810_DEREF(reg)
+#define I810_WRITE(reg,val)    do { I810_DEREF(reg) = val; } while (0)
+#define I810_DEREF16(reg)      *(__volatile__ u16 *)I810_ADDR(reg)
+#define I810_READ16(reg)       I810_DEREF16(reg)
+#define I810_WRITE16(reg,val)  do { I810_DEREF16(reg) = val; } while (0)
+
+#define RING_LOCALS    unsigned int outring, ringmask; volatile char *virt;
+
+#define BEGIN_LP_RING(n) do {                          \
+       if (I810_VERBOSE)                               \
+               DRM_DEBUG("BEGIN_LP_RING(%d) in %s\n",  \
+                         n, __FUNCTION__);             \
+       if (dev_priv->ring.space < n*4)                 \
+               i810_wait_ring(dev, n*4);               \
+       dev_priv->ring.space -= n*4;                    \
+       outring = dev_priv->ring.tail;                  \
+       ringmask = dev_priv->ring.tail_mask;            \
+       virt = dev_priv->ring.virtual_start;            \
+} while (0)
+
+#define ADVANCE_LP_RING() do {                                 \
+       if (I810_VERBOSE) DRM_DEBUG("ADVANCE_LP_RING\n");       \
+       dev_priv->ring.tail = outring;                          \
+       I810_WRITE(LP_RING + RING_TAIL, outring);               \
+} while(0)
+
+#define OUT_RING(n) do {                                               \
+       if (I810_VERBOSE) DRM_DEBUG("   OUT_RING %x\n", (int)(n));      \
+       *(volatile unsigned int *)(virt + outring) = n;                 \
+       outring += 4;                                                   \
+       outring &= ringmask;                                            \
+} while (0);
+
+static inline void i810_print_status_page(drm_device_t *dev)
+{
+       drm_device_dma_t *dma = dev->dma;
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       u32 *temp = (u32 *)dev_priv->hw_status_page;
+       int i;
+
+       DRM_DEBUG(  "hw_status: Interrupt Status : %x\n", temp[0]);
+       DRM_DEBUG(  "hw_status: LpRing Head ptr : %x\n", temp[1]);
+       DRM_DEBUG(  "hw_status: IRing Head ptr : %x\n", temp[2]);
+       DRM_DEBUG(  "hw_status: Reserved : %x\n", temp[3]);
+       DRM_DEBUG(  "hw_status: Driver Counter : %d\n", temp[5]);
+       for(i = 6; i < dma->buf_count + 6; i++) {
+               DRM_DEBUG( "buffer status idx : %d used: %d\n", i - 6, temp[i]);
+       }
+}
+
+static drm_buf_t *i810_freelist_get(drm_device_t *dev)
+{
+       drm_device_dma_t *dma = dev->dma;
+       int              i;
+       int              used;
+   
+       /* Linear search might not be the best solution */
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t *buf = dma->buflist[ i ];
+               drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+               /* In use is already a pointer */
+               used = cmpxchg(buf_priv->in_use, I810_BUF_FREE, 
+                              I810_BUF_CLIENT);
+               if(used == I810_BUF_FREE) {
+                       return buf;
+               }
+       }
+       return NULL;
+}
+
+/* This should only be called if the buffer is not sent to the hardware
+ * yet, the hardware updates in use for us once its on the ring buffer.
+ */
+
+static int i810_freelist_put(drm_device_t *dev, drm_buf_t *buf)
+{
+       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+       int used;
+   
+       /* In use is already a pointer */
+       used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, I810_BUF_FREE);
+       if(used != I810_BUF_CLIENT) {
+               DRM_ERROR("Freeing buffer thats not in use : %d\n", buf->idx);
+               return -EINVAL;
+       }
+   
+       return 0;
+}
+
+static struct file_operations i810_buffer_fops = {
+       open:    i810_open,
+       flush:   drm_flush,
+       release: i810_release,
+       ioctl:   i810_ioctl,
+       mmap:    i810_mmap_buffers,
+       read:    drm_read,
+       fasync:  drm_fasync,
+       poll:    drm_poll,
+};
+
+int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
+{
+       drm_file_t        *priv   = filp->private_data;
+       drm_device_t      *dev    = priv->dev;
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_buf_t *buf = dev_priv->mmap_buffer;
+       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+   
+       vma->vm_flags |= (VM_IO | VM_DONTCOPY);
+       vma->vm_file = filp;
+   
+       buf_priv->currently_mapped = I810_BUF_MAPPED;
+
+       if (remap_page_range(vma->vm_start,
+                            VM_OFFSET(vma),
+                            vma->vm_end - vma->vm_start,
+                            vma->vm_page_prot)) return -EAGAIN;
+       return 0;
+}
+
+static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
+{
+       drm_file_t        *priv   = filp->private_data;
+       drm_device_t      *dev    = priv->dev;
+       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       struct file_operations *old_fops;
+       int retcode = 0;
+
+       if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL;
+
+       if(VM_DONTCOPY != 0) {
+               down(&current->mm->mmap_sem);
+               old_fops = filp->f_op;
+               filp->f_op = &i810_buffer_fops;
+               dev_priv->mmap_buffer = buf;
+               buf_priv->virtual = (void *)do_mmap(filp, 0, buf->total, 
+                                                   PROT_READ|PROT_WRITE,
+                                                   MAP_SHARED, 
+                                                   buf->bus_address);
+               dev_priv->mmap_buffer = NULL;
+               filp->f_op = old_fops;
+               if ((unsigned long)buf_priv->virtual > -1024UL) {
+                       /* Real error */
+                       DRM_DEBUG("mmap error\n");
+                       retcode = (signed int)buf_priv->virtual;
+                       buf_priv->virtual = 0;
+               }
+               up(&current->mm->mmap_sem);
+       } else {
+               buf_priv->virtual = buf_priv->kernel_virtual;
+               buf_priv->currently_mapped = I810_BUF_MAPPED;
+       }
+       return retcode;
+}
+
+static int i810_unmap_buffer(drm_buf_t *buf)
+{
+       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+       int retcode = 0;
+
+       if(VM_DONTCOPY != 0) {
+               if(buf_priv->currently_mapped != I810_BUF_MAPPED) 
+                       return -EINVAL;
+               down(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE < 0x020399
+               retcode = do_munmap((unsigned long)buf_priv->virtual, 
+                                   (size_t) buf->total);
+#else
+               retcode = do_munmap(current->mm, 
+                                   (unsigned long)buf_priv->virtual, 
+                                   (size_t) buf->total);
+#endif
+               up(&current->mm->mmap_sem);
+       }
+       buf_priv->currently_mapped = I810_BUF_UNMAPPED;
+       buf_priv->virtual = 0;
+
+       return retcode;
+}
+
+static int i810_dma_get_buffer(drm_device_t *dev, drm_i810_dma_t *d, 
+                              struct file *filp)
+{
+       drm_file_t        *priv   = filp->private_data;
+       drm_buf_t         *buf;
+       drm_i810_buf_priv_t *buf_priv;
+       int retcode = 0;
+
+       buf = i810_freelist_get(dev);
+       if (!buf) {
+               retcode = -ENOMEM;
+               DRM_DEBUG("%s retcode %d\n", __FUNCTION__, retcode);
+               goto out_get_buf;
+       }
+   
+       retcode = i810_map_buffer(buf, filp);
+       if(retcode) {
+               i810_freelist_put(dev, buf);
+               DRM_DEBUG("mapbuf failed in %s retcode %d\n", 
+                         __FUNCTION__, retcode);
+               goto out_get_buf;
+       }
+       buf->pid     = priv->pid;
+       buf_priv = buf->dev_private;    
+       d->granted = 1;
+       d->request_idx = buf->idx;
+       d->request_size = buf->total;
+       d->virtual = buf_priv->virtual;
+
+out_get_buf:
+       return retcode;
+}
+
+static unsigned long i810_alloc_page(drm_device_t *dev)
+{
+       unsigned long address;
+   
+       address = __get_free_page(GFP_KERNEL);
+       if(address == 0UL) 
+               return 0;
+       
+       atomic_inc(&mem_map[MAP_NR((void *) address)].count);
+       set_bit(PG_locked, &mem_map[MAP_NR((void *) address)].flags);
+   
+       return address;
+}
+
+static void i810_free_page(drm_device_t *dev, unsigned long page)
+{
+       if(page == 0UL) 
+               return;
+       
+       atomic_dec(&mem_map[MAP_NR((void *) page)].count);
+       clear_bit(PG_locked, &mem_map[MAP_NR((void *) page)].flags);
+       wake_up(&mem_map[MAP_NR((void *) page)].wait);
+       free_page(page);
+       return;
+}
+
+static int i810_dma_cleanup(drm_device_t *dev)
+{
+       drm_device_dma_t *dma = dev->dma;
+
+       if(dev->dev_private) {
+               int i;
+               drm_i810_private_t *dev_priv = 
+                       (drm_i810_private_t *) dev->dev_private;
+          
+               if(dev_priv->ring.virtual_start) {
+                       drm_ioremapfree((void *) dev_priv->ring.virtual_start,
+                                       dev_priv->ring.Size);
+               }
+               if(dev_priv->hw_status_page != 0UL) {
+                       i810_free_page(dev, dev_priv->hw_status_page);
+                       /* Need to rewrite hardware status page */
+                       I810_WRITE(0x02080, 0x1ffff000);
+               }
+               drm_free(dev->dev_private, sizeof(drm_i810_private_t), 
+                        DRM_MEM_DRIVER);
+               dev->dev_private = NULL;
+
+               for (i = 0; i < dma->buf_count; i++) {
+                       drm_buf_t *buf = dma->buflist[ i ];
+                       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+                       drm_ioremapfree(buf_priv->kernel_virtual, buf->total);
+               }
+       }
+       return 0;
+}
+
+static int i810_wait_ring(drm_device_t *dev, int n)
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
+       int iters = 0;
+       unsigned long end;
+       unsigned int last_head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
+
+       end = jiffies + (HZ*3);
+       while (ring->space < n) {
+               int i;
+       
+               ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
+               ring->space = ring->head - (ring->tail+8);
+               if (ring->space < 0) ring->space += ring->Size;
+          
+               if (ring->head != last_head)
+                  end = jiffies + (HZ*3);
+         
+               iters++;
+               if((signed)(end - jiffies) <= 0) {
+                       DRM_ERROR("space: %d wanted %d\n", ring->space, n);
+                       DRM_ERROR("lockup\n");
+                       goto out_wait_ring;
+               }
+
+               for (i = 0 ; i < 2000 ; i++) ;
+       }
+
+out_wait_ring:   
+       return iters;
+}
+
+static void i810_kernel_lost_context(drm_device_t *dev)
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_ring_buffer_t *ring = &(dev_priv->ring);
+      
+       ring->head = I810_READ(LP_RING + RING_HEAD) & HEAD_ADDR;
+       ring->tail = I810_READ(LP_RING + RING_TAIL);
+       ring->space = ring->head - (ring->tail+8);
+       if (ring->space < 0) ring->space += ring->Size;
+}
+
+static int i810_freelist_init(drm_device_t *dev)
+{
+       drm_device_dma_t *dma = dev->dma;
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       int my_idx = 24;
+       u32 *hw_status = (u32 *)(dev_priv->hw_status_page + my_idx);
+       int i;
+   
+       if(dma->buf_count > 1019) {
+               /* Not enough space in the status page for the freelist */
+               return -EINVAL;
+       }
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t *buf = dma->buflist[ i ];
+               drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+          
+               buf_priv->in_use = hw_status++;
+               buf_priv->my_use_idx = my_idx;
+               my_idx += 4;
+
+               *buf_priv->in_use = I810_BUF_FREE;
+
+               buf_priv->kernel_virtual = drm_ioremap(buf->bus_address, 
+                                                      buf->total);
+       }
+       return 0;
+}
+
+static int i810_dma_initialize(drm_device_t *dev, 
+                              drm_i810_private_t *dev_priv,
+                              drm_i810_init_t *init)
+{
+       drm_map_t *sarea_map;
+
+       dev->dev_private = (void *) dev_priv;
+       memset(dev_priv, 0, sizeof(drm_i810_private_t));
+
+       if (init->ring_map_idx >= dev->map_count ||
+           init->buffer_map_idx >= dev->map_count) {
+               i810_dma_cleanup(dev);
+               DRM_ERROR("ring_map or buffer_map are invalid\n");
+               return -EINVAL;
+       }
+   
+       dev_priv->ring_map_idx = init->ring_map_idx;
+       dev_priv->buffer_map_idx = init->buffer_map_idx;
+       sarea_map = dev->maplist[0];
+       dev_priv->sarea_priv = (drm_i810_sarea_t *) 
+               ((u8 *)sarea_map->handle + 
+                init->sarea_priv_offset);
+
+       atomic_set(&dev_priv->flush_done, 0);
+       init_waitqueue_head(&dev_priv->flush_queue);
+       
+       dev_priv->ring.Start = init->ring_start;
+       dev_priv->ring.End = init->ring_end;
+       dev_priv->ring.Size = init->ring_size;
+
+       dev_priv->ring.virtual_start = drm_ioremap(dev->agp->base + 
+                                                  init->ring_start, 
+                                                  init->ring_size);
+
+       dev_priv->ring.tail_mask = dev_priv->ring.Size - 1;
+   
+       if (dev_priv->ring.virtual_start == NULL) {
+               i810_dma_cleanup(dev);
+               DRM_ERROR("can not ioremap virtual address for"
+                         " ring buffer\n");
+               return -ENOMEM;
+       }
+
+       dev_priv->w = init->w;
+       dev_priv->h = init->h;
+       dev_priv->pitch = init->pitch;
+       dev_priv->back_offset = init->back_offset;
+       dev_priv->depth_offset = init->depth_offset;
+
+       dev_priv->front_di1 = init->front_offset | init->pitch_bits;
+       dev_priv->back_di1 = init->back_offset | init->pitch_bits;
+       dev_priv->zi1 = init->depth_offset | init->pitch_bits;
+       
+   
+       /* Program Hardware Status Page */
+       dev_priv->hw_status_page = i810_alloc_page(dev);
+       memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE);
+       if(dev_priv->hw_status_page == 0UL) {
+               i810_dma_cleanup(dev);
+               DRM_ERROR("Can not allocate hardware status page\n");
+               return -ENOMEM;
+       }
+       DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
+   
+       I810_WRITE(0x02080, virt_to_bus((void *)dev_priv->hw_status_page));
+       DRM_DEBUG("Enabled hardware status page\n");
+   
+       /* Now we need to init our freelist */
+       if(i810_freelist_init(dev) != 0) {
+               i810_dma_cleanup(dev);
+               DRM_ERROR("Not enough space in the status page for"
+                         " the freelist\n");
+               return -ENOMEM;
+       }
+       return 0;
+}
+
+int i810_dma_init(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_i810_private_t *dev_priv;
+       drm_i810_init_t init;
+       int retcode = 0;
+       
+       copy_from_user_ret(&init, (drm_i810_init_t *)arg, 
+                          sizeof(init), -EFAULT);
+       
+       switch(init.func) {
+               case I810_INIT_DMA:
+                       dev_priv = drm_alloc(sizeof(drm_i810_private_t), 
+                                            DRM_MEM_DRIVER);
+                       if(dev_priv == NULL) return -ENOMEM;
+                       retcode = i810_dma_initialize(dev, dev_priv, &init);
+               break;
+               case I810_CLEANUP_DMA:
+                       retcode = i810_dma_cleanup(dev);
+               break;
+               default:
+                       retcode = -EINVAL;
+               break;
+       }
+   
+       return retcode;
+}
+
+
+
+/* Most efficient way to verify state for the i810 is as it is
+ * emitted.  Non-conformant state is silently dropped.
+ *
+ * Use 'volatile' & local var tmp to force the emitted values to be
+ * identical to the verified ones.
+ */
+static void i810EmitContextVerified( drm_device_t *dev, 
+                                    volatile unsigned int *code ) 
+{      
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       int i, j = 0;
+       unsigned int tmp;
+       RING_LOCALS;
+
+       BEGIN_LP_RING( I810_CTX_SETUP_SIZE );
+
+       OUT_RING( GFX_OP_COLOR_FACTOR );
+       OUT_RING( code[I810_CTXREG_CF1] );
+
+       OUT_RING( GFX_OP_STIPPLE );
+       OUT_RING( code[I810_CTXREG_ST1] );
+
+       for ( i = 4 ; i < I810_CTX_SETUP_SIZE ; i++ ) {
+               tmp = code[i];
+
+               if ((tmp & (7<<29)) == (3<<29) &&
+                   (tmp & (0x1f<<24)) < (0x1d<<24)) 
+               {
+                       OUT_RING( tmp ); 
+                       j++;
+               } 
+       }
+
+       if (j & 1) 
+               OUT_RING( 0 ); 
+
+       ADVANCE_LP_RING();
+}
+
+static void i810EmitTexVerified( drm_device_t *dev, 
+                                volatile unsigned int *code ) 
+{      
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       int i, j = 0;
+       unsigned int tmp;
+       RING_LOCALS;
+
+       BEGIN_LP_RING( I810_TEX_SETUP_SIZE );
+
+       OUT_RING( GFX_OP_MAP_INFO );
+       OUT_RING( code[I810_TEXREG_MI1] );
+       OUT_RING( code[I810_TEXREG_MI2] );
+       OUT_RING( code[I810_TEXREG_MI3] );
+
+       for ( i = 4 ; i < I810_TEX_SETUP_SIZE ; i++ ) {
+               tmp = code[i];
+
+               if ((tmp & (7<<29)) == (3<<29) &&
+                   (tmp & (0x1f<<24)) < (0x1d<<24)) 
+               {
+                       OUT_RING( tmp ); 
+                       j++;
+               }
+       } 
+               
+       if (j & 1) 
+               OUT_RING( 0 ); 
+
+       ADVANCE_LP_RING();
+}
+
+
+/* Need to do some additional checking when setting the dest buffer.
+ */
+static void i810EmitDestVerified( drm_device_t *dev, 
+                                 volatile unsigned int *code ) 
+{      
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       unsigned int tmp;
+       RING_LOCALS;
+
+       BEGIN_LP_RING( I810_DEST_SETUP_SIZE + 2 );
+
+       tmp = code[I810_DESTREG_DI1];
+       if (tmp == dev_priv->front_di1 || tmp == dev_priv->back_di1) {
+               OUT_RING( CMD_OP_DESTBUFFER_INFO );
+               OUT_RING( tmp );
+       } else
+          DRM_DEBUG("bad di1 %x (allow %x or %x)\n",
+                    tmp, dev_priv->front_di1, dev_priv->back_di1);
+
+       /* invarient:
+        */
+       OUT_RING( CMD_OP_Z_BUFFER_INFO );
+       OUT_RING( dev_priv->zi1 );
+
+       OUT_RING( GFX_OP_DESTBUFFER_VARS );
+       OUT_RING( code[I810_DESTREG_DV1] );
+
+       OUT_RING( GFX_OP_DRAWRECT_INFO );
+       OUT_RING( code[I810_DESTREG_DR1] );
+       OUT_RING( code[I810_DESTREG_DR2] );
+       OUT_RING( code[I810_DESTREG_DR3] );
+       OUT_RING( code[I810_DESTREG_DR4] );
+       OUT_RING( 0 );
+
+       ADVANCE_LP_RING();
+}
+
+
+
+static void i810EmitState( drm_device_t *dev )
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int dirty = sarea_priv->dirty;
+
+       if (dirty & I810_UPLOAD_BUFFERS) {
+               i810EmitDestVerified( dev, sarea_priv->BufferState );
+               sarea_priv->dirty &= ~I810_UPLOAD_BUFFERS;
+       }
+
+       if (dirty & I810_UPLOAD_CTX) {
+               i810EmitContextVerified( dev, sarea_priv->ContextState );
+               sarea_priv->dirty &= ~I810_UPLOAD_CTX;
+       }
+
+       if (dirty & I810_UPLOAD_TEX0) {
+               i810EmitTexVerified( dev, sarea_priv->TexState[0] );
+               sarea_priv->dirty &= ~I810_UPLOAD_TEX0;
+       }
+
+       if (dirty & I810_UPLOAD_TEX1) {
+               i810EmitTexVerified( dev, sarea_priv->TexState[1] );
+               sarea_priv->dirty &= ~I810_UPLOAD_TEX1;
+       }
+}
+
+
+
+/* need to verify 
+ */
+static void i810_dma_dispatch_clear( drm_device_t *dev, int flags, 
+                                    unsigned int clear_color,
+                                    unsigned int clear_zval )
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       int nbox = sarea_priv->nbox;
+       drm_clip_rect_t *pbox = sarea_priv->boxes;
+       int pitch = dev_priv->pitch;
+       int cpp = 2;
+       int i;
+       RING_LOCALS;
+
+       i810_kernel_lost_context(dev);
+
+       if (nbox > I810_NR_SAREA_CLIPRECTS)
+               nbox = I810_NR_SAREA_CLIPRECTS;
+
+       for (i = 0 ; i < nbox ; i++, pbox++) {
+               unsigned int x = pbox->x1;
+               unsigned int y = pbox->y1;
+               unsigned int width = (pbox->x2 - x) * cpp;
+               unsigned int height = pbox->y2 - y;
+               unsigned int start = y * pitch + x * cpp;
+
+               if (pbox->x1 > pbox->x2 ||
+                   pbox->y1 > pbox->y2 ||
+                   pbox->x2 > dev_priv->w ||
+                   pbox->y2 > dev_priv->h)
+                       continue;
+
+               if ( flags & I810_FRONT ) {         
+                       DRM_DEBUG("clear front\n");
+                       BEGIN_LP_RING( 6 );         
+                       OUT_RING( BR00_BITBLT_CLIENT | 
+                                 BR00_OP_COLOR_BLT | 0x3 );
+                       OUT_RING( BR13_SOLID_PATTERN | (0xF0 << 16) | pitch );
+                       OUT_RING( (height << 16) | width );
+                       OUT_RING( start );
+                       OUT_RING( clear_color );
+                       OUT_RING( 0 );
+                       ADVANCE_LP_RING();
+               }
+
+               if ( flags & I810_BACK ) {
+                       DRM_DEBUG("clear back\n");
+                       BEGIN_LP_RING( 6 );         
+                       OUT_RING( BR00_BITBLT_CLIENT | 
+                                 BR00_OP_COLOR_BLT | 0x3 );
+                       OUT_RING( BR13_SOLID_PATTERN | (0xF0 << 16) | pitch );
+                       OUT_RING( (height << 16) | width );
+                       OUT_RING( dev_priv->back_offset + start );
+                       OUT_RING( clear_color );
+                       OUT_RING( 0 );
+                       ADVANCE_LP_RING();
+               }
+
+               if ( flags & I810_DEPTH ) {
+                       DRM_DEBUG("clear depth\n");
+                       BEGIN_LP_RING( 6 );         
+                       OUT_RING( BR00_BITBLT_CLIENT | 
+                                 BR00_OP_COLOR_BLT | 0x3 );
+                       OUT_RING( BR13_SOLID_PATTERN | (0xF0 << 16) | pitch );
+                       OUT_RING( (height << 16) | width );
+                       OUT_RING( dev_priv->depth_offset + start );
+                       OUT_RING( clear_zval );
+                       OUT_RING( 0 );
+                       ADVANCE_LP_RING();
+               }
+       }
+}
+
+static void i810_dma_dispatch_swap( drm_device_t *dev )
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       int nbox = sarea_priv->nbox;
+       drm_clip_rect_t *pbox = sarea_priv->boxes;
+       int pitch = dev_priv->pitch;
+       int cpp = 2;
+       int ofs = dev_priv->back_offset;
+       int i;
+       RING_LOCALS;
+
+       DRM_DEBUG("swapbuffers\n");
+
+       i810_kernel_lost_context(dev);
+
+       if (nbox > I810_NR_SAREA_CLIPRECTS)
+               nbox = I810_NR_SAREA_CLIPRECTS;
+
+       for (i = 0 ; i < nbox; i++, pbox++) 
+       {
+               unsigned int w = pbox->x2 - pbox->x1;
+               unsigned int h = pbox->y2 - pbox->y1;
+               unsigned int dst = pbox->x1*cpp + pbox->y1*pitch;
+               unsigned int start = ofs + dst;
+
+               if (pbox->x1 > pbox->x2 ||
+                   pbox->y1 > pbox->y2 ||
+                   pbox->x2 > dev_priv->w ||
+                   pbox->y2 > dev_priv->h)
+                       continue;
+               DRM_DEBUG("dispatch swap %d,%d-%d,%d!\n",
+                         pbox[i].x1, pbox[i].y1,
+                         pbox[i].x2, pbox[i].y2);
+
+               BEGIN_LP_RING( 6 );
+               OUT_RING( BR00_BITBLT_CLIENT | BR00_OP_SRC_COPY_BLT | 0x4 );
+               OUT_RING( pitch | (0xCC << 16));
+               OUT_RING( (h << 16) | (w * cpp));
+               OUT_RING( dst );
+               OUT_RING( pitch );      
+               OUT_RING( start );
+               ADVANCE_LP_RING();
+       }
+}
+
+
+static void i810_dma_dispatch_vertex(drm_device_t *dev, 
+                                    drm_buf_t *buf,
+                                    int discard,
+                                    int used)
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+       drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       drm_clip_rect_t *box = sarea_priv->boxes;
+       int nbox = sarea_priv->nbox;
+       unsigned long address = (unsigned long)buf->bus_address;
+       unsigned long start = address - dev->agp->base;     
+       int i = 0, u;
+       RING_LOCALS;
+
+       i810_kernel_lost_context(dev);
+
+       if (nbox > I810_NR_SAREA_CLIPRECTS) 
+               nbox = I810_NR_SAREA_CLIPRECTS;
+
+       if (discard) {
+               u = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, 
+                           I810_BUF_HARDWARE);
+               if(u != I810_BUF_CLIENT) {
+                       DRM_DEBUG("xxxx 2\n");
+               }
+       }
+
+       if (used > 4*1024) 
+               used = 0;
+
+       if (sarea_priv->dirty)
+          i810EmitState( dev );
+
+       DRM_DEBUG("dispatch vertex addr 0x%lx, used 0x%x nbox %d\n", 
+                 address, used, nbox);
+
+       dev_priv->counter++;
+       DRM_DEBUG(  "dispatch counter : %ld\n", dev_priv->counter);
+       DRM_DEBUG(  "i810_dma_dispatch\n");
+       DRM_DEBUG(  "start : %lx\n", start);
+       DRM_DEBUG(  "used : %d\n", used);
+       DRM_DEBUG(  "start + used - 4 : %ld\n", start + used - 4);
+
+       if (buf_priv->currently_mapped == I810_BUF_MAPPED) {
+               *(u32 *)buf_priv->virtual = (GFX_OP_PRIMITIVE |
+                                            sarea_priv->vertex_prim |
+                                            ((used/4)-2));
+               
+               if (used & 4) {
+                       *(u32 *)((u32)buf_priv->virtual + used) = 0;
+                       used += 4;
+               }
+
+               i810_unmap_buffer(buf);
+       }
+                  
+       if (used) {
+               do {
+                       if (i < nbox) {
+                               BEGIN_LP_RING(4);
+                               OUT_RING( GFX_OP_SCISSOR | SC_UPDATE_SCISSOR | 
+                                         SC_ENABLE );
+                               OUT_RING( GFX_OP_SCISSOR_INFO );
+                               OUT_RING( box[i].x1 | (box[i].y1<<16) );
+                               OUT_RING( (box[i].x2-1) | ((box[i].y2-1)<<16) );
+                               ADVANCE_LP_RING();
+                       }
+                       
+                       BEGIN_LP_RING(4);
+                       OUT_RING( CMD_OP_BATCH_BUFFER );
+                       OUT_RING( start | BB1_PROTECTED );
+                       OUT_RING( start + used - 4 );
+                       OUT_RING( 0 );
+                       ADVANCE_LP_RING();
+                       
+               } while (++i < nbox);
+       }
+
+       BEGIN_LP_RING(10);
+       OUT_RING( CMD_STORE_DWORD_IDX );
+       OUT_RING( 20 );
+       OUT_RING( dev_priv->counter );
+       OUT_RING( 0 );
+
+       if (discard) {
+               OUT_RING( CMD_STORE_DWORD_IDX );
+               OUT_RING( buf_priv->my_use_idx );
+               OUT_RING( I810_BUF_FREE );
+               OUT_RING( 0 );
+       }
+
+       OUT_RING( CMD_REPORT_HEAD );
+       OUT_RING( 0 );
+       ADVANCE_LP_RING();
+}
+
+
+/* Interrupts are only for flushing */
+static void i810_dma_service(int irq, void *device, struct pt_regs *regs)
+{
+       drm_device_t     *dev = (drm_device_t *)device;
+       u16 temp;
+   
+       atomic_inc(&dev->total_irq);
+       temp = I810_READ16(I810REG_INT_IDENTITY_R);
+       temp = temp & ~(0x6000);
+       if(temp != 0) I810_WRITE16(I810REG_INT_IDENTITY_R, 
+                                  temp); /* Clear all interrupts */
+       else
+          return;
+       queue_task(&dev->tq, &tq_immediate);
+       mark_bh(IMMEDIATE_BH);
+}
+
+static void i810_dma_task_queue(void *device)
+{
+       drm_device_t *dev = (drm_device_t *) device;
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+
+       atomic_set(&dev_priv->flush_done, 1);
+       wake_up_interruptible(&dev_priv->flush_queue);
+}
+
+int i810_irq_install(drm_device_t *dev, int irq)
+{
+       int retcode;
+       u16 temp;
+   
+       if (!irq)     return -EINVAL;
+       
+       down(&dev->struct_sem);
+       if (dev->irq) {
+               up(&dev->struct_sem);
+               return -EBUSY;
+       }
+       dev->irq = irq;
+       up(&dev->struct_sem);
+       
+       DRM_DEBUG(  "Interrupt Install : %d\n", irq);
+       DRM_DEBUG("%d\n", 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;
+
+       dev->tq.next          = NULL;
+       dev->tq.sync          = 0;
+       dev->tq.routine       = i810_dma_task_queue;
+       dev->tq.data          = dev;
+
+                               /* Before installing handler */
+       temp = I810_READ16(I810REG_HWSTAM);
+       temp = temp & 0x6000;
+       I810_WRITE16(I810REG_HWSTAM, temp);
+       
+       temp = I810_READ16(I810REG_INT_MASK_R);
+       temp = temp & 0x6000;
+       I810_WRITE16(I810REG_INT_MASK_R, temp); /* Unmask interrupts */
+       temp = I810_READ16(I810REG_INT_ENABLE_R);
+       temp = temp & 0x6000;
+       I810_WRITE16(I810REG_INT_ENABLE_R, temp); /* Disable all interrupts */
+
+                               /* Install handler */
+       if ((retcode = request_irq(dev->irq,
+                                  i810_dma_service,
+                                  SA_SHIRQ,
+                                  dev->devname,
+                                  dev))) {
+               down(&dev->struct_sem);
+               dev->irq = 0;
+               up(&dev->struct_sem);
+               return retcode;
+       }
+       temp = I810_READ16(I810REG_INT_ENABLE_R);
+       temp = temp & 0x6000;
+       temp = temp | 0x0003;
+       I810_WRITE16(I810REG_INT_ENABLE_R, 
+                    temp); /* Enable bp & user interrupts */
+       return 0;
+}
+
+int i810_irq_uninstall(drm_device_t *dev)
+{
+       int irq;
+       u16 temp;
+
+
+/*     return 0; */
+
+       down(&dev->struct_sem);
+       irq      = dev->irq;
+       dev->irq = 0;
+       up(&dev->struct_sem);
+       
+       if (!irq) return -EINVAL;
+
+       DRM_DEBUG(  "Interrupt UnInstall: %d\n", irq);  
+       DRM_DEBUG("%d\n", irq);
+   
+       temp = I810_READ16(I810REG_INT_IDENTITY_R);
+       temp = temp & ~(0x6000);
+       if(temp != 0) I810_WRITE16(I810REG_INT_IDENTITY_R, 
+                                  temp); /* Clear all interrupts */
+   
+       temp = I810_READ16(I810REG_INT_ENABLE_R);
+       temp = temp & 0x6000;
+       I810_WRITE16(I810REG_INT_ENABLE_R, 
+                    temp);                     /* Disable all interrupts */
+
+       free_irq(irq, dev);
+
+       return 0;
+}
+
+int i810_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;
+       int             retcode;
+   
+       DRM_DEBUG(  "i810_control\n");
+
+       copy_from_user_ret(&ctl, (drm_control_t *)arg, sizeof(ctl), -EFAULT);
+       
+       switch (ctl.func) {
+       case DRM_INST_HANDLER:
+               if ((retcode = i810_irq_install(dev, ctl.irq)))
+                       return retcode;
+               break;
+       case DRM_UNINST_HANDLER:
+               if ((retcode = i810_irq_uninstall(dev)))
+                       return retcode;
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static inline void i810_dma_emit_flush(drm_device_t *dev)
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       RING_LOCALS;
+
+       i810_kernel_lost_context(dev);
+
+       BEGIN_LP_RING(2);
+       OUT_RING( CMD_REPORT_HEAD );
+       OUT_RING( GFX_OP_USER_INTERRUPT );
+       ADVANCE_LP_RING();
+
+/*     i810_wait_ring( dev, dev_priv->ring.Size - 8 ); */
+/*             atomic_set(&dev_priv->flush_done, 1); */
+/*             wake_up_interruptible(&dev_priv->flush_queue); */
+}
+
+static inline void i810_dma_quiescent_emit(drm_device_t *dev)
+{
+       drm_i810_private_t *dev_priv = dev->dev_private;
+       RING_LOCALS;
+
+       i810_kernel_lost_context(dev);
+
+       BEGIN_LP_RING(4);
+       OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE );
+       OUT_RING( CMD_REPORT_HEAD );
+       OUT_RING( 0 );
+       OUT_RING( GFX_OP_USER_INTERRUPT );
+       ADVANCE_LP_RING();
+
+/*     i810_wait_ring( dev, dev_priv->ring.Size - 8 ); */
+/*             atomic_set(&dev_priv->flush_done, 1); */
+/*             wake_up_interruptible(&dev_priv->flush_queue); */
+}
+
+static void i810_dma_quiescent(drm_device_t *dev)
+{
+       DECLARE_WAITQUEUE(entry, current);
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       unsigned long end;      
+
+       if(dev_priv == NULL) {
+               return;
+       }
+       atomic_set(&dev_priv->flush_done, 0);
+       current->state = TASK_INTERRUPTIBLE;
+       add_wait_queue(&dev_priv->flush_queue, &entry);
+       end = jiffies + (HZ*3);
+   
+       for (;;) {
+               i810_dma_quiescent_emit(dev);
+               if (atomic_read(&dev_priv->flush_done) == 1) break;
+               if((signed)(end - jiffies) <= 0) {
+                       DRM_ERROR("lockup\n");
+                       break;
+               }          
+               schedule_timeout(HZ*3);
+               if (signal_pending(current)) {
+                       break;
+               }
+       }
+   
+       current->state = TASK_RUNNING;
+       remove_wait_queue(&dev_priv->flush_queue, &entry);
+   
+       return;
+}
+
+static int i810_flush_queue(drm_device_t *dev)
+{
+       DECLARE_WAITQUEUE(entry, current);
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       drm_device_dma_t *dma = dev->dma;
+       unsigned long end;
+       int i, ret = 0;      
+
+       if(dev_priv == NULL) {
+               return 0;
+       }
+       atomic_set(&dev_priv->flush_done, 0);
+       current->state = TASK_INTERRUPTIBLE;
+       add_wait_queue(&dev_priv->flush_queue, &entry);
+       end = jiffies + (HZ*3);
+       for (;;) {
+               i810_dma_emit_flush(dev);
+               if (atomic_read(&dev_priv->flush_done) == 1) break;
+               if((signed)(end - jiffies) <= 0) {
+                       DRM_ERROR("lockup\n");
+                       break;
+               }          
+               schedule_timeout(HZ*3);
+               if (signal_pending(current)) {
+                       ret = -EINTR; /* Can't restart */
+                       break;
+               }
+       }
+   
+       current->state = TASK_RUNNING;
+       remove_wait_queue(&dev_priv->flush_queue, &entry);
+
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t *buf = dma->buflist[ i ];
+               drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+          
+               int used = cmpxchg(buf_priv->in_use, I810_BUF_HARDWARE, 
+                                  I810_BUF_FREE);
+
+               if (used == I810_BUF_HARDWARE)
+                       DRM_DEBUG("reclaimed from HARDWARE\n");
+               if (used == I810_BUF_CLIENT)
+                       DRM_DEBUG("still on client HARDWARE\n");
+       }
+
+       return ret;
+}
+
+/* Must be called with the lock held */
+void i810_reclaim_buffers(drm_device_t *dev, pid_t pid)
+{
+       drm_device_dma_t *dma = dev->dma;
+       int              i;
+
+       if (!dma) return;
+       if (!dev->dev_private) return;
+       if (!dma->buflist) return;
+
+        i810_flush_queue(dev);
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t *buf = dma->buflist[ i ];
+               drm_i810_buf_priv_t *buf_priv = buf->dev_private;
+          
+               if (buf->pid == pid && buf_priv) {
+                       int used = cmpxchg(buf_priv->in_use, I810_BUF_CLIENT, 
+                                          I810_BUF_FREE);
+
+                       if (used == I810_BUF_CLIENT)
+                               DRM_DEBUG("reclaimed from client\n");
+                       if(buf_priv->currently_mapped == I810_BUF_MAPPED)
+                               buf_priv->currently_mapped = I810_BUF_UNMAPPED;
+               }
+       }
+}
+
+int i810_lock(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;
+
+       DECLARE_WAITQUEUE(entry, current);
+       int               ret   = 0;
+       drm_lock_t        lock;
+
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+
+       if (lock.context == DRM_KERNEL_CONTEXT) {
+               DRM_ERROR("Process %d using kernel context %d\n",
+                         current->pid, lock.context);
+               return -EINVAL;
+       }
+   
+       DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
+                 lock.context, current->pid, dev->lock.hw_lock->lock,
+                 lock.flags);
+
+       if (lock.context < 0) {
+               return -EINVAL;
+       }
+       /* Only one queue:
+        */
+
+       if (!ret) {
+               add_wait_queue(&dev->lock.lock_queue, &entry);
+               for (;;) {
+                       if (!dev->lock.hw_lock) {
+                               /* Device has been unregistered */
+                               ret = -EINTR;
+                               break;
+                       }
+                       if (drm_lock_take(&dev->lock.hw_lock->lock,
+                                         lock.context)) {
+                               dev->lock.pid       = current->pid;
+                               dev->lock.lock_time = jiffies;
+                               atomic_inc(&dev->total_locks);
+                               break;  /* Got lock */
+                       }
+                       
+                               /* Contention */
+                       atomic_inc(&dev->total_sleeps);
+                       current->state = TASK_INTERRUPTIBLE;
+                       DRM_DEBUG("Calling lock schedule\n");
+                       schedule();
+                       if (signal_pending(current)) {
+                               ret = -ERESTARTSYS;
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev->lock.lock_queue, &entry);
+       }
+       
+       if (!ret) {
+               if (lock.flags & _DRM_LOCK_QUIESCENT) {
+                  DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
+                  DRM_DEBUG("fred\n");
+                  i810_dma_quiescent(dev);
+               }
+       }
+       DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
+       return ret;
+}
+
+int i810_flush_ioctl(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_DEBUG("i810_flush_ioctl\n");
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_flush_ioctl called without lock held\n");
+               return -EINVAL;
+       }
+
+       i810_flush_queue(dev);
+       return 0;
+}
+
+
+int i810_dma_vertex(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_device_dma_t *dma = dev->dma;
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+       drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) 
+                                       dev_priv->sarea_priv; 
+       drm_i810_vertex_t vertex;
+
+       copy_from_user_ret(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex),
+                          -EFAULT);
+
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_dma_vertex called without lock held\n");
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
+                 vertex.idx, vertex.used, vertex.discard);
+
+       i810_dma_dispatch_vertex( dev, 
+                                 dma->buflist[ vertex.idx ], 
+                                 vertex.discard, vertex.used );
+
+       atomic_add(vertex.used, &dma->total_bytes);
+       atomic_inc(&dma->total_dmas);
+       sarea_priv->last_enqueue = dev_priv->counter-1;
+       sarea_priv->last_dispatch = (int) hw_status[5];
+   
+       return 0;
+}
+
+
+
+int i810_clear_bufs(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_i810_clear_t clear;
+
+       copy_from_user_ret(&clear, (drm_i810_clear_t *)arg, sizeof(clear), 
+                          -EFAULT);
+   
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_clear_bufs called without lock held\n");
+               return -EINVAL;
+       }
+
+       i810_dma_dispatch_clear( dev, clear.flags, 
+                                clear.clear_color, 
+                                clear.clear_depth );
+       return 0;
+}
+
+int i810_swap_bufs(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_DEBUG("i810_swap_bufs\n");
+
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_swap_buf called without lock held\n");
+               return -EINVAL;
+       }
+
+       i810_dma_dispatch_swap( dev );
+       return 0;
+}
+
+int i810_getage(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_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+       drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) 
+                                       dev_priv->sarea_priv; 
+
+       sarea_priv->last_dispatch = (int) hw_status[5];
+       return 0;
+}
+
+int i810_getbuf(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;
+       int               retcode   = 0;
+       drm_i810_dma_t    d;
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+       drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) 
+                                       dev_priv->sarea_priv; 
+
+       DRM_DEBUG("getbuf\n");
+       copy_from_user_ret(&d, (drm_i810_dma_t *)arg, sizeof(d), -EFAULT);
+   
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_dma called without lock held\n");
+               return -EINVAL;
+       }
+       
+       d.granted = 0;
+
+       retcode = i810_dma_get_buffer(dev, &d, filp);
+
+       DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n",
+                 current->pid, retcode, d.granted);
+
+       copy_to_user_ret((drm_dma_t *)arg, &d, sizeof(d), -EFAULT);   
+       sarea_priv->last_dispatch = (int) hw_status[5];
+
+       return retcode;
+}
+
+int i810_copybuf(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_i810_copy_t   d;
+       drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
+       u32 *hw_status = (u32 *)dev_priv->hw_status_page;
+       drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) 
+                                       dev_priv->sarea_priv; 
+       drm_buf_t *buf;
+       drm_i810_buf_priv_t *buf_priv;
+       drm_device_dma_t *dma = dev->dma;
+
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("i810_dma called without lock held\n");
+               return -EINVAL;
+       }
+   
+       copy_from_user_ret(&d, (drm_i810_copy_t *)arg, sizeof(d), -EFAULT);
+
+       if(d.idx > dma->buf_count) return -EINVAL;
+       buf = dma->buflist[ d.idx ];
+       buf_priv = buf->dev_private;
+       if (buf_priv->currently_mapped != I810_BUF_MAPPED) return -EPERM;
+
+       copy_from_user_ret(buf_priv->virtual, d.address, d.used, -EFAULT);
+
+       sarea_priv->last_dispatch = (int) hw_status[5];
+
+       return 0;
+}
+
+int i810_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       if(VM_DONTCOPY == 0) return 1;
+       return 0;
+}
diff --git a/drivers/char/drm/i810_drm.h b/drivers/char/drm/i810_drm.h
new file mode 100644 (file)
index 0000000..c5f51c9
--- /dev/null
@@ -0,0 +1,194 @@
+#ifndef _I810_DRM_H_
+#define _I810_DRM_H_
+
+/* WARNING: These defines must be the same as what the Xserver uses.
+ * if you change them, you must change the defines in the Xserver.
+ */
+
+#ifndef _I810_DEFINES_
+#define _I810_DEFINES_
+
+#define I810_DMA_BUF_ORDER             12
+#define I810_DMA_BUF_SZ                (1<<I810_DMA_BUF_ORDER)
+#define I810_DMA_BUF_NR                256
+#define I810_NR_SAREA_CLIPRECTS        8
+
+/* Each region is a minimum of 64k, and there are at most 64 of them.
+ */
+#define I810_NR_TEX_REGIONS 64
+#define I810_LOG_MIN_TEX_REGION_SIZE 16
+#endif
+
+#define I810_UPLOAD_TEX0IMAGE  0x1 /* handled clientside */
+#define I810_UPLOAD_TEX1IMAGE  0x2 /* handled clientside */
+#define I810_UPLOAD_CTX        0x4
+#define I810_UPLOAD_BUFFERS    0x8
+#define I810_UPLOAD_TEX0       0x10
+#define I810_UPLOAD_TEX1       0x20
+#define I810_UPLOAD_CLIPRECTS  0x40
+
+
+/* Indices into buf.Setup where various bits of state are mirrored per
+ * context and per buffer.  These can be fired at the card as a unit,
+ * or in a piecewise fashion as required.
+ */
+
+/* Destbuffer state 
+ *    - backbuffer linear offset and pitch -- invarient in the current dri
+ *    - zbuffer linear offset and pitch -- also invarient
+ *    - drawing origin in back and depth buffers.
+ *
+ * Keep the depth/back buffer state here to acommodate private buffers
+ * in the future.
+ */
+#define I810_DESTREG_DI0  0    /* CMD_OP_DESTBUFFER_INFO (2 dwords) */
+#define I810_DESTREG_DI1  1
+#define I810_DESTREG_DV0  2    /* GFX_OP_DESTBUFFER_VARS (2 dwords) */
+#define I810_DESTREG_DV1  3
+#define I810_DESTREG_DR0  4    /* GFX_OP_DRAWRECT_INFO (4 dwords) */
+#define I810_DESTREG_DR1  5
+#define I810_DESTREG_DR2  6
+#define I810_DESTREG_DR3  7
+#define I810_DESTREG_DR4  8
+#define I810_DEST_SETUP_SIZE 10
+
+/* Context state
+ */
+#define I810_CTXREG_CF0   0    /* GFX_OP_COLOR_FACTOR */
+#define I810_CTXREG_CF1   1    
+#define I810_CTXREG_ST0   2     /* GFX_OP_STIPPLE */
+#define I810_CTXREG_ST1   3
+#define I810_CTXREG_VF    4    /* GFX_OP_VERTEX_FMT */
+#define I810_CTXREG_MT    5    /* GFX_OP_MAP_TEXELS */
+#define I810_CTXREG_MC0   6    /* GFX_OP_MAP_COLOR_STAGES - stage 0 */
+#define I810_CTXREG_MC1   7     /* GFX_OP_MAP_COLOR_STAGES - stage 1 */
+#define I810_CTXREG_MC2   8    /* GFX_OP_MAP_COLOR_STAGES - stage 2 */
+#define I810_CTXREG_MA0   9    /* GFX_OP_MAP_ALPHA_STAGES - stage 0 */
+#define I810_CTXREG_MA1   10   /* GFX_OP_MAP_ALPHA_STAGES - stage 1 */
+#define I810_CTXREG_MA2   11   /* GFX_OP_MAP_ALPHA_STAGES - stage 2 */
+#define I810_CTXREG_SDM   12   /* GFX_OP_SRC_DEST_MONO */
+#define I810_CTXREG_FOG   13   /* GFX_OP_FOG_COLOR */
+#define I810_CTXREG_B1    14   /* GFX_OP_BOOL_1 */
+#define I810_CTXREG_B2    15   /* GFX_OP_BOOL_2 */
+#define I810_CTXREG_LCS   16   /* GFX_OP_LINEWIDTH_CULL_SHADE_MODE */
+#define I810_CTXREG_PV    17   /* GFX_OP_PV_RULE -- Invarient! */
+#define I810_CTXREG_ZA    18   /* GFX_OP_ZBIAS_ALPHAFUNC */
+#define I810_CTXREG_AA    19   /* GFX_OP_ANTIALIAS */
+#define I810_CTX_SETUP_SIZE 20 
+
+/* Texture state (per tex unit)
+ */
+#define I810_TEXREG_MI0  0     /* GFX_OP_MAP_INFO (4 dwords) */
+#define I810_TEXREG_MI1  1     
+#define I810_TEXREG_MI2  2     
+#define I810_TEXREG_MI3  3     
+#define I810_TEXREG_MF   4     /* GFX_OP_MAP_FILTER */
+#define I810_TEXREG_MLC  5     /* GFX_OP_MAP_LOD_CTL */
+#define I810_TEXREG_MLL  6     /* GFX_OP_MAP_LOD_LIMITS */
+#define I810_TEXREG_MCS  7     /* GFX_OP_MAP_COORD_SETS ??? */
+#define I810_TEX_SETUP_SIZE 8
+
+#define I810_FRONT   0x1
+#define I810_BACK    0x2
+#define I810_DEPTH   0x4
+
+
+typedef struct _drm_i810_init {
+       enum {
+               I810_INIT_DMA = 0x01,
+               I810_CLEANUP_DMA = 0x02
+       } func;
+       int ring_map_idx;
+       int buffer_map_idx;
+       int sarea_priv_offset;
+       unsigned int ring_start;
+       unsigned int ring_end;
+       unsigned int ring_size;
+       unsigned int front_offset;
+       unsigned int back_offset;
+       unsigned int depth_offset;
+       unsigned int w;
+       unsigned int h;
+       unsigned int pitch;
+       unsigned int pitch_bits; 
+} drm_i810_init_t;
+
+/* Warning: If you change the SAREA structure you must change the Xserver
+ * structure as well */
+
+typedef struct _drm_i810_tex_region {
+       unsigned char next, prev; /* indices to form a circular LRU  */
+       unsigned char in_use;   /* owned by a client, or free? */
+       int age;                /* tracked by clients to update local LRU's */
+} drm_i810_tex_region_t;
+
+typedef struct _drm_i810_sarea {
+       unsigned int ContextState[I810_CTX_SETUP_SIZE];
+       unsigned int BufferState[I810_DEST_SETUP_SIZE];
+       unsigned int TexState[2][I810_TEX_SETUP_SIZE];
+       unsigned int dirty;
+
+       unsigned int nbox;
+       drm_clip_rect_t boxes[I810_NR_SAREA_CLIPRECTS];
+
+       /* Maintain an LRU of contiguous regions of texture space.  If
+        * you think you own a region of texture memory, and it has an
+        * age different to the one you set, then you are mistaken and
+        * it has been stolen by another client.  If global texAge
+        * hasn't changed, there is no need to walk the list.
+        *
+        * These regions can be used as a proxy for the fine-grained
+        * texture information of other clients - by maintaining them
+        * in the same lru which is used to age their own textures,
+        * clients have an approximate lru for the whole of global
+        * texture space, and can make informed decisions as to which
+        * areas to kick out.  There is no need to choose whether to
+        * kick out your own texture or someone else's - simply eject
+        * them all in LRU order.  
+        */
+   
+       drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS+1]; 
+                               /* Last elt is sentinal */
+        int texAge;            /* last time texture was uploaded */
+        int last_enqueue;      /* last time a buffer was enqueued */
+       int last_dispatch;      /* age of the most recently dispatched buffer */
+       int last_quiescent;     /*  */
+       int ctxOwner;           /* last context to upload state */
+
+       int vertex_prim;
+
+} drm_i810_sarea_t;
+
+typedef struct _drm_i810_clear {
+       int clear_color;
+       int clear_depth;
+       int flags;
+} drm_i810_clear_t;
+
+
+
+/* These may be placeholders if we have more cliprects than
+ * I810_NR_SAREA_CLIPRECTS.  In that case, the client sets discard to
+ * false, indicating that the buffer will be dispatched again with a
+ * new set of cliprects.
+ */
+typedef struct _drm_i810_vertex {
+       int idx;                /* buffer index */
+       int used;               /* nr bytes in use */
+       int discard;            /* client is finished with the buffer? */
+} drm_i810_vertex_t;
+
+typedef struct _drm_i810_copy_t {
+       int idx;                /* buffer index */
+       int used;               /* nr bytes in use */
+       void *address;          /* Address to copy from */
+} drm_i810_copy_t;
+
+typedef struct drm_i810_dma {
+       void *virtual;
+       int request_idx;
+       int request_size;
+       int granted;
+} drm_i810_dma_t;
+
+#endif /* _I810_DRM_H_ */
diff --git a/drivers/char/drm/i810_drv.c b/drivers/char/drm/i810_drv.c
new file mode 100644 (file)
index 0000000..d8c49a5
--- /dev/null
@@ -0,0 +1,643 @@
+/* i810_drv.c -- I810 driver -*- linux-c -*-
+ * Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
+ * 
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
+#define EXPORT_SYMTAB
+#endif
+#include "drmP.h"
+#include "i810_drv.h"
+
+
+EXPORT_SYMBOL(i810_init);
+EXPORT_SYMBOL(i810_cleanup);
+
+#define I810_NAME       "i810"
+#define I810_DESC       "Intel I810"
+#define I810_DATE       "20000719"
+#define I810_MAJOR      1
+#define I810_MINOR      1
+#define I810_PATCHLEVEL         0
+
+static drm_device_t          i810_device;
+drm_ctx_t                    i810_res_ctx;
+
+static struct file_operations i810_fops = {
+#if LINUX_VERSION_CODE >= 0x020322
+                               /* This started being used approx. 2.3.34 */
+       owner:   THIS_MODULE,
+#endif
+       open:    i810_open,
+       flush:   drm_flush,
+       release: i810_release,
+       ioctl:   i810_ioctl,
+       mmap:    drm_mmap,
+       read:    drm_read,
+       fasync:  drm_fasync,
+       poll:    drm_poll,
+};
+
+static struct miscdevice      i810_misc = {
+       minor: MISC_DYNAMIC_MINOR,
+       name:  I810_NAME,
+       fops:  &i810_fops,
+};
+
+static drm_ioctl_desc_t              i810_ioctls[] = {
+       [DRM_IOCTL_NR(DRM_IOCTL_VERSION)]     = { i810_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 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)]  = { drm_setunique,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)]       = { drm_block,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)]     = { drm_unblock,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)]     = { i810_control,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)]  = { drm_authmagic,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)]     = { drm_addmap,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)]    = { i810_addbufs,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MARK_BUFS)]   = { i810_markbufs,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)]   = { i810_infobufs,  1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)]   = { i810_freebufs,  1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)]     = { i810_addctx,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)]      = { i810_rmctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)]     = { i810_modctx,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)]     = { i810_getctx,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)]  = { i810_switchctx,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)]     = { i810_newctx,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)]     = { i810_resctx,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)]    = { drm_adddraw,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)]     = { drm_rmdraw,     1, 1 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_LOCK)]        = { i810_lock,      1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)]      = { i810_unlock,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FINISH)]      = { drm_finish,     1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { drm_agp_acquire, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)]  = { drm_agp_enable,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)]    = { drm_agp_info,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)]   = { drm_agp_alloc,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)]    = { drm_agp_free,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)]    = { drm_agp_bind,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)]  = { drm_agp_unbind,  1, 1 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_INIT)]   = { i810_dma_init,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_VERTEX)] = { i810_dma_vertex, 1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_CLEAR)]  = { i810_clear_bufs, 1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_FLUSH)]  = { i810_flush_ioctl,1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_GETAGE)] = { i810_getage,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_GETBUF)] = { i810_getbuf,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_SWAP)]   = { i810_swap_bufs,  1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_COPY)]   = { i810_copybuf,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_I810_DOCOPY)] = { i810_docopy,     1, 0 },
+};
+
+#define I810_IOCTL_COUNT DRM_ARRAY_SIZE(i810_ioctls)
+
+#ifdef MODULE
+static char                  *i810 = NULL;
+#endif
+
+MODULE_AUTHOR("VA Linux Systems, Inc.");
+MODULE_DESCRIPTION("Intel I810");
+MODULE_PARM(i810, "s");
+
+module_init(i810_init);
+module_exit(i810_cleanup);
+
+#ifndef MODULE
+/* i810_options is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO).  It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+static int __init i810_options(char *str)
+{
+       drm_parse_options(str);
+       return 1;
+}
+
+__setup("i810=", i810_options);
+#endif
+
+static int i810_setup(drm_device_t *dev)
+{
+       int i;
+       
+       atomic_set(&dev->ioctl_count, 0);
+       atomic_set(&dev->vma_count, 0);
+       dev->buf_use      = 0;
+       atomic_set(&dev->buf_alloc, 0);
+
+       drm_dma_setup(dev);
+
+       atomic_set(&dev->total_open, 0);
+       atomic_set(&dev->total_close, 0);
+       atomic_set(&dev->total_ioctl, 0);
+       atomic_set(&dev->total_irq, 0);
+       atomic_set(&dev->total_ctx, 0);
+       atomic_set(&dev->total_locks, 0);
+       atomic_set(&dev->total_unlocks, 0);
+       atomic_set(&dev->total_contends, 0);
+       atomic_set(&dev->total_sleeps, 0);
+
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               dev->magiclist[i].head = NULL;
+               dev->magiclist[i].tail = NULL;
+       }
+       dev->maplist        = NULL;
+       dev->map_count      = 0;
+       dev->vmalist        = NULL;
+       dev->lock.hw_lock   = NULL;
+       init_waitqueue_head(&dev->lock.lock_queue);
+       dev->queue_count    = 0;
+       dev->queue_reserved = 0;
+       dev->queue_slots    = 0;
+       dev->queuelist      = NULL;
+       dev->irq            = 0;
+       dev->context_flag   = 0;
+       dev->interrupt_flag = 0;
+       dev->dma_flag       = 0;
+       dev->last_context   = 0;
+       dev->last_switch    = 0;
+       dev->last_checked   = 0;
+       init_timer(&dev->timer);
+       init_waitqueue_head(&dev->context_wait);
+#if DRM_DMA_HISTO
+       memset(&dev->histo, 0, sizeof(dev->histo));
+#endif
+       dev->ctx_start      = 0;
+       dev->lck_start      = 0;
+       
+       dev->buf_rp       = dev->buf;
+       dev->buf_wp       = dev->buf;
+       dev->buf_end      = dev->buf + DRM_BSZ;
+       dev->buf_async    = NULL;
+       init_waitqueue_head(&dev->buf_readers);
+       init_waitqueue_head(&dev->buf_writers);
+                       
+       DRM_DEBUG("\n");
+                       
+       /* The kernel's context could be created here, but is now created
+          in drm_dma_enqueue.  This is more resource-efficient for
+          hardware that does not do DMA, but may mean that
+          drm_select_queue fails between the time the interrupt is
+          initialized and the time the queues are initialized. */
+                       
+       return 0;
+}
+
+
+static int i810_takedown(drm_device_t *dev)
+{
+       int               i;
+       drm_magic_entry_t *pt, *next;
+       drm_map_t         *map;
+       drm_vma_entry_t   *vma, *vma_next;
+
+       DRM_DEBUG("\n");
+
+       if (dev->irq) i810_irq_uninstall(dev);
+       
+       down(&dev->struct_sem);
+       del_timer(&dev->timer);
+       
+       if (dev->devname) {
+               drm_free(dev->devname, strlen(dev->devname)+1, DRM_MEM_DRIVER);
+               dev->devname = NULL;
+       }
+       
+       if (dev->unique) {
+               drm_free(dev->unique, strlen(dev->unique)+1, DRM_MEM_DRIVER);
+               dev->unique = NULL;
+               dev->unique_len = 0;
+       }
+                               /* Clear pid list */
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               for (pt = dev->magiclist[i].head; pt; pt = next) {
+                       next = pt->next;
+                       drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
+               }
+               dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
+       }
+                               /* Clear AGP information */
+       if (dev->agp) {
+               drm_agp_mem_t *entry;
+               drm_agp_mem_t *nexte;
+               
+                               /* Remove AGP resources, but leave dev->agp
+                                   intact until r128_cleanup is called. */
+               for (entry = dev->agp->memory; entry; entry = nexte) {
+                       nexte = entry->next;
+                       if (entry->bound) drm_unbind_agp(entry->memory);
+                       drm_free_agp(entry->memory, entry->pages);
+                       drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+               }
+               dev->agp->memory = NULL;
+               
+               if (dev->agp->acquired && drm_agp.release)
+                       (*drm_agp.release)();
+               
+               dev->agp->acquired = 0;
+               dev->agp->enabled  = 0;
+       }
+                               /* Clear vma list (only built for debugging) */
+       if (dev->vmalist) {
+               for (vma = dev->vmalist; vma; vma = vma_next) {
+                       vma_next = vma->next;
+                       drm_free(vma, sizeof(*vma), DRM_MEM_VMAS);
+               }
+               dev->vmalist = NULL;
+       }
+       
+                               /* Clear map area and mtrr information */
+       if (dev->maplist) {
+               for (i = 0; i < dev->map_count; i++) {
+                       map = dev->maplist[i];
+                       switch (map->type) {
+                       case _DRM_REGISTERS:
+                       case _DRM_FRAME_BUFFER:
+#ifdef CONFIG_MTRR
+                               if (map->mtrr >= 0) {
+                                       int retcode;
+                                       retcode = mtrr_del(map->mtrr,
+                                                          map->offset,
+                                                          map->size);
+                                       DRM_DEBUG("mtrr_del = %d\n", retcode);
+                               }
+#endif
+                               drm_ioremapfree(map->handle, map->size);
+                               break;
+                       case _DRM_SHM:
+                               drm_free_pages((unsigned long)map->handle,
+                                              drm_order(map->size)
+                                              - PAGE_SHIFT,
+                                              DRM_MEM_SAREA);
+                               break;
+                       case _DRM_AGP:
+                               break;
+                       }
+                       drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+               }
+               drm_free(dev->maplist,
+                        dev->map_count * sizeof(*dev->maplist),
+                        DRM_MEM_MAPS);
+               dev->maplist   = NULL;
+               dev->map_count = 0;
+       }
+       
+       if (dev->queuelist) {
+               for (i = 0; i < dev->queue_count; i++) {
+                       drm_waitlist_destroy(&dev->queuelist[i]->waitlist);
+                       if (dev->queuelist[i]) {
+                               drm_free(dev->queuelist[i],
+                                        sizeof(*dev->queuelist[0]),
+                                        DRM_MEM_QUEUES);
+                               dev->queuelist[i] = NULL;
+                       }
+               }
+               drm_free(dev->queuelist,
+                        dev->queue_slots * sizeof(*dev->queuelist),
+                        DRM_MEM_QUEUES);
+               dev->queuelist   = NULL;
+       }
+
+       drm_dma_takedown(dev);
+
+       dev->queue_count     = 0;
+       if (dev->lock.hw_lock) {
+               dev->lock.hw_lock    = NULL; /* SHM removed */
+               dev->lock.pid        = 0;
+               wake_up_interruptible(&dev->lock.lock_queue);
+       }
+       up(&dev->struct_sem);
+       
+       return 0;
+}
+
+/* i810_init is called via init_module at module load time, or via
+ * linux/init/main.c (this is not currently supported). */
+
+int i810_init(void)
+{
+       int                   retcode;
+       drm_device_t          *dev = &i810_device;
+
+       DRM_DEBUG("\n");
+
+       memset((void *)dev, 0, sizeof(*dev));
+       dev->count_lock   = SPIN_LOCK_UNLOCKED;
+       sema_init(&dev->struct_sem, 1);
+       
+#ifdef MODULE
+       drm_parse_options(i810);
+#endif
+       DRM_DEBUG("doing misc_register\n");
+       if ((retcode = misc_register(&i810_misc))) {
+               DRM_ERROR("Cannot register \"%s\"\n", I810_NAME);
+               return retcode;
+       }
+       dev->device = MKDEV(MISC_MAJOR, i810_misc.minor);
+       dev->name   = I810_NAME;
+
+       DRM_DEBUG("doing mem init\n");
+       drm_mem_init();
+       DRM_DEBUG("doing proc init\n");
+       drm_proc_init(dev);
+       DRM_DEBUG("doing agp init\n");
+       dev->agp    = drm_agp_init();
+       if(dev->agp == NULL) {
+               DRM_INFO("The i810 drm module requires the agpgart module"
+                        " to function correctly\nPlease load the agpgart"
+                        " module before you load the i810 module\n");
+               drm_proc_cleanup();
+               misc_deregister(&i810_misc);
+               i810_takedown(dev);
+               return -ENOMEM;
+       }
+       DRM_DEBUG("doing ctxbitmap init\n");
+       if((retcode = drm_ctxbitmap_init(dev))) {
+               DRM_ERROR("Cannot allocate memory for context bitmap.\n");
+               drm_proc_cleanup();
+               misc_deregister(&i810_misc);
+               i810_takedown(dev);
+               return retcode;
+       }
+
+       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
+                I810_NAME,
+                I810_MAJOR,
+                I810_MINOR,
+                I810_PATCHLEVEL,
+                I810_DATE,
+                i810_misc.minor);
+
+       return 0;
+}
+
+/* i810_cleanup is called via cleanup_module at module unload time. */
+
+void i810_cleanup(void)
+{
+       drm_device_t          *dev = &i810_device;
+
+       DRM_DEBUG("\n");
+       
+       drm_proc_cleanup();
+       if (misc_deregister(&i810_misc)) {
+               DRM_ERROR("Cannot unload module\n");
+       } else {
+               DRM_INFO("Module unloaded\n");
+       }
+       drm_ctxbitmap_cleanup(dev);
+       i810_takedown(dev);
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+}
+
+int i810_version(struct inode *inode, struct file *filp, unsigned int cmd,
+                 unsigned long arg)
+{
+       drm_version_t version;
+       int           len;
+
+       copy_from_user_ret(&version,
+                          (drm_version_t *)arg,
+                          sizeof(version),
+                          -EFAULT);
+
+#define DRM_COPY(name,value)                                \
+       len = strlen(value);                                 \
+       if (len > name##_len) len = name##_len;              \
+       name##_len = strlen(value);                          \
+       if (len && name) {                                   \
+               copy_to_user_ret(name, value, len, -EFAULT); \
+       }
+
+       version.version_major      = I810_MAJOR;
+       version.version_minor      = I810_MINOR;
+       version.version_patchlevel = I810_PATCHLEVEL;
+
+       DRM_COPY(version.name, I810_NAME);
+       DRM_COPY(version.date, I810_DATE);
+       DRM_COPY(version.desc, I810_DESC);
+
+       copy_to_user_ret((drm_version_t *)arg,
+                        &version,
+                        sizeof(version),
+                        -EFAULT);
+       return 0;
+}
+
+int i810_open(struct inode *inode, struct file *filp)
+{
+       drm_device_t  *dev    = &i810_device;
+       int           retcode = 0;
+       
+       DRM_DEBUG("open_count = %d\n", dev->open_count);
+       if (!(retcode = drm_open_helper(inode, filp, dev))) {
+               MOD_INC_USE_COUNT;
+               atomic_inc(&dev->total_open);
+               spin_lock(&dev->count_lock);
+               if (!dev->open_count++) {
+                       spin_unlock(&dev->count_lock);
+                       return i810_setup(dev);
+               }
+               spin_unlock(&dev->count_lock);
+       }
+       return retcode;
+}
+
+int i810_release(struct inode *inode, struct file *filp)
+{
+       drm_file_t    *priv   = filp->private_data;
+       drm_device_t  *dev    = priv->dev;
+       int           retcode = 0;
+
+       DRM_DEBUG("pid = %d, device = 0x%x, open_count = %d\n",
+                 current->pid, dev->device, dev->open_count);
+
+       if (dev->lock.hw_lock && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)
+           && dev->lock.pid == current->pid) {
+               i810_reclaim_buffers(dev, priv->pid);
+               DRM_ERROR("Process %d dead, freeing lock for context %d\n",
+                         current->pid,
+                         _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+               drm_lock_free(dev,
+                             &dev->lock.hw_lock->lock,
+                             _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+               
+                               /* FIXME: may require heavy-handed reset of
+                                   hardware at this point, possibly
+                                   processed via a callback to the X
+                                   server. */
+       } else if (dev->lock.hw_lock) {
+               /* The lock is required to reclaim buffers */
+               DECLARE_WAITQUEUE(entry, current);
+               add_wait_queue(&dev->lock.lock_queue, &entry);
+               for (;;) {
+                       if (!dev->lock.hw_lock) {
+                               /* Device has been unregistered */
+                               retcode = -EINTR;
+                               break;
+                       }
+                       if (drm_lock_take(&dev->lock.hw_lock->lock,
+                                         DRM_KERNEL_CONTEXT)) {
+                               dev->lock.pid       = priv->pid;
+                               dev->lock.lock_time = jiffies;
+                               atomic_inc(&dev->total_locks);
+                               break;  /* Got lock */
+                       }                       
+                               /* Contention */
+                       atomic_inc(&dev->total_sleeps);
+                       current->state = TASK_INTERRUPTIBLE;
+                       schedule();
+                       if (signal_pending(current)) {
+                               retcode = -ERESTARTSYS;
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev->lock.lock_queue, &entry);
+               if(!retcode) {
+                       i810_reclaim_buffers(dev, priv->pid);
+                       drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                                     DRM_KERNEL_CONTEXT);
+               }
+       }
+       drm_fasync(-1, filp, 0);
+
+       down(&dev->struct_sem);
+       if (priv->prev) priv->prev->next = priv->next;
+       else            dev->file_first  = priv->next;
+       if (priv->next) priv->next->prev = priv->prev;
+       else            dev->file_last   = priv->prev;
+       up(&dev->struct_sem);
+       
+       drm_free(priv, sizeof(*priv), DRM_MEM_FILES);
+       MOD_DEC_USE_COUNT;
+       atomic_inc(&dev->total_close);
+       spin_lock(&dev->count_lock);
+       if (!--dev->open_count) {
+               if (atomic_read(&dev->ioctl_count) || dev->blocked) {
+                       DRM_ERROR("Device busy: %d %d\n",
+                                 atomic_read(&dev->ioctl_count),
+                                 dev->blocked);
+                       spin_unlock(&dev->count_lock);
+                       return -EBUSY;
+               }
+               spin_unlock(&dev->count_lock);
+               return i810_takedown(dev);
+       }
+       spin_unlock(&dev->count_lock);
+       return retcode;
+}
+
+/* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. */
+
+int i810_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       int              nr      = DRM_IOCTL_NR(cmd);
+       drm_file_t       *priv   = filp->private_data;
+       drm_device_t     *dev    = priv->dev;
+       int              retcode = 0;
+       drm_ioctl_desc_t *ioctl;
+       drm_ioctl_t      *func;
+
+       atomic_inc(&dev->ioctl_count);
+       atomic_inc(&dev->total_ioctl);
+       ++priv->ioctl_count;
+       
+       DRM_DEBUG("pid = %d, cmd = 0x%02x, nr = 0x%02x, dev 0x%x, auth = %d\n",
+                 current->pid, cmd, nr, dev->device, priv->authenticated);
+
+       if (nr >= I810_IOCTL_COUNT) {
+               retcode = -EINVAL;
+       } else {
+               ioctl     = &i810_ioctls[nr];
+               func      = ioctl->func;
+
+               if (!func) {
+                       DRM_DEBUG("no function\n");
+                       retcode = -EINVAL;
+               } else if ((ioctl->root_only && !capable(CAP_SYS_ADMIN))
+                           || (ioctl->auth_needed && !priv->authenticated)) {
+                       retcode = -EACCES;
+               } else {
+                       retcode = (func)(inode, filp, cmd, arg);
+               }
+       }
+       
+       atomic_dec(&dev->ioctl_count);
+       return retcode;
+}
+
+int i810_unlock(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_lock_t        lock;
+
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+       
+       if (lock.context == DRM_KERNEL_CONTEXT) {
+               DRM_ERROR("Process %d using kernel context %d\n",
+                         current->pid, lock.context);
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("%d frees lock (%d holds)\n",
+                 lock.context,
+                 _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+       atomic_inc(&dev->total_unlocks);
+       if (_DRM_LOCK_IS_CONT(dev->lock.hw_lock->lock))
+               atomic_inc(&dev->total_contends);
+       drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT);
+       if (!dev->context_flag) {
+               if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                                 DRM_KERNEL_CONTEXT)) {
+                       DRM_ERROR("\n");
+               }
+       }
+#if DRM_DMA_HISTOGRAM
+       atomic_inc(&dev->histo.lhld[drm_histogram_slot(get_cycles()
+                                                      - dev->lck_start)]);
+#endif
+       
+       return 0;
+}
diff --git a/drivers/char/drm/i810_drv.h b/drivers/char/drm/i810_drv.h
new file mode 100644 (file)
index 0000000..f5411c0
--- /dev/null
@@ -0,0 +1,227 @@
+/* i810_drv.h -- Private header for the Matrox g200/g400 driver -*- linux-c -*-
+ * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#ifndef _I810_DRV_H_
+#define _I810_DRV_H_
+
+typedef struct drm_i810_buf_priv {
+       u32 *in_use;
+       int my_use_idx;
+       int currently_mapped;
+       void *virtual;
+       void *kernel_virtual;
+       int map_count;
+       struct vm_area_struct *vma;
+} drm_i810_buf_priv_t;
+
+typedef struct _drm_i810_ring_buffer{
+       int tail_mask;
+       unsigned long Start;
+       unsigned long End;
+       unsigned long Size;
+       u8 *virtual_start;
+       int head;
+       int tail;
+       int space;
+} drm_i810_ring_buffer_t;
+
+typedef struct drm_i810_private {
+       int ring_map_idx;
+       int buffer_map_idx;
+
+       drm_i810_ring_buffer_t ring;
+       drm_i810_sarea_t *sarea_priv;
+
+       unsigned long hw_status_page;
+       unsigned long counter;
+
+       atomic_t flush_done;
+       wait_queue_head_t flush_queue;  /* Processes waiting until flush    */
+       drm_buf_t *mmap_buffer;
+
+       
+       u32 front_di1, back_di1, zi1;
+       
+       int back_offset;
+       int depth_offset;
+       int w, h;
+       int pitch;
+} drm_i810_private_t;
+
+                               /* i810_drv.c */
+extern int  i810_init(void);
+extern void i810_cleanup(void);
+extern int  i810_version(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  i810_open(struct inode *inode, struct file *filp);
+extern int  i810_release(struct inode *inode, struct file *filp);
+extern int  i810_ioctl(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  i810_unlock(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+
+                               /* i810_dma.c */
+extern int  i810_dma_schedule(drm_device_t *dev, int locked);
+extern int  i810_getbuf(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  i810_irq_install(drm_device_t *dev, int irq);
+extern int  i810_irq_uninstall(drm_device_t *dev);
+extern int  i810_control(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  i810_lock(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_dma_init(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  i810_flush_ioctl(struct inode *inode, struct file *filp,
+                            unsigned int cmd, unsigned long arg);
+extern void i810_reclaim_buffers(drm_device_t *dev, pid_t pid);
+extern int  i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
+                       unsigned long arg);
+extern int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma);
+extern int i810_copybuf(struct inode *inode, struct file *filp, 
+                       unsigned int cmd, unsigned long arg);
+extern int i810_docopy(struct inode *inode, struct file *filp, 
+                      unsigned int cmd, unsigned long arg);
+
+                               /* i810_bufs.c */
+extern int  i810_addbufs(struct inode *inode, struct file *filp, 
+                       unsigned int cmd, unsigned long arg);
+extern int  i810_infobufs(struct inode *inode, struct file *filp, 
+                        unsigned int cmd, unsigned long arg);
+extern int  i810_markbufs(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int  i810_freebufs(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int  i810_addmap(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+
+                               /* i810_context.c */
+extern int  i810_resctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_addctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_modctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_getctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_switchctx(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  i810_newctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  i810_rmctx(struct inode *inode, struct file *filp,
+                     unsigned int cmd, unsigned long arg);
+
+extern int  i810_context_switch(drm_device_t *dev, int old, int new);
+extern int  i810_context_switch_complete(drm_device_t *dev, int new);
+
+#define I810_VERBOSE 0
+
+
+int i810_dma_vertex(struct inode *inode, struct file *filp,
+                   unsigned int cmd, unsigned long arg);
+
+int i810_swap_bufs(struct inode *inode, struct file *filp,
+                  unsigned int cmd, unsigned long arg);
+
+int i810_clear_bufs(struct inode *inode, struct file *filp,
+                   unsigned int cmd, unsigned long arg);
+
+#define GFX_OP_USER_INTERRUPT          ((0<<29)|(2<<23))
+#define GFX_OP_BREAKPOINT_INTERRUPT    ((0<<29)|(1<<23))
+#define CMD_REPORT_HEAD                        (7<<23)
+#define CMD_STORE_DWORD_IDX            ((0x21<<23) | 0x1)
+#define CMD_OP_BATCH_BUFFER  ((0x0<<29)|(0x30<<23)|0x1)
+
+#define INST_PARSER_CLIENT   0x00000000
+#define INST_OP_FLUSH        0x02000000
+#define INST_FLUSH_MAP_CACHE 0x00000001
+
+
+#define BB1_START_ADDR_MASK   (~0x7)
+#define BB1_PROTECTED         (1<<0)
+#define BB1_UNPROTECTED       (0<<0)
+#define BB2_END_ADDR_MASK     (~0x7)
+
+#define I810REG_HWSTAM         0x02098
+#define I810REG_INT_IDENTITY_R 0x020a4
+#define I810REG_INT_MASK_R     0x020a8
+#define I810REG_INT_ENABLE_R   0x020a0
+
+#define LP_RING                0x2030
+#define HP_RING                0x2040
+#define RING_TAIL                      0x00
+#define TAIL_ADDR              0x000FFFF8
+#define RING_HEAD                      0x04
+#define HEAD_WRAP_COUNT        0xFFE00000
+#define HEAD_WRAP_ONE          0x00200000
+#define HEAD_ADDR              0x001FFFFC
+#define RING_START                     0x08
+#define START_ADDR             0x00FFFFF8
+#define RING_LEN                       0x0C
+#define RING_NR_PAGES          0x000FF000 
+#define RING_REPORT_MASK       0x00000006
+#define RING_REPORT_64K        0x00000002
+#define RING_REPORT_128K       0x00000004
+#define RING_NO_REPORT         0x00000000
+#define RING_VALID_MASK        0x00000001
+#define RING_VALID             0x00000001
+#define RING_INVALID           0x00000000
+
+#define GFX_OP_SCISSOR         ((0x3<<29)|(0x1c<<24)|(0x10<<19))
+#define SC_UPDATE_SCISSOR       (0x1<<1)
+#define SC_ENABLE_MASK          (0x1<<0)
+#define SC_ENABLE               (0x1<<0)
+
+#define GFX_OP_SCISSOR_INFO    ((0x3<<29)|(0x1d<<24)|(0x81<<16)|(0x1))
+#define SCI_YMIN_MASK      (0xffff<<16)
+#define SCI_XMIN_MASK      (0xffff<<0)
+#define SCI_YMAX_MASK      (0xffff<<16)
+#define SCI_XMAX_MASK      (0xffff<<0)
+
+#define GFX_OP_COLOR_FACTOR      ((0x3<<29)|(0x1d<<24)|(0x1<<16)|0x0)
+#define GFX_OP_STIPPLE           ((0x3<<29)|(0x1d<<24)|(0x83<<16))
+#define GFX_OP_MAP_INFO          ((0x3<<29)|(0x1d<<24)|0x2)
+#define GFX_OP_DESTBUFFER_VARS   ((0x3<<29)|(0x1d<<24)|(0x85<<16)|0x0)
+#define GFX_OP_DRAWRECT_INFO     ((0x3<<29)|(0x1d<<24)|(0x80<<16)|(0x3))
+#define GFX_OP_PRIMITIVE         ((0x3<<29)|(0x1f<<24))
+
+#define CMD_OP_Z_BUFFER_INFO     ((0x0<<29)|(0x16<<23))
+#define CMD_OP_DESTBUFFER_INFO   ((0x0<<29)|(0x15<<23))
+
+#define BR00_BITBLT_CLIENT   0x40000000
+#define BR00_OP_COLOR_BLT    0x10000000
+#define BR00_OP_SRC_COPY_BLT 0x10C00000
+#define BR13_SOLID_PATTERN   0x80000000
+
+
+
+#endif
+
index ad887490bda78a9f0260b668ddb5662768453636..8de3dac9be2543465e9ffeb928739c001f64ce0b 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan  4 08:58:31 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
index 13bb606595b54f34ab7fdf70764d8bd50d8396d8..b246f76e598054c0d3cbf81bf044555e02de5cad 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Fri Jan  8 09:01:26 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
index 212ed18edecb30b8aee1584ed1eac15b7aa6085c..f62495aa21d2f75ec475abd7e269aa0409b70c74 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Apr 19 20:54:22 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
index 2523eb21ad54e11a45366c65ff637f1d5f765ae9..550827278084e3def16fbef9210a54c7795d5407 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Tue Feb  2 08:37:54 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
index d9ff66e349df8d5461842eda1dee331b399ecdd8..f342bb4fe81352a2f9004273bb0146f0af1f4feb 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Thu Feb  4 14:00:34 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
@@ -44,21 +45,25 @@ static spinlock_t     drm_mem_lock      = SPIN_LOCK_UNLOCKED;
 static unsigned long     drm_ram_available = 0; /* In pages */
 static unsigned long     drm_ram_used      = 0;
 static drm_mem_stats_t   drm_mem_stats[]   = {
-       [DRM_MEM_DMA]      = { "dmabufs"  },
-       [DRM_MEM_SAREA]    = { "sareas"   },
-       [DRM_MEM_DRIVER]   = { "driver"   },
-       [DRM_MEM_MAGIC]    = { "magic"    },
-       [DRM_MEM_IOCTLS]   = { "ioctltab" },
-       [DRM_MEM_MAPS]     = { "maplist"  },
-       [DRM_MEM_VMAS]     = { "vmalist"  },
-       [DRM_MEM_BUFS]     = { "buflist"  },
-       [DRM_MEM_SEGS]     = { "seglist"  },
-       [DRM_MEM_PAGES]    = { "pagelist" },
-       [DRM_MEM_FILES]    = { "files"    },
-       [DRM_MEM_QUEUES]   = { "queues"   },
-       [DRM_MEM_CMDS]     = { "commands" },
-       [DRM_MEM_MAPPINGS] = { "mappings" },
-       [DRM_MEM_BUFLISTS] = { "buflists" },
+       [DRM_MEM_DMA]       = { "dmabufs"  },
+       [DRM_MEM_SAREA]     = { "sareas"   },
+       [DRM_MEM_DRIVER]    = { "driver"   },
+       [DRM_MEM_MAGIC]     = { "magic"    },
+       [DRM_MEM_IOCTLS]    = { "ioctltab" },
+       [DRM_MEM_MAPS]      = { "maplist"  },
+       [DRM_MEM_VMAS]      = { "vmalist"  },
+       [DRM_MEM_BUFS]      = { "buflist"  },
+       [DRM_MEM_SEGS]      = { "seglist"  },
+       [DRM_MEM_PAGES]     = { "pagelist" },
+       [DRM_MEM_FILES]     = { "files"    },
+       [DRM_MEM_QUEUES]    = { "queues"   },
+       [DRM_MEM_CMDS]      = { "commands" },
+       [DRM_MEM_MAPPINGS]  = { "mappings" },
+       [DRM_MEM_BUFLISTS]  = { "buflists" },
+       [DRM_MEM_AGPLISTS]  = { "agplist"  },
+       [DRM_MEM_TOTALAGP]  = { "totalagp" },
+       [DRM_MEM_BOUNDAGP]  = { "boundagp" },
+       [DRM_MEM_CTXBITMAP] = { "ctxbitmap"},
        { NULL, 0, }            /* Last entry must be null */
 };
 
@@ -324,3 +329,120 @@ void drm_ioremapfree(void *pt, unsigned long size)
                              free_count, alloc_count);
        }
 }
+
+#ifdef DRM_AGP
+agp_memory *drm_alloc_agp(int pages, u32 type)
+{
+       agp_memory *handle;
+
+       if (!pages) {
+               DRM_MEM_ERROR(DRM_MEM_TOTALAGP, "Allocating 0 pages\n");
+               return NULL;
+       }
+       
+       if (drm_agp.allocate_memory) {
+               if ((handle = (*drm_agp.allocate_memory)(pages,
+                                                        type))) {
+                       spin_lock(&drm_mem_lock);
+                       ++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
+                       drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated
+                               += pages << PAGE_SHIFT;
+                       spin_unlock(&drm_mem_lock);
+                       return handle;
+               }
+       }
+       spin_lock(&drm_mem_lock);
+       ++drm_mem_stats[DRM_MEM_TOTALAGP].fail_count;
+       spin_unlock(&drm_mem_lock);
+       return NULL;
+}
+
+int drm_free_agp(agp_memory *handle, int pages)
+{
+       int           alloc_count;
+       int           free_count;
+       int           retval = -EINVAL;
+
+       if (!handle) {
+               DRM_MEM_ERROR(DRM_MEM_TOTALAGP,
+                             "Attempt to free NULL AGP handle\n");
+               return retval;;
+       }
+       
+       if (drm_agp.free_memory) {
+               (*drm_agp.free_memory)(handle);
+               spin_lock(&drm_mem_lock);
+               free_count  = ++drm_mem_stats[DRM_MEM_TOTALAGP].free_count;
+               alloc_count =   drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
+               drm_mem_stats[DRM_MEM_TOTALAGP].bytes_freed
+                       += pages << PAGE_SHIFT;
+               spin_unlock(&drm_mem_lock);
+               if (free_count > alloc_count) {
+                       DRM_MEM_ERROR(DRM_MEM_TOTALAGP,
+                                     "Excess frees: %d frees, %d allocs\n",
+                                     free_count, alloc_count);
+               }
+               return 0;
+       }
+       return retval;
+}
+
+int drm_bind_agp(agp_memory *handle, unsigned int start)
+{
+       int retcode = -EINVAL;
+
+   DRM_DEBUG("drm_bind_agp called\n");
+       if (!handle) {
+               DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
+                             "Attempt to bind NULL AGP handle\n");
+               return retcode;
+       }
+
+   DRM_DEBUG("drm_agp.bind_memory : %p\n", drm_agp.bind_memory);
+       if (drm_agp.bind_memory) {
+               if (!(retcode = (*drm_agp.bind_memory)(handle, start))) {
+                       spin_lock(&drm_mem_lock);
+                       ++drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
+                       drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_allocated
+                               += handle->page_count << PAGE_SHIFT;
+                       spin_unlock(&drm_mem_lock);
+                  DRM_DEBUG("drm_agp.bind_memory: retcode %d\n", retcode);
+                       return retcode;
+               }
+       }
+       spin_lock(&drm_mem_lock);
+       ++drm_mem_stats[DRM_MEM_BOUNDAGP].fail_count;
+       spin_unlock(&drm_mem_lock);
+       return retcode;
+}
+
+int drm_unbind_agp(agp_memory *handle)
+{
+       int alloc_count;
+       int free_count;
+       int retcode = -EINVAL;
+       
+       if (!handle) {
+               DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
+                             "Attempt to unbind NULL AGP handle\n");
+               return retcode;
+       }
+
+       if (drm_agp.unbind_memory) {
+               int c = handle->page_count;
+               if ((retcode = (*drm_agp.unbind_memory)(handle)))
+                       return retcode;
+               spin_lock(&drm_mem_lock);
+               free_count  = ++drm_mem_stats[DRM_MEM_BOUNDAGP].free_count;
+               alloc_count = drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count;
+               drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_freed += c << PAGE_SHIFT;
+               spin_unlock(&drm_mem_lock);
+               if (free_count > alloc_count) {
+                       DRM_MEM_ERROR(DRM_MEM_BOUNDAGP,
+                                     "Excess frees: %d frees, %d allocs\n",
+                                     free_count, alloc_count);
+               }
+       }
+       return retcode;
+}
+#endif
diff --git a/drivers/char/drm/mga_bufs.c b/drivers/char/drm/mga_bufs.c
new file mode 100644 (file)
index 0000000..b97eb49
--- /dev/null
@@ -0,0 +1,639 @@
+/* mga_bufs.c -- IOCTLs to manage buffers -*- linux-c -*-
+ * Created: Thu Jan 6 01:47:26 2000 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "mga_drv.h"
+#include "linux/un.h"
+
+
+int mga_addbufs_agp(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_device_dma_t *dma = dev->dma;
+       drm_buf_desc_t request;
+       drm_buf_entry_t *entry;
+       drm_buf_t *buf;
+       unsigned long offset;
+       unsigned long agp_offset;
+       int count;
+       int order;
+       int size;
+       int alignment;
+       int page_order;
+       int total;
+       int byte_count;
+       int i;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       count = request.count;
+       order = drm_order(request.size);
+       size    = 1 << order;
+       agp_offset = request.agp_start;
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size) :size;
+       page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
+       total = PAGE_SIZE << page_order;
+       byte_count = 0;
+
+       DRM_DEBUG("count: %d\n", count);
+       DRM_DEBUG("order: %d\n", order);
+       DRM_DEBUG("size: %d\n", size);
+       DRM_DEBUG("agp_offset: %ld\n", agp_offset);
+       DRM_DEBUG("alignment: %d\n", alignment);
+       DRM_DEBUG("page_order: %d\n", page_order);
+       DRM_DEBUG("total: %d\n", total);
+       DRM_DEBUG("byte_count: %d\n", byte_count);
+
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       if (dev->queue_count) return -EBUSY; /* Not while in use */
+       spin_lock(&dev->count_lock);
+       if (dev->buf_use) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       atomic_inc(&dev->buf_alloc);
+       spin_unlock(&dev->count_lock);
+   
+       down(&dev->struct_sem);
+       entry = &dma->bufs[order];
+       if (entry->buf_count) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM; /* May only call once for each order */
+       }
+   
+       entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+                                  DRM_MEM_BUFS);
+       if (!entry->buflist) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM;
+       }
+       memset(entry->buflist, 0, count * sizeof(*entry->buflist));
+   
+       entry->buf_size   = size;
+       entry->page_order = page_order;
+       offset = 0;
+
+   
+       while(entry->buf_count < count) {
+               buf = &entry->buflist[entry->buf_count];
+               buf->idx = dma->buf_count + entry->buf_count;
+               buf->total = alignment;
+               buf->order = order;
+               buf->used = 0;
+
+               DRM_DEBUG("offset : %ld\n", offset);
+
+               buf->offset = offset; /* Hrm */
+               buf->bus_address = dev->agp->base + agp_offset + offset;
+               buf->address = (void *)(agp_offset + offset + dev->agp->base);
+               buf->next = NULL;
+               buf->waiting = 0;
+               buf->pending = 0;
+               init_waitqueue_head(&buf->dma_wait);
+               buf->pid = 0;
+
+               buf->dev_private = drm_alloc(sizeof(drm_mga_buf_priv_t), DRM_MEM_BUFS);
+               buf->dev_priv_size = sizeof(drm_mga_buf_priv_t);
+
+#if DRM_DMA_HISTOGRAM
+               buf->time_queued = 0;
+               buf->time_dispatched = 0;
+               buf->time_completed = 0;
+               buf->time_freed = 0;
+#endif
+               offset = offset + alignment;
+               entry->buf_count++;
+               byte_count += PAGE_SIZE << page_order;
+      
+               DRM_DEBUG("buffer %d @ %p\n",
+                         entry->buf_count, buf->address);
+       }
+   
+       dma->buflist = drm_realloc(dma->buflist,
+                                  dma->buf_count * sizeof(*dma->buflist),
+                                  (dma->buf_count + entry->buf_count)
+                                  * sizeof(*dma->buflist),
+                                  DRM_MEM_BUFS);
+       for (i = dma->buf_count; i < dma->buf_count + entry->buf_count; i++)
+               dma->buflist[i] = &entry->buflist[i - dma->buf_count];
+   
+       dma->buf_count  += entry->buf_count;
+
+       DRM_DEBUG("dma->buf_count : %d\n", dma->buf_count);
+
+       dma->byte_count += byte_count;
+
+       DRM_DEBUG("entry->buf_count : %d\n", entry->buf_count);
+
+       drm_freelist_create(&entry->freelist, entry->buf_count);
+       for (i = 0; i < entry->buf_count; i++) {
+               drm_freelist_put(dev, &entry->freelist, &entry->buflist[i]);
+       }
+   
+       up(&dev->struct_sem);
+   
+       request.count = entry->buf_count;
+       request.size  = size;
+   
+       copy_to_user_ret((drm_buf_desc_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+   
+       atomic_dec(&dev->buf_alloc);
+
+       DRM_DEBUG("count: %d\n", count);
+       DRM_DEBUG("order: %d\n", order);
+       DRM_DEBUG("size: %d\n", size);
+       DRM_DEBUG("agp_offset: %ld\n", agp_offset);
+       DRM_DEBUG("alignment: %d\n", alignment);
+       DRM_DEBUG("page_order: %d\n", page_order);
+       DRM_DEBUG("total: %d\n", total);
+       DRM_DEBUG("byte_count: %d\n", byte_count);
+
+       dma->flags = _DRM_DMA_USE_AGP;
+
+       DRM_DEBUG("dma->flags : %x\n", dma->flags);
+
+       return 0;
+}
+
+int mga_addbufs_pci(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_device_dma_t *dma    = dev->dma;
+       drm_buf_desc_t   request;
+       int              count;
+       int              order;
+       int              size;
+       int              total;
+       int              page_order;
+       drm_buf_entry_t  *entry;
+       unsigned long    page;
+       drm_buf_t        *buf;
+       int              alignment;
+       unsigned long    offset;
+       int              i;
+       int              byte_count;
+       int              page_count;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       count      = request.count;
+       order      = drm_order(request.size);
+       size       = 1 << order;
+       
+       DRM_DEBUG("count = %d, size = %d (%d), order = %d, queue_count = %d\n",
+                 request.count, request.size, size, order, dev->queue_count);
+
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       if (dev->queue_count) return -EBUSY; /* Not while in use */
+
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size) :size;
+       page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
+       total      = PAGE_SIZE << page_order;
+
+       spin_lock(&dev->count_lock);
+       if (dev->buf_use) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       atomic_inc(&dev->buf_alloc);
+       spin_unlock(&dev->count_lock);
+       
+       down(&dev->struct_sem);
+       entry = &dma->bufs[order];
+       if (entry->buf_count) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM; /* May only call once for each order */
+       }
+       
+       entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+                                  DRM_MEM_BUFS);
+       if (!entry->buflist) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM;
+       }
+       memset(entry->buflist, 0, count * sizeof(*entry->buflist));
+
+       entry->seglist = drm_alloc(count * sizeof(*entry->seglist),
+                                  DRM_MEM_SEGS);
+       if (!entry->seglist) {
+               drm_free(entry->buflist,
+                        count * sizeof(*entry->buflist),
+                        DRM_MEM_BUFS);
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM;
+       }
+       memset(entry->seglist, 0, count * sizeof(*entry->seglist));
+
+       dma->pagelist = drm_realloc(dma->pagelist,
+                                   dma->page_count * sizeof(*dma->pagelist),
+                                   (dma->page_count + (count << page_order))
+                                   * sizeof(*dma->pagelist),
+                                   DRM_MEM_PAGES);
+       DRM_DEBUG("pagelist: %d entries\n",
+                 dma->page_count + (count << page_order));
+
+
+       entry->buf_size   = size;
+       entry->page_order = page_order;
+       byte_count        = 0;
+       page_count        = 0;
+       while (entry->buf_count < count) {
+               if (!(page = drm_alloc_pages(page_order, DRM_MEM_DMA))) break;
+               entry->seglist[entry->seg_count++] = page;
+               for (i = 0; i < (1 << page_order); i++) {
+                       DRM_DEBUG("page %d @ 0x%08lx\n",
+                                 dma->page_count + page_count,
+                                 page + PAGE_SIZE * i);
+                       dma->pagelist[dma->page_count + page_count++]
+                               = page + PAGE_SIZE * i;
+               }
+               for (offset = 0;
+                    offset + size <= total && entry->buf_count < count;
+                    offset += alignment, ++entry->buf_count) {
+                       buf          = &entry->buflist[entry->buf_count];
+                       buf->idx     = dma->buf_count + entry->buf_count;
+                       buf->total   = alignment;
+                       buf->order   = order;
+                       buf->used    = 0;
+                       buf->offset  = (dma->byte_count + byte_count + offset);
+                       buf->address = (void *)(page + offset);
+                       buf->next    = NULL;
+                       buf->waiting = 0;
+                       buf->pending = 0;
+                       init_waitqueue_head(&buf->dma_wait);
+                       buf->pid     = 0;
+#if DRM_DMA_HISTOGRAM
+                       buf->time_queued     = 0;
+                       buf->time_dispatched = 0;
+                       buf->time_completed  = 0;
+                       buf->time_freed      = 0;
+#endif
+                       DRM_DEBUG("buffer %d @ %p\n",
+                                 entry->buf_count, buf->address);
+               }
+               byte_count += PAGE_SIZE << page_order;
+       }
+
+       dma->buflist = drm_realloc(dma->buflist,
+                                  dma->buf_count * sizeof(*dma->buflist),
+                                  (dma->buf_count + entry->buf_count)
+                                  * sizeof(*dma->buflist),
+                                  DRM_MEM_BUFS);
+       for (i = dma->buf_count; i < dma->buf_count + entry->buf_count; i++)
+               dma->buflist[i] = &entry->buflist[i - dma->buf_count];
+
+       dma->buf_count  += entry->buf_count;
+       dma->seg_count  += entry->seg_count;
+       dma->page_count += entry->seg_count << page_order;
+       dma->byte_count += PAGE_SIZE * (entry->seg_count << page_order);
+       
+       drm_freelist_create(&entry->freelist, entry->buf_count);
+       for (i = 0; i < entry->buf_count; i++) {
+               drm_freelist_put(dev, &entry->freelist, &entry->buflist[i]);
+       }
+       
+       up(&dev->struct_sem);
+
+       request.count = entry->buf_count;
+       request.size  = size;
+
+       copy_to_user_ret((drm_buf_desc_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+       
+       atomic_dec(&dev->buf_alloc);
+       return 0;
+}
+
+int mga_addbufs(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       drm_buf_desc_t   request;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       if(request.flags & _DRM_AGP_BUFFER)
+               return mga_addbufs_agp(inode, filp, cmd, arg);
+       else
+               return mga_addbufs_pci(inode, filp, cmd, arg);
+}
+
+int mga_infobufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_info_t   request;
+       int              i;
+       int              count;
+
+       if (!dma) return -EINVAL;
+
+       spin_lock(&dev->count_lock);
+       if (atomic_read(&dev->buf_alloc)) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       ++dev->buf_use;         /* Can't allocate more after this call */
+       spin_unlock(&dev->count_lock);
+
+       copy_from_user_ret(&request,
+                          (drm_buf_info_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       for (i = 0, count = 0; i < DRM_MAX_ORDER+1; i++) {
+               if (dma->bufs[i].buf_count) ++count;
+       }
+       
+       DRM_DEBUG("count = %d\n", count);
+       
+       if (request.count >= count) {
+               for (i = 0, count = 0; i < DRM_MAX_ORDER+1; i++) {
+                       if (dma->bufs[i].buf_count) {
+                               copy_to_user_ret(&request.list[count].count,
+                                                &dma->bufs[i].buf_count,
+                                                sizeof(dma->bufs[0]
+                                                       .buf_count),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count].size,
+                                                &dma->bufs[i].buf_size,
+                                                sizeof(dma->bufs[0].buf_size),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count].low_mark,
+                                                &dma->bufs[i]
+                                                .freelist.low_mark,
+                                                sizeof(dma->bufs[0]
+                                                       .freelist.low_mark),
+                                                -EFAULT);
+                               copy_to_user_ret(&request.list[count]
+                                                .high_mark,
+                                                &dma->bufs[i]
+                                                .freelist.high_mark,
+                                                sizeof(dma->bufs[0]
+                                                       .freelist.high_mark),
+                                                -EFAULT);
+                               DRM_DEBUG("%d %d %d %d %d\n",
+                                         i,
+                                         dma->bufs[i].buf_count,
+                                         dma->bufs[i].buf_size,
+                                         dma->bufs[i].freelist.low_mark,
+                                         dma->bufs[i].freelist.high_mark);
+                               ++count;
+                       }
+               }
+       }
+       request.count = count;
+
+       copy_to_user_ret((drm_buf_info_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+       
+       return 0;
+}
+
+int mga_markbufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_desc_t   request;
+       int              order;
+       drm_buf_entry_t  *entry;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       DRM_DEBUG("%d, %d, %d\n",
+                 request.size, request.low_mark, request.high_mark);
+       order = drm_order(request.size);
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       entry = &dma->bufs[order];
+
+       if (request.low_mark < 0 || request.low_mark > entry->buf_count)
+               return -EINVAL;
+       if (request.high_mark < 0 || request.high_mark > entry->buf_count)
+               return -EINVAL;
+
+       entry->freelist.low_mark  = request.low_mark;
+       entry->freelist.high_mark = request.high_mark;
+       
+       return 0;
+}
+
+int mga_freebufs(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_device_dma_t *dma    = dev->dma;
+       drm_buf_free_t   request;
+       int              i;
+       int              idx;
+       drm_buf_t        *buf;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_free_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       DRM_DEBUG("%d\n", request.count);
+       for (i = 0; i < request.count; i++) {
+               copy_from_user_ret(&idx,
+                                  &request.list[i],
+                                  sizeof(idx),
+                                  -EFAULT);
+               if (idx < 0 || idx >= dma->buf_count) {
+                       DRM_ERROR("Index %d (of %d max)\n",
+                                 idx, dma->buf_count - 1);
+                       return -EINVAL;
+               }
+               buf = dma->buflist[idx];
+               if (buf->pid != current->pid) {
+                       DRM_ERROR("Process %d freeing buffer owned by %d\n",
+                                 current->pid, buf->pid);
+                       return -EINVAL;
+               }
+               drm_free_buffer(dev, buf);
+       }
+       
+       return 0;
+}
+
+int mga_mapbufs(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_device_dma_t *dma    = dev->dma;
+       int              retcode = 0;
+       const int        zero    = 0;
+       unsigned long    virtual;
+       unsigned long    address;
+       drm_buf_map_t    request;
+       int              i;
+
+       if (!dma) return -EINVAL;
+       
+       DRM_DEBUG("\n");
+
+       spin_lock(&dev->count_lock);
+       if (atomic_read(&dev->buf_alloc)) {
+               spin_unlock(&dev->count_lock);
+               DRM_DEBUG("Busy\n");
+               return -EBUSY;
+       }
+       ++dev->buf_use;         /* Can't allocate more after this call */
+       spin_unlock(&dev->count_lock);
+
+       copy_from_user_ret(&request,
+                          (drm_buf_map_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       DRM_DEBUG("mga_mapbufs\n");
+       DRM_DEBUG("dma->flags : %x\n", dma->flags);
+   
+       if (request.count >= dma->buf_count) {
+               if(dma->flags & _DRM_DMA_USE_AGP) {
+                       drm_mga_private_t *dev_priv = dev->dev_private;
+                       drm_map_t *map = NULL;
+        
+                       map = dev->maplist[dev_priv->buffer_map_idx];
+                       if (!map) {
+                               DRM_DEBUG("map is null\n");
+                               retcode = -EINVAL;
+                               goto done;
+                       }
+
+                       DRM_DEBUG("map->offset : %lx\n", map->offset);
+                       DRM_DEBUG("map->size : %lx\n", map->size);
+                       DRM_DEBUG("map->type : %d\n", map->type);
+                       DRM_DEBUG("map->flags : %x\n", map->flags);
+                       DRM_DEBUG("map->handle : %p\n", map->handle);
+                       DRM_DEBUG("map->mtrr : %d\n", map->mtrr);
+                       down(&current->mm->mmap_sem);
+                       virtual = do_mmap(filp, 0, map->size, 
+                                         PROT_READ|PROT_WRITE,
+                                         MAP_SHARED, 
+                                         (unsigned long)map->offset);
+                       up(&current->mm->mmap_sem);
+               } else {
+                       down(&current->mm->mmap_sem);
+                       virtual = do_mmap(filp, 0, dma->byte_count,
+                                         PROT_READ|PROT_WRITE, MAP_SHARED, 0);
+                       up(&current->mm->mmap_sem);
+               }
+               if (virtual > -1024UL) {
+                       /* Real error */
+                       DRM_DEBUG("mmap error\n");
+                       retcode = (signed long)virtual;
+                       goto done;
+               }
+               request.virtual = (void *)virtual;
+      
+               for (i = 0; i < dma->buf_count; i++) {
+                       if (copy_to_user(&request.list[i].idx,
+                                        &dma->buflist[i]->idx,
+                                        sizeof(request.list[0].idx))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       if (copy_to_user(&request.list[i].total,
+                                        &dma->buflist[i]->total,
+                                        sizeof(request.list[0].total))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       if (copy_to_user(&request.list[i].used,
+                                        &zero,
+                                        sizeof(zero))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       address = virtual + dma->buflist[i]->offset;
+                       if (copy_to_user(&request.list[i].address,
+                                        &address,
+                                        sizeof(address))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+               }
+       }
+ done:
+       request.count = dma->buf_count;
+       DRM_DEBUG("%d buffers, retcode = %d\n", request.count, retcode);
+   
+       copy_to_user_ret((drm_buf_map_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+
+       DRM_DEBUG("retcode : %d\n", retcode);
+
+       return retcode;
+}
diff --git a/drivers/char/drm/mga_context.c b/drivers/char/drm/mga_context.c
new file mode 100644 (file)
index 0000000..d025927
--- /dev/null
@@ -0,0 +1,205 @@
+/* mga_context.c -- IOCTLs for mga contexts -*- linux-c -*-
+ * Created: Mon Dec 13 09:51:35 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Author: Rickard E. (Rik) Faith <faith@valinux.com>
+ *        Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#include <linux/sched.h>
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "mga_drv.h"
+
+static int mga_alloc_queue(drm_device_t *dev)
+{
+       int temp = drm_ctxbitmap_next(dev);
+       DRM_DEBUG("mga_alloc_queue: %d\n", temp);
+       return temp;
+}
+
+int mga_context_switch(drm_device_t *dev, int old, int new)
+{
+        char        buf[64];
+
+        atomic_inc(&dev->total_ctx);
+
+        if (test_and_set_bit(0, &dev->context_flag)) {
+                DRM_ERROR("Reentering -- FIXME\n");
+                return -EBUSY;
+        }
+
+#if DRM_DMA_HISTOGRAM
+        dev->ctx_start = get_cycles();
+#endif
+        
+        DRM_DEBUG("Context switch from %d to %d\n", old, new);
+
+        if (new == dev->last_context) {
+                clear_bit(0, &dev->context_flag);
+                return 0;
+        }
+        
+        if (drm_flags & DRM_FLAG_NOCTX) {
+                mga_context_switch_complete(dev, new);
+        } else {
+                sprintf(buf, "C %d %d\n", old, new);
+                drm_write_string(dev, buf);
+        }
+        
+        return 0;
+}
+
+int mga_context_switch_complete(drm_device_t *dev, int new)
+{
+        dev->last_context = new;  /* PRE/POST: This is the _only_ writer. */
+        dev->last_switch  = jiffies;
+        
+        if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+                DRM_ERROR("Lock isn't held after context switch\n");
+        }
+
+                               /* If a context switch is ever initiated
+                                   when the kernel holds the lock, release
+                                   that lock here. */
+#if DRM_DMA_HISTOGRAM
+        atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
+                                                      - dev->ctx_start)]);
+                   
+#endif
+        clear_bit(0, &dev->context_flag);
+        wake_up(&dev->context_wait);
+        
+        return 0;
+}
+
+int mga_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
+              unsigned long arg)
+{
+       drm_ctx_res_t   res;
+       drm_ctx_t       ctx;
+       int             i;
+
+       DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
+       copy_from_user_ret(&res, (drm_ctx_res_t *)arg, sizeof(res), -EFAULT);
+       if (res.count >= DRM_RESERVED_CONTEXTS) {
+               memset(&ctx, 0, sizeof(ctx));
+               for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
+                       ctx.handle = i;
+                       copy_to_user_ret(&res.contexts[i],
+                                        &i,
+                                        sizeof(i),
+                                        -EFAULT);
+               }
+       }
+       res.count = DRM_RESERVED_CONTEXTS;
+       copy_to_user_ret((drm_ctx_res_t *)arg, &res, sizeof(res), -EFAULT);
+       return 0;
+}
+
+int mga_addctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       if ((ctx.handle = mga_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
+                               /* Skip kernel's context and get a new one. */
+               ctx.handle = mga_alloc_queue(dev);
+       }
+        if (ctx.handle == -1) {
+               DRM_DEBUG("Not enough free contexts.\n");
+                               /* Should this return -EBUSY instead? */
+               return -ENOMEM;
+       }
+       DRM_DEBUG("%d\n", ctx.handle);
+       copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int mga_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       /* This does nothing for the mga */
+       return 0;
+}
+
+int mga_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       drm_ctx_t ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT);
+       /* This is 0, because we don't hanlde any context flags */
+       ctx.flags = 0;
+       copy_to_user_ret((drm_ctx_t*)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int mga_switchctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       return mga_context_switch(dev, dev->last_context, ctx.handle);
+}
+
+int mga_newctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       mga_context_switch_complete(dev, ctx.handle);
+
+       return 0;
+}
+
+int mga_rmctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       if(ctx.handle != DRM_KERNEL_CONTEXT) {
+               drm_ctxbitmap_free(dev, ctx.handle);
+       }
+       
+       return 0;
+}
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
new file mode 100644 (file)
index 0000000..28e8811
--- /dev/null
@@ -0,0 +1,1115 @@
+/* mga_dma.c -- DMA support for mga g200/g400 -*- linux-c -*-
+ * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *         Keith Whitwell <keithw@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "mga_drv.h"
+
+#include <linux/interrupt.h>   /* For task queue support */
+
+#define MGA_REG(reg)           2
+#define MGA_BASE(reg)          ((unsigned long) \
+                               ((drm_device_t *)dev)->maplist[MGA_REG(reg)]->handle)
+#define MGA_ADDR(reg)          (MGA_BASE(reg) + reg)
+#define MGA_DEREF(reg)         *(__volatile__ int *)MGA_ADDR(reg)
+#define MGA_READ(reg)          MGA_DEREF(reg)
+#define MGA_WRITE(reg,val)     do { MGA_DEREF(reg) = val; } while (0)
+
+#define PDEA_pagpxfer_enable        0x2
+
+static int mga_flush_queue(drm_device_t *dev);
+
+static unsigned long mga_alloc_page(drm_device_t *dev)
+{
+       unsigned long address;
+   
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       address = __get_free_page(GFP_KERNEL);
+       if(address == 0UL) {
+               return 0;
+       }
+       atomic_inc(&mem_map[MAP_NR((void *) address)].count);
+       set_bit(PG_locked, &mem_map[MAP_NR((void *) address)].flags);
+   
+       return address;
+}
+
+static void mga_free_page(drm_device_t *dev, unsigned long page)
+{
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(page == 0UL) {
+               return;
+       }
+       atomic_dec(&mem_map[MAP_NR((void *) page)].count);
+       clear_bit(PG_locked, &mem_map[MAP_NR((void *) page)].flags);
+       wake_up(&mem_map[MAP_NR((void *) page)].wait);
+       free_page(page);
+       return;
+}
+
+static void mga_delay(void)
+{
+       return;
+}
+
+void mga_flush_write_combine(void)
+{
+       int xchangeDummy;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       __asm__ volatile(" push %%eax ; xchg %%eax, %0 ; pop %%eax" : : "m" (xchangeDummy));
+       __asm__ volatile(" push %%eax ; push %%ebx ; push %%ecx ; push %%edx ;"
+                        " movl $0,%%eax ; cpuid ; pop %%edx ; pop %%ecx ; pop %%ebx ;"
+                        " pop %%eax" : /* no outputs */ :  /* no inputs */ );
+}
+
+/* These are two age tags that will never be sent to
+ * the hardware */
+#define MGA_BUF_USED   0xffffffff
+#define MGA_BUF_FREE   0
+
+static int mga_freelist_init(drm_device_t *dev)
+{
+       drm_device_dma_t *dma = dev->dma;
+       drm_buf_t *buf;
+       drm_mga_buf_priv_t *buf_priv;
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_mga_freelist_t *item;
+       int i;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       dev_priv->head = drm_alloc(sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
+       if(dev_priv->head == NULL) return -ENOMEM;
+       memset(dev_priv->head, 0, sizeof(drm_mga_freelist_t));
+       dev_priv->head->age = MGA_BUF_USED;
+   
+       for (i = 0; i < dma->buf_count; i++) {
+               buf = dma->buflist[ i ];
+               buf_priv = buf->dev_private;
+               item = drm_alloc(sizeof(drm_mga_freelist_t),
+                                DRM_MEM_DRIVER);
+               if(item == NULL) return -ENOMEM;
+               memset(item, 0, sizeof(drm_mga_freelist_t));
+               item->age = MGA_BUF_FREE;
+               item->prev = dev_priv->head;
+               item->next = dev_priv->head->next;
+               if(dev_priv->head->next != NULL)
+                       dev_priv->head->next->prev = item;
+               if(item->next == NULL) dev_priv->tail = item;
+               item->buf = buf;
+               buf_priv->my_freelist = item;
+               buf_priv->discard = 0;
+               buf_priv->dispatched = 0;
+               dev_priv->head->next = item;
+       }
+   
+       return 0;
+}
+
+static void mga_freelist_cleanup(drm_device_t *dev)
+{
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_mga_freelist_t *item;
+       drm_mga_freelist_t *prev;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       item = dev_priv->head;
+       while(item) {
+               prev = item;
+               item = item->next;
+               drm_free(prev, sizeof(drm_mga_freelist_t), DRM_MEM_DRIVER);
+       }
+   
+       dev_priv->head = dev_priv->tail = NULL;
+}
+
+/* Frees dispatch lock */
+static inline void mga_dma_quiescent(drm_device_t *dev)
+{
+       drm_device_dma_t  *dma      = dev->dma;
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned long end;
+       int i;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       end = jiffies + (HZ*3);
+       while(1) {
+               if(!test_and_set_bit(MGA_IN_DISPATCH, 
+                                    &dev_priv->dispatch_status)) {
+                       break;
+               }
+               if((signed)(end - jiffies) <= 0) {
+                       DRM_ERROR("irqs: %d wanted %d\n", 
+                                 atomic_read(&dev->total_irq), 
+                                 atomic_read(&dma->total_lost));
+                       DRM_ERROR("lockup\n"); 
+                       goto out_nolock;
+               }
+               for (i = 0 ; i < 2000 ; i++) mga_delay();
+       }
+       end = jiffies + (HZ*3);
+       DRM_DEBUG("quiescent status : %x\n", MGA_READ(MGAREG_STATUS));
+       while((MGA_READ(MGAREG_STATUS) & 0x00030001) != 0x00020000) {
+               if((signed)(end - jiffies) <= 0) {
+                       DRM_ERROR("irqs: %d wanted %d\n", 
+                                 atomic_read(&dev->total_irq), 
+                                 atomic_read(&dma->total_lost));
+                       DRM_ERROR("lockup\n"); 
+                       goto out_status;
+               }
+               for (i = 0 ; i < 2000 ; i++) mga_delay();         
+       }
+       sarea_priv->dirty |= MGA_DMA_FLUSH;
+
+out_status:
+       clear_bit(MGA_IN_DISPATCH, &dev_priv->dispatch_status);
+out_nolock:
+}
+
+static void mga_reset_freelist(drm_device_t *dev)
+{
+       drm_device_dma_t  *dma      = dev->dma;
+       drm_buf_t *buf;
+       drm_mga_buf_priv_t *buf_priv;
+       int i;
+
+       for (i = 0; i < dma->buf_count; i++) {
+               buf = dma->buflist[ i ];
+               buf_priv = buf->dev_private;
+               buf_priv->my_freelist->age = MGA_BUF_FREE;
+       }
+}
+
+/* Least recently used :
+ * These operations are not atomic b/c they are protected by the 
+ * hardware lock */
+
+drm_buf_t *mga_freelist_get(drm_device_t *dev)
+{
+       DECLARE_WAITQUEUE(entry, current);
+       drm_mga_private_t *dev_priv = 
+               (drm_mga_private_t *) dev->dev_private;
+       drm_mga_freelist_t *prev;
+       drm_mga_freelist_t *next;
+       static int failed = 0;
+
+       DRM_DEBUG("%s : tail->age : %d last_prim_age : %d\n", __FUNCTION__,
+              dev_priv->tail->age, dev_priv->last_prim_age);
+   
+       if(failed >= 1000 && dev_priv->tail->age >= dev_priv->last_prim_age) {
+               DRM_DEBUG("I'm waiting on the freelist!!! %d\n", 
+                      dev_priv->last_prim_age);
+               set_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status);
+               current->state = TASK_INTERRUPTIBLE;
+               add_wait_queue(&dev_priv->buf_queue, &entry);
+               for (;;) {
+                       mga_dma_schedule(dev, 0);
+                       if(!test_bit(MGA_IN_GETBUF, 
+                                    &dev_priv->dispatch_status)) 
+                               break;
+                       atomic_inc(&dev->total_sleeps);
+                       schedule();
+                       if (signal_pending(current)) {
+                               clear_bit(MGA_IN_GETBUF,
+                                         &dev_priv->dispatch_status);
+                               goto failed_getbuf;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev_priv->buf_queue, &entry);
+       }
+   
+       if(dev_priv->tail->age < dev_priv->last_prim_age) {
+               prev = dev_priv->tail->prev;
+               next = dev_priv->tail;
+               prev->next = NULL;
+               next->prev = next->next = NULL;
+               dev_priv->tail = prev;
+               next->age = MGA_BUF_USED;
+               failed = 0;
+               return next->buf;
+       }
+
+failed_getbuf:
+       failed++;
+       return NULL;
+}
+
+int mga_freelist_put(drm_device_t *dev, drm_buf_t *buf)
+{
+       drm_mga_private_t *dev_priv = 
+               (drm_mga_private_t *) dev->dev_private;
+       drm_mga_buf_priv_t *buf_priv = buf->dev_private;
+       drm_mga_freelist_t *prev;
+       drm_mga_freelist_t *head;
+       drm_mga_freelist_t *next;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(buf_priv->my_freelist->age == MGA_BUF_USED) {
+               /* Discarded buffer, put it on the tail */
+               next = buf_priv->my_freelist;
+               next->age = MGA_BUF_FREE;
+               prev = dev_priv->tail;
+               prev->next = next;
+               next->prev = prev;
+               next->next = NULL;
+               dev_priv->tail = next;
+               DRM_DEBUG("Discarded\n");
+       } else {
+               /* Normally aged buffer, put it on the head + 1,
+                * as the real head is a sentinal element
+                */
+               next = buf_priv->my_freelist;
+               head = dev_priv->head;
+               prev = head->next;
+               head->next = next;
+               prev->prev = next;
+               next->prev = head;
+               next->next = prev;
+       }
+   
+       return 0;
+}
+
+static int mga_init_primary_bufs(drm_device_t *dev, drm_mga_init_t *init)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_prim_buf_t *prim_buffer;
+       int i, temp, size_of_buf;
+       int offset = init->reserved_map_agpstart;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       dev_priv->primary_size = ((init->primary_size + PAGE_SIZE - 1) / 
+                                 PAGE_SIZE) * PAGE_SIZE;
+       size_of_buf = dev_priv->primary_size / MGA_NUM_PRIM_BUFS;
+       dev_priv->warp_ucode_size = init->warp_ucode_size;
+       dev_priv->prim_bufs = drm_alloc(sizeof(drm_mga_prim_buf_t *) * 
+                                       (MGA_NUM_PRIM_BUFS + 1), 
+                                       DRM_MEM_DRIVER);
+       if(dev_priv->prim_bufs == NULL) {
+               DRM_ERROR("Unable to allocate memory for prim_buf\n");
+               return -ENOMEM;
+       }
+       memset(dev_priv->prim_bufs, 
+              0, sizeof(drm_mga_prim_buf_t *) * (MGA_NUM_PRIM_BUFS + 1));
+   
+       temp = init->warp_ucode_size + dev_priv->primary_size;
+       temp = ((temp + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
+          
+       dev_priv->ioremap = drm_ioremap(dev->agp->base + offset, 
+                                       temp);
+       if(dev_priv->ioremap == NULL) {
+               DRM_DEBUG("Ioremap failed\n");
+               return -ENOMEM;
+       }
+       init_waitqueue_head(&dev_priv->wait_queue);
+   
+       for(i = 0; i < MGA_NUM_PRIM_BUFS; i++) {
+               prim_buffer = drm_alloc(sizeof(drm_mga_prim_buf_t), 
+                                       DRM_MEM_DRIVER);
+               if(prim_buffer == NULL) return -ENOMEM;
+               memset(prim_buffer, 0, sizeof(drm_mga_prim_buf_t));
+               prim_buffer->phys_head = offset + dev->agp->base;
+               prim_buffer->current_dma_ptr = 
+                       prim_buffer->head = 
+                       (u32 *) (dev_priv->ioremap + 
+                                offset - 
+                                init->reserved_map_agpstart);
+               prim_buffer->num_dwords = 0;
+               prim_buffer->max_dwords = size_of_buf / sizeof(u32);
+               prim_buffer->max_dwords -= 5; /* Leave room for the softrap */
+               prim_buffer->sec_used = 0;
+               prim_buffer->idx = i;
+               prim_buffer->prim_age = i + 1;
+               offset = offset + size_of_buf;
+               dev_priv->prim_bufs[i] = prim_buffer;
+       }
+       dev_priv->current_prim_idx = 0;
+        dev_priv->next_prim = 
+               dev_priv->last_prim = 
+               dev_priv->current_prim =
+               dev_priv->prim_bufs[0];
+       dev_priv->next_prim_age = 2;    
+       dev_priv->last_prim_age = 1;
+       set_bit(MGA_BUF_IN_USE, &dev_priv->current_prim->buffer_status);
+       return 0;
+}
+
+void mga_fire_primary(drm_device_t *dev, drm_mga_prim_buf_t *prim)
+{
+               drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_device_dma_t  *dma      = dev->dma;
+               drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       int use_agp = PDEA_pagpxfer_enable;
+       unsigned long end;
+       int i;
+       int next_idx;
+               PRIMLOCALS;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       dev_priv->last_prim = prim;
+   
+       /* We never check for overflow, b/c there is always room */
+       PRIMPTR(prim);
+       if(num_dwords <= 0) {
+               DRM_DEBUG("num_dwords == 0 when dispatched\n");
+               goto out_prim_wait;
+       }
+       PRIMOUTREG( MGAREG_DMAPAD, 0);
+       PRIMOUTREG( MGAREG_DMAPAD, 0);
+               PRIMOUTREG( MGAREG_DMAPAD, 0);
+       PRIMOUTREG( MGAREG_SOFTRAP, 0);
+       PRIMFINISH(prim);
+
+       end = jiffies + (HZ*3);
+       if(sarea_priv->dirty & MGA_DMA_FLUSH) {
+               DRM_DEBUG("Dma top flush\n");      
+               while((MGA_READ(MGAREG_STATUS) & 0x00030001) != 0x00020000) {
+                       if((signed)(end - jiffies) <= 0) {
+                               DRM_ERROR("irqs: %d wanted %d\n", 
+                                         atomic_read(&dev->total_irq), 
+                                         atomic_read(&dma->total_lost));
+                               DRM_ERROR("lockup in fire primary "
+                                         "(Dma Top Flush)\n");
+                               goto out_prim_wait;
+                       }
+             
+                       for (i = 0 ; i < 4096 ; i++) mga_delay();
+               }
+               sarea_priv->dirty &= ~(MGA_DMA_FLUSH);
+       } else {
+               DRM_DEBUG("Status wait\n");
+               while((MGA_READ(MGAREG_STATUS) & 0x00020001) != 0x00020000) {
+                       if((signed)(end - jiffies) <= 0) {
+                               DRM_ERROR("irqs: %d wanted %d\n", 
+                                         atomic_read(&dev->total_irq), 
+                                         atomic_read(&dma->total_lost));
+                               DRM_ERROR("lockup in fire primary "
+                                         "(Status Wait)\n");
+                               goto out_prim_wait;
+                       }
+          
+                       for (i = 0 ; i < 4096 ; i++) mga_delay();
+               }
+       }
+
+       mga_flush_write_combine();
+       atomic_inc(&dev_priv->pending_bufs);
+               MGA_WRITE(MGAREG_PRIMADDRESS, phys_head | TT_GENERAL);
+       MGA_WRITE(MGAREG_PRIMEND, (phys_head + num_dwords * 4) | use_agp);
+       prim->num_dwords = 0;
+       sarea_priv->last_enqueue = prim->prim_age;
+    
+       next_idx = prim->idx + 1;
+       if(next_idx >= MGA_NUM_PRIM_BUFS) 
+               next_idx = 0;
+
+       dev_priv->next_prim = dev_priv->prim_bufs[next_idx];
+       return;
+
+ out_prim_wait:
+       prim->num_dwords = 0;
+       prim->sec_used = 0;
+       clear_bit(MGA_BUF_IN_USE, &prim->buffer_status);
+       wake_up_interruptible(&dev_priv->wait_queue);
+       clear_bit(MGA_BUF_SWAP_PENDING, &prim->buffer_status);
+       clear_bit(MGA_IN_DISPATCH, &dev_priv->dispatch_status);
+}
+
+int mga_advance_primary(drm_device_t *dev)
+{
+       DECLARE_WAITQUEUE(entry, current);
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_prim_buf_t *prim_buffer;
+       drm_device_dma_t  *dma      = dev->dma;
+       int next_prim_idx;
+       int ret = 0;
+   
+       /* This needs to reset the primary buffer if available,
+        * we should collect stats on how many times it bites
+        * it's tail */
+       DRM_DEBUG("%s\n", __FUNCTION__);
+   
+       next_prim_idx = dev_priv->current_prim_idx + 1;
+       if(next_prim_idx >= MGA_NUM_PRIM_BUFS)
+               next_prim_idx = 0;
+       prim_buffer = dev_priv->prim_bufs[next_prim_idx];
+       set_bit(MGA_IN_WAIT, &dev_priv->dispatch_status);
+   
+       /* In use is cleared in interrupt handler */
+   
+       if(test_and_set_bit(MGA_BUF_IN_USE, &prim_buffer->buffer_status)) {
+               add_wait_queue(&dev_priv->wait_queue, &entry);
+               current->state = TASK_INTERRUPTIBLE;
+
+               for (;;) {
+                       mga_dma_schedule(dev, 0);
+                       if(!test_and_set_bit(MGA_BUF_IN_USE, 
+                                            &prim_buffer->buffer_status)) 
+                               break;
+                       atomic_inc(&dev->total_sleeps);
+                       atomic_inc(&dma->total_missed_sched);
+                       schedule();
+                       if (signal_pending(current)) {
+                               ret = -ERESTARTSYS;
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev_priv->wait_queue, &entry);
+               if(ret) return ret;
+       }
+       clear_bit(MGA_IN_WAIT, &dev_priv->dispatch_status);
+
+       /* This primary buffer is now free to use */
+       prim_buffer->current_dma_ptr = prim_buffer->head;
+       prim_buffer->num_dwords = 0;
+       prim_buffer->sec_used = 0;
+       prim_buffer->prim_age = dev_priv->next_prim_age++;
+       if(prim_buffer->prim_age == 0 || prim_buffer->prim_age == 0xffffffff) {
+          mga_flush_queue(dev);
+          mga_dma_quiescent(dev);
+          mga_reset_freelist(dev);
+          prim_buffer->prim_age = (dev_priv->next_prim_age += 2);
+       }
+
+       /* Reset all buffer status stuff */
+       clear_bit(MGA_BUF_NEEDS_OVERFLOW, &prim_buffer->buffer_status);
+       clear_bit(MGA_BUF_FORCE_FIRE, &prim_buffer->buffer_status);
+       clear_bit(MGA_BUF_SWAP_PENDING, &prim_buffer->buffer_status);
+
+       dev_priv->current_prim = prim_buffer;
+       dev_priv->current_prim_idx = next_prim_idx;
+       return 0;
+}
+
+/* More dynamic performance decisions */
+static inline int mga_decide_to_fire(drm_device_t *dev)
+{
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_device_dma_t  *dma      = dev->dma;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(test_bit(MGA_BUF_FORCE_FIRE, &dev_priv->next_prim->buffer_status)) {
+               atomic_inc(&dma->total_prio);
+               return 1;
+       }
+
+       if (test_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status) &&
+           dev_priv->next_prim->num_dwords) {
+               atomic_inc(&dma->total_prio);
+               return 1;
+       }
+
+       if (test_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status) &&
+           dev_priv->next_prim->num_dwords) {
+               atomic_inc(&dma->total_prio);
+               return 1;
+       }
+   
+       if(atomic_read(&dev_priv->pending_bufs) <= MGA_NUM_PRIM_BUFS - 1) {
+               if(test_bit(MGA_BUF_SWAP_PENDING, 
+                           &dev_priv->next_prim->buffer_status)) {
+                       atomic_inc(&dma->total_dmas);
+                       return 1;
+               }
+       }
+
+       if(atomic_read(&dev_priv->pending_bufs) <= MGA_NUM_PRIM_BUFS / 2) {
+               if(dev_priv->next_prim->sec_used >= MGA_DMA_BUF_NR / 8) {
+                       atomic_inc(&dma->total_hit);
+                       return 1;
+               }
+       }
+
+       if(atomic_read(&dev_priv->pending_bufs) >= MGA_NUM_PRIM_BUFS / 2) {
+               if(dev_priv->next_prim->sec_used >= MGA_DMA_BUF_NR / 4) {
+                       atomic_inc(&dma->total_missed_free);
+                       return 1;
+               }
+       }
+
+       atomic_inc(&dma->total_tried);
+       return 0;
+}
+
+int mga_dma_schedule(drm_device_t *dev, int locked)
+{
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_device_dma_t  *dma      = dev->dma;
+       int retval = 0;
+
+       if (test_and_set_bit(0, &dev->dma_flag)) {
+               atomic_inc(&dma->total_missed_dma);
+               retval = -EBUSY;
+               goto sch_out_wakeup;
+       }
+   
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(test_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status) || 
+          test_bit(MGA_IN_WAIT, &dev_priv->dispatch_status) ||
+          test_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status)) {
+               locked = 1;
+       }
+   
+       if (!locked && 
+           !drm_lock_take(&dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT)) {
+               atomic_inc(&dma->total_missed_lock);
+               clear_bit(0, &dev->dma_flag);
+               DRM_DEBUG("Not locked\n");
+               retval = -EBUSY;
+               goto sch_out_wakeup;
+       }
+       DRM_DEBUG("I'm locked\n");
+
+       if(!test_and_set_bit(MGA_IN_DISPATCH, &dev_priv->dispatch_status)) {
+               /* Fire dma buffer */
+               if(mga_decide_to_fire(dev)) {
+                       DRM_DEBUG("idx :%d\n", dev_priv->next_prim->idx);
+                       clear_bit(MGA_BUF_FORCE_FIRE, 
+                                 &dev_priv->next_prim->buffer_status);
+                       if(dev_priv->current_prim == dev_priv->next_prim) {
+                               /* Schedule overflow for a later time */
+                               set_bit(MGA_BUF_NEEDS_OVERFLOW,
+                                       &dev_priv->next_prim->buffer_status);
+                       }
+                       mga_fire_primary(dev, dev_priv->next_prim);
+               } else {
+                       clear_bit(MGA_IN_DISPATCH, &dev_priv->dispatch_status);
+               }
+       } else {
+               DRM_DEBUG("I can't get the dispatch lock\n");
+       }
+       
+       if (!locked) {
+               if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                                 DRM_KERNEL_CONTEXT)) {
+                       DRM_ERROR("\n");
+               }
+       }
+
+sch_out_wakeup:
+       if(test_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status) &&
+          atomic_read(&dev_priv->pending_bufs) == 0) {
+               /* Everything has been processed by the hardware */
+               clear_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status);
+               wake_up_interruptible(&dev_priv->flush_queue);
+       }
+
+       if(test_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status) &&
+          dev_priv->tail->age < dev_priv->last_prim_age) {
+               clear_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status);
+               DRM_DEBUG("Waking up buf queue\n");
+               wake_up_interruptible(&dev_priv->buf_queue);
+       } else if (test_bit(MGA_IN_GETBUF, &dev_priv->dispatch_status)) {
+               DRM_DEBUG("Not waking buf_queue on %d %d\n", 
+                         atomic_read(&dev->total_irq), 
+                         dev_priv->last_prim_age);
+       }
+
+       clear_bit(0, &dev->dma_flag);
+       return retval;
+}
+
+static void mga_dma_service(int irq, void *device, struct pt_regs *regs)
+{
+       drm_device_t     *dev = (drm_device_t *)device;
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       drm_mga_prim_buf_t *last_prim_buffer;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       atomic_inc(&dev->total_irq);
+       if((MGA_READ(MGAREG_STATUS) & 0x00000001) != 0x00000001) return;
+       MGA_WRITE(MGAREG_ICLEAR, 0x00000001);
+       last_prim_buffer = dev_priv->last_prim;
+       last_prim_buffer->num_dwords = 0;
+       last_prim_buffer->sec_used = 0;
+       dev_priv->sarea_priv->last_dispatch = 
+               dev_priv->last_prim_age = last_prim_buffer->prim_age;
+       clear_bit(MGA_BUF_IN_USE, &last_prim_buffer->buffer_status);
+       wake_up_interruptible(&dev_priv->wait_queue);
+       clear_bit(MGA_BUF_SWAP_PENDING, &last_prim_buffer->buffer_status);
+       clear_bit(MGA_IN_DISPATCH, &dev_priv->dispatch_status);
+       atomic_dec(&dev_priv->pending_bufs);
+       queue_task(&dev->tq, &tq_immediate);
+       mark_bh(IMMEDIATE_BH);
+}
+
+static void mga_dma_task_queue(void *device)
+{
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       mga_dma_schedule((drm_device_t *)device, 0);
+}
+
+int mga_dma_cleanup(drm_device_t *dev)
+{
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(dev->dev_private) {
+               drm_mga_private_t *dev_priv = 
+                       (drm_mga_private_t *) dev->dev_private;
+      
+               if(dev_priv->ioremap) {
+                       int temp = (dev_priv->warp_ucode_size + 
+                                   dev_priv->primary_size + 
+                                   PAGE_SIZE - 1) / PAGE_SIZE * PAGE_SIZE;
+
+                       drm_ioremapfree((void *) dev_priv->ioremap, temp);
+               }
+               if(dev_priv->status_page != NULL) {
+                       iounmap(dev_priv->status_page);
+               }
+               if(dev_priv->real_status_page != 0UL) {
+                       mga_free_page(dev, dev_priv->real_status_page);
+               }
+               if(dev_priv->prim_bufs != NULL) {
+                       int i;
+                       for(i = 0; i < MGA_NUM_PRIM_BUFS; i++) {
+                               if(dev_priv->prim_bufs[i] != NULL) {
+                                       drm_free(dev_priv->prim_bufs[i],
+                                                sizeof(drm_mga_prim_buf_t),
+                                                DRM_MEM_DRIVER);
+                               }
+                       }
+                       drm_free(dev_priv->prim_bufs, sizeof(void *) *
+                                (MGA_NUM_PRIM_BUFS + 1), 
+                                DRM_MEM_DRIVER);
+               }
+               if(dev_priv->head != NULL) {
+                       mga_freelist_cleanup(dev);
+               }
+
+
+               drm_free(dev->dev_private, sizeof(drm_mga_private_t), 
+                        DRM_MEM_DRIVER);
+               dev->dev_private = NULL;
+       }
+
+       return 0;
+}
+
+static int mga_dma_initialize(drm_device_t *dev, drm_mga_init_t *init) {
+       drm_mga_private_t *dev_priv;
+       drm_map_t *sarea_map = NULL;
+       int i;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       dev_priv = drm_alloc(sizeof(drm_mga_private_t), DRM_MEM_DRIVER);
+       if(dev_priv == NULL) return -ENOMEM;
+       dev->dev_private = (void *) dev_priv;
+
+       memset(dev_priv, 0, sizeof(drm_mga_private_t));
+
+       if((init->reserved_map_idx >= dev->map_count) ||
+          (init->buffer_map_idx >= dev->map_count)) {
+               mga_dma_cleanup(dev);
+               DRM_DEBUG("reserved_map or buffer_map are invalid\n");
+               return -EINVAL;
+       }
+   
+       dev_priv->reserved_map_idx = init->reserved_map_idx;
+       dev_priv->buffer_map_idx = init->buffer_map_idx;
+       sarea_map = dev->maplist[0];
+       dev_priv->sarea_priv = (drm_mga_sarea_t *) 
+               ((u8 *)sarea_map->handle + 
+                init->sarea_priv_offset);
+
+       /* Scale primary size to the next page */
+       dev_priv->chipset = init->chipset;
+       dev_priv->frontOffset = init->frontOffset;
+       dev_priv->backOffset = init->backOffset;
+       dev_priv->depthOffset = init->depthOffset;
+       dev_priv->textureOffset = init->textureOffset;
+       dev_priv->textureSize = init->textureSize;
+       dev_priv->cpp = init->cpp;
+       dev_priv->sgram = init->sgram;
+       dev_priv->stride = init->stride;
+
+       dev_priv->mAccess = init->mAccess;
+       init_waitqueue_head(&dev_priv->flush_queue);
+       init_waitqueue_head(&dev_priv->buf_queue);
+       dev_priv->WarpPipe = -1;
+
+       DRM_DEBUG("chipset: %d ucode_size: %d backOffset: %x depthOffset: %x\n",
+                 dev_priv->chipset, dev_priv->warp_ucode_size, 
+                 dev_priv->backOffset, dev_priv->depthOffset);
+       DRM_DEBUG("cpp: %d sgram: %d stride: %d maccess: %x\n",
+                 dev_priv->cpp, dev_priv->sgram, dev_priv->stride, 
+                 dev_priv->mAccess);
+   
+       memcpy(&dev_priv->WarpIndex, &init->WarpIndex, 
+              sizeof(drm_mga_warp_index_t) * MGA_MAX_WARP_PIPES);
+
+       for (i = 0 ; i < MGA_MAX_WARP_PIPES ; i++) 
+               DRM_DEBUG("warp pipe %d: installed: %d phys: %lx size: %x\n",
+                         i, 
+                         dev_priv->WarpIndex[i].installed,
+                         dev_priv->WarpIndex[i].phys_addr,
+                         dev_priv->WarpIndex[i].size);
+
+       if(mga_init_primary_bufs(dev, init) != 0) {
+               DRM_ERROR("Can not initialize primary buffers\n");
+               mga_dma_cleanup(dev);
+               return -ENOMEM;
+       }
+       dev_priv->real_status_page = mga_alloc_page(dev);
+       if(dev_priv->real_status_page == 0UL) {
+               mga_dma_cleanup(dev);
+               DRM_ERROR("Can not allocate status page\n");
+               return -ENOMEM;
+       }
+
+       dev_priv->status_page = 
+               ioremap_nocache(virt_to_bus((void *)dev_priv->real_status_page),
+                               PAGE_SIZE);
+
+       if(dev_priv->status_page == NULL) {
+               mga_dma_cleanup(dev);
+               DRM_ERROR("Can not remap status page\n");
+               return -ENOMEM;
+       }
+
+       /* Write status page when secend or softrap occurs */
+       MGA_WRITE(MGAREG_PRIMPTR, 
+                 virt_to_bus((void *)dev_priv->real_status_page) | 0x00000003);
+      
+
+       /* Private is now filled in, initialize the hardware */
+       {
+               PRIMLOCALS;
+               PRIMGETPTR( dev_priv );
+                  
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DWGSYNC, 0x0100);
+               PRIMOUTREG(MGAREG_SOFTRAP, 0);
+               /* Poll for the first buffer to insure that
+                * the status register will be correct
+                */
+          
+               mga_flush_write_combine();
+               MGA_WRITE(MGAREG_PRIMADDRESS, phys_head | TT_GENERAL);
+
+               MGA_WRITE(MGAREG_PRIMEND, ((phys_head + num_dwords * 4) | 
+                                          PDEA_pagpxfer_enable));
+          
+               while(MGA_READ(MGAREG_DWGSYNC) != 0x0100) ;
+       }
+
+       if(mga_freelist_init(dev) != 0) {
+               DRM_ERROR("Could not initialize freelist\n");
+               mga_dma_cleanup(dev);
+               return -ENOMEM;
+       }
+       return 0;
+}
+
+int mga_dma_init(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_mga_init_t init;
+   
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       copy_from_user_ret(&init, (drm_mga_init_t *)arg, sizeof(init), -EFAULT);
+   
+       switch(init.func) {
+       case MGA_INIT_DMA:
+               return mga_dma_initialize(dev, &init);
+       case MGA_CLEANUP_DMA:
+               return mga_dma_cleanup(dev);
+       }
+
+       return -EINVAL;
+}
+
+int mga_irq_install(drm_device_t *dev, int irq)
+{
+       int retcode;
+
+       if (!irq)     return -EINVAL;
+       
+       down(&dev->struct_sem);
+       if (dev->irq) {
+               up(&dev->struct_sem);
+               return -EBUSY;
+       }
+       dev->irq = irq;
+       up(&dev->struct_sem);
+       
+       DRM_DEBUG("install irq handler %d\n", 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;
+       dev->tq.next          = NULL;
+       dev->tq.sync          = 0;
+       dev->tq.routine       = mga_dma_task_queue;
+       dev->tq.data          = dev;
+
+                               /* Before installing handler */
+       MGA_WRITE(MGAREG_IEN, 0);
+                               /* Install handler */
+       if ((retcode = request_irq(dev->irq,
+                                  mga_dma_service,
+                                  SA_SHIRQ,
+                                  dev->devname,
+                                  dev))) {
+               down(&dev->struct_sem);
+               dev->irq = 0;
+               up(&dev->struct_sem);
+               return retcode;
+       }
+                               /* After installing handler */
+       MGA_WRITE(MGAREG_ICLEAR, 0x00000001);
+       MGA_WRITE(MGAREG_IEN, 0x00000001);
+       return 0;
+}
+
+int mga_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("remove irq handler %d\n", irq);
+       MGA_WRITE(MGAREG_ICLEAR, 0x00000001);
+       MGA_WRITE(MGAREG_IEN, 0);
+       free_irq(irq, dev);
+       return 0;
+}
+
+int mga_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;
+   
+       copy_from_user_ret(&ctl, (drm_control_t *)arg, sizeof(ctl), -EFAULT);
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       switch (ctl.func) {
+       case DRM_INST_HANDLER:
+               return mga_irq_install(dev, ctl.irq);
+       case DRM_UNINST_HANDLER:
+               return mga_irq_uninstall(dev);
+       default:
+               return -EINVAL;
+       }
+}
+
+static int mga_flush_queue(drm_device_t *dev)
+{
+       DECLARE_WAITQUEUE(entry, current);
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+       int ret = 0;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if(dev_priv == NULL) {
+               return 0;
+       }
+   
+       if(dev_priv->next_prim->num_dwords != 0) {
+               current->state = TASK_INTERRUPTIBLE;
+               add_wait_queue(&dev_priv->flush_queue, &entry);
+               set_bit(MGA_IN_FLUSH, &dev_priv->dispatch_status);
+               mga_dma_schedule(dev, 0);
+               for (;;) {
+                       if (!test_bit(MGA_IN_FLUSH, 
+                                     &dev_priv->dispatch_status)) 
+                               break;
+                       atomic_inc(&dev->total_sleeps);
+                       schedule();
+                       if (signal_pending(current)) {
+                               ret = -EINTR; /* Can't restart */
+                               clear_bit(MGA_IN_FLUSH, 
+                                         &dev_priv->dispatch_status);
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev_priv->flush_queue, &entry);
+       }
+       return ret;
+}
+
+/* Must be called with the lock held */
+void mga_reclaim_buffers(drm_device_t *dev, pid_t pid)
+{
+       drm_device_dma_t *dma = dev->dma;
+       int              i;
+
+       if (!dma) return;
+       if(dev->dev_private == NULL) return;
+       if(dma->buflist == NULL) return;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+        mga_flush_queue(dev);
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t *buf = dma->buflist[ i ];
+               drm_mga_buf_priv_t *buf_priv = buf->dev_private;
+
+               /* Only buffers that need to get reclaimed ever 
+                * get set to free 
+                */
+               if (buf->pid == pid  && buf_priv) {
+                       if(buf_priv->my_freelist->age == MGA_BUF_USED) 
+                               buf_priv->my_freelist->age = MGA_BUF_FREE;
+               }
+       }
+}
+
+int mga_lock(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;
+       DECLARE_WAITQUEUE(entry, current);
+       int               ret   = 0;
+       drm_lock_t        lock;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+
+       if (lock.context == DRM_KERNEL_CONTEXT) {
+               DRM_ERROR("Process %d using kernel context %d\n",
+                         current->pid, lock.context);
+               return -EINVAL;
+       }
+   
+       DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
+              lock.context, current->pid, dev->lock.hw_lock->lock,
+              lock.flags);
+
+       if (lock.context < 0) {
+               return -EINVAL;
+       }
+   
+       /* Only one queue:
+        */
+
+       if (!ret) {
+               add_wait_queue(&dev->lock.lock_queue, &entry);
+               for (;;) {
+                       if (!dev->lock.hw_lock) {
+                               /* Device has been unregistered */
+                               ret = -EINTR;
+                               break;
+                       }
+                       if (drm_lock_take(&dev->lock.hw_lock->lock,
+                                         lock.context)) {
+                               dev->lock.pid       = current->pid;
+                               dev->lock.lock_time = jiffies;
+                               atomic_inc(&dev->total_locks);
+                               break;  /* Got lock */
+                       }
+                       
+                               /* Contention */
+                       atomic_inc(&dev->total_sleeps);
+                       current->state = TASK_INTERRUPTIBLE;
+                       schedule();
+                       if (signal_pending(current)) {
+                               ret = -ERESTARTSYS;
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev->lock.lock_queue, &entry);
+       }
+       
+       if (!ret) {
+               if (lock.flags & _DRM_LOCK_QUIESCENT) {
+                  DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
+                  mga_flush_queue(dev);
+                  mga_dma_quiescent(dev);
+               }
+       }
+   
+       DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
+       return ret;
+}
+               
+int mga_flush_ioctl(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_lock_t        lock;
+       drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+
+       if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_flush_ioctl called without lock held\n");
+               return -EINVAL;
+       }
+
+       if(lock.flags & _DRM_LOCK_FLUSH || lock.flags & _DRM_LOCK_FLUSH_ALL) {
+               drm_mga_prim_buf_t *temp_buf;
+
+               temp_buf = dev_priv->current_prim;
+
+               if(temp_buf && temp_buf->num_dwords) {
+                       set_bit(MGA_BUF_FORCE_FIRE, &temp_buf->buffer_status);
+                       mga_advance_primary(dev);
+               }
+               mga_dma_schedule(dev, 1);
+       }
+       if(lock.flags & _DRM_LOCK_QUIESCENT) {
+               mga_flush_queue(dev);
+               mga_dma_quiescent(dev);
+       }
+
+       return 0;
+}
diff --git a/drivers/char/drm/mga_drm.h b/drivers/char/drm/mga_drm.h
new file mode 100644 (file)
index 0000000..e75e91a
--- /dev/null
@@ -0,0 +1,269 @@
+/* mga_drm.h -- Public header for the Matrox g200/g400 driver -*- linux-c -*-
+ * Created: Tue Jan 25 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Jeff Hartmann <jhartmann@valinux.com>
+ *          Keith Whitwell <keithw@valinux.com>
+ *
+ */
+
+#ifndef _MGA_DRM_H_
+#define _MGA_DRM_H_
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (xf86drmMga.h)
+ */
+#ifndef _MGA_DEFINES_
+#define _MGA_DEFINES_
+
+#define MGA_F  0x1             /* fog */
+#define MGA_A  0x2             /* alpha */
+#define MGA_S  0x4             /* specular */
+#define MGA_T2 0x8             /* multitexture */
+
+#define MGA_WARP_TGZ            0
+#define MGA_WARP_TGZF           (MGA_F)
+#define MGA_WARP_TGZA           (MGA_A)
+#define MGA_WARP_TGZAF          (MGA_F|MGA_A)
+#define MGA_WARP_TGZS           (MGA_S)
+#define MGA_WARP_TGZSF          (MGA_S|MGA_F)
+#define MGA_WARP_TGZSA          (MGA_S|MGA_A)
+#define MGA_WARP_TGZSAF         (MGA_S|MGA_F|MGA_A)
+#define MGA_WARP_T2GZ           (MGA_T2)
+#define MGA_WARP_T2GZF          (MGA_T2|MGA_F)
+#define MGA_WARP_T2GZA          (MGA_T2|MGA_A)
+#define MGA_WARP_T2GZAF         (MGA_T2|MGA_A|MGA_F)
+#define MGA_WARP_T2GZS          (MGA_T2|MGA_S)
+#define MGA_WARP_T2GZSF         (MGA_T2|MGA_S|MGA_F)
+#define MGA_WARP_T2GZSA         (MGA_T2|MGA_S|MGA_A)
+#define MGA_WARP_T2GZSAF        (MGA_T2|MGA_S|MGA_F|MGA_A)
+
+#define MGA_MAX_G400_PIPES 16
+#define MGA_MAX_G200_PIPES  8  /* no multitex */
+#define MGA_MAX_WARP_PIPES MGA_MAX_G400_PIPES
+
+#define MGA_CARD_TYPE_G200 1
+#define MGA_CARD_TYPE_G400 2
+
+#define MGA_FRONT   0x1
+#define MGA_BACK    0x2
+#define MGA_DEPTH   0x4
+
+/* 3d state excluding texture units:
+ */
+#define MGA_CTXREG_DSTORG   0  /* validated */
+#define MGA_CTXREG_MACCESS  1  
+#define MGA_CTXREG_PLNWT    2  
+#define MGA_CTXREG_DWGCTL    3 
+#define MGA_CTXREG_ALPHACTRL 4
+#define MGA_CTXREG_FOGCOLOR  5
+#define MGA_CTXREG_WFLAG     6
+#define MGA_CTXREG_TDUAL0    7
+#define MGA_CTXREG_TDUAL1    8
+#define MGA_CTXREG_FCOL      9
+#define MGA_CTX_SETUP_SIZE   10
+
+/* 2d state
+ */
+#define MGA_2DREG_PITCH        0
+#define MGA_2D_SETUP_SIZE      1
+
+/* Each texture unit has a state:
+ */
+#define MGA_TEXREG_CTL        0
+#define MGA_TEXREG_CTL2       1
+#define MGA_TEXREG_FILTER     2
+#define MGA_TEXREG_BORDERCOL  3
+#define MGA_TEXREG_ORG        4 /* validated */
+#define MGA_TEXREG_ORG1       5
+#define MGA_TEXREG_ORG2       6
+#define MGA_TEXREG_ORG3       7
+#define MGA_TEXREG_ORG4       8
+#define MGA_TEXREG_WIDTH      9
+#define MGA_TEXREG_HEIGHT     10
+#define MGA_TEX_SETUP_SIZE    11
+
+/* What needs to be changed for the current vertex dma buffer?
+ */
+#define MGA_UPLOAD_CTX        0x1
+#define MGA_UPLOAD_TEX0       0x2
+#define MGA_UPLOAD_TEX1       0x4
+#define MGA_UPLOAD_PIPE       0x8
+#define MGA_UPLOAD_TEX0IMAGE  0x10 /* handled client-side */
+#define MGA_UPLOAD_TEX1IMAGE  0x20 /* handled client-side */
+#define MGA_UPLOAD_2D        0x40
+#define MGA_WAIT_AGE          0x80 /* handled client-side */
+#define MGA_UPLOAD_CLIPRECTS  0x100 /* handled client-side */
+#define MGA_DMA_FLUSH        0x200 /* set when someone gets the lock
+                                       quiescent */
+
+/* 32 buffers of 64k each, total 2 meg.
+ */
+#define MGA_DMA_BUF_ORDER     16
+#define MGA_DMA_BUF_SZ        (1<<MGA_DMA_BUF_ORDER)
+#define MGA_DMA_BUF_NR        31
+
+/* Keep these small for testing.
+ */
+#define MGA_NR_SAREA_CLIPRECTS 8
+
+/* 2 heaps (1 for card, 1 for agp), each divided into upto 128
+ * regions, subject to a minimum region size of (1<<16) == 64k. 
+ *
+ * Clients may subdivide regions internally, but when sharing between
+ * clients, the region size is the minimum granularity. 
+ */
+
+#define MGA_CARD_HEAP 0
+#define MGA_AGP_HEAP  1
+#define MGA_NR_TEX_HEAPS 2
+#define MGA_NR_TEX_REGIONS 16
+#define MGA_LOG_MIN_TEX_REGION_SIZE 16
+#endif
+
+typedef struct _drm_mga_warp_index {
+       int installed;
+       unsigned long phys_addr;
+       int size;
+} drm_mga_warp_index_t;
+
+typedef struct drm_mga_init {
+       enum { 
+               MGA_INIT_DMA = 0x01,
+               MGA_CLEANUP_DMA = 0x02
+       } func;
+       int reserved_map_agpstart;
+       int reserved_map_idx;
+       int buffer_map_idx;
+       int sarea_priv_offset;
+       int primary_size;
+       int warp_ucode_size;
+       unsigned int frontOffset;
+       unsigned int backOffset;
+       unsigned int depthOffset;
+       unsigned int textureOffset;
+       unsigned int textureSize;
+        unsigned int agpTextureOffset;
+        unsigned int agpTextureSize;
+       unsigned int cpp;
+       unsigned int stride;
+       int sgram;
+       int chipset;
+       drm_mga_warp_index_t WarpIndex[MGA_MAX_WARP_PIPES];
+       unsigned int mAccess;
+} drm_mga_init_t;
+
+/* Warning: if you change the sarea structure, you must change the Xserver
+ * structures as well */
+
+typedef struct _drm_mga_tex_region {
+       unsigned char next, prev;       
+       unsigned char in_use;   
+       unsigned int age;                       
+} drm_mga_tex_region_t;
+
+typedef struct _drm_mga_sarea {
+       /* The channel for communication of state information to the kernel
+        * on firing a vertex dma buffer.
+        */
+       unsigned int ContextState[MGA_CTX_SETUP_SIZE];
+       unsigned int ServerState[MGA_2D_SETUP_SIZE];
+       unsigned int TexState[2][MGA_TEX_SETUP_SIZE];
+       unsigned int WarpPipe;
+       unsigned int dirty;
+
+       unsigned int nbox;
+       drm_clip_rect_t boxes[MGA_NR_SAREA_CLIPRECTS];
+
+
+       /* Information about the most recently used 3d drawable.  The
+        * client fills in the req_* fields, the server fills in the 
+        * exported_ fields and puts the cliprects into boxes, above.
+        *
+        * The client clears the exported_drawable field before
+        * clobbering the boxes data.
+        */
+        unsigned int req_drawable;      /* the X drawable id */
+       unsigned int req_draw_buffer;    /* MGA_FRONT or MGA_BACK */
+
+        unsigned int exported_drawable;         
+       unsigned int exported_index; 
+        unsigned int exported_stamp;   
+        unsigned int exported_buffers;  
+        unsigned int exported_nfront;
+        unsigned int exported_nback;
+       int exported_back_x, exported_front_x, exported_w;      
+       int exported_back_y, exported_front_y, exported_h;
+       drm_clip_rect_t exported_boxes[MGA_NR_SAREA_CLIPRECTS];
+   
+       /* Counters for aging textures and for client-side throttling.
+        */
+        unsigned int last_enqueue;     /* last time a buffer was enqueued */
+       unsigned int last_dispatch;     /* age of the most recently dispatched buffer */
+       unsigned int last_quiescent;     /*  */
+
+
+       /* LRU lists for texture memory in agp space and on the card
+        */
+       drm_mga_tex_region_t texList[MGA_NR_TEX_HEAPS][MGA_NR_TEX_REGIONS+1];
+       unsigned int texAge[MGA_NR_TEX_HEAPS];
+       
+       /* Mechanism to validate card state.
+        */
+       int ctxOwner;
+} drm_mga_sarea_t;     
+
+/* Device specific ioctls:
+ */
+typedef struct _drm_mga_clear {
+       unsigned int clear_color;
+       unsigned int clear_depth;
+       unsigned int flags;
+} drm_mga_clear_t;
+
+typedef struct _drm_mga_swap {
+       int dummy;
+} drm_mga_swap_t;
+
+typedef struct _drm_mga_iload {
+       int idx;
+       int length;
+       unsigned int destOrg;
+} drm_mga_iload_t;
+
+typedef struct _drm_mga_vertex {
+       int idx;                /* buffer to queue */
+       int used;               /* bytes in use */
+       int discard;            /* client finished with buffer?  */
+} drm_mga_vertex_t;
+
+typedef struct _drm_mga_indices {
+       int idx;                /* buffer to queue */
+       unsigned int start;             
+       unsigned int end;               
+       int discard;            /* client finished with buffer?  */
+} drm_mga_indices_t;
+
+#endif
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c
new file mode 100644 (file)
index 0000000..30c8880
--- /dev/null
@@ -0,0 +1,654 @@
+/* mga_drv.c -- Matrox g200/g400 driver -*- linux-c -*-
+ * Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
+ * 
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ *
+ */
+
+#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
+#define EXPORT_SYMTAB
+#endif
+#include "drmP.h"
+#include "mga_drv.h"
+EXPORT_SYMBOL(mga_init);
+EXPORT_SYMBOL(mga_cleanup);
+
+#define MGA_NAME        "mga"
+#define MGA_DESC        "Matrox g200/g400"
+#define MGA_DATE        "20000719"
+#define MGA_MAJOR       1
+#define MGA_MINOR       0
+#define MGA_PATCHLEVEL  0
+
+static drm_device_t          mga_device;
+drm_ctx_t                    mga_res_ctx;
+
+static struct file_operations mga_fops = {
+#if LINUX_VERSION_CODE >= 0x020322
+                               /* This started being used approx. 2.3.34 */
+       owner:   THIS_MODULE,
+#endif
+       open:    mga_open,
+       flush:   drm_flush,
+       release: mga_release,
+       ioctl:   mga_ioctl,
+       mmap:    drm_mmap,
+       read:    drm_read,
+       fasync:  drm_fasync,
+       poll:    drm_poll,
+};
+
+static struct miscdevice      mga_misc = {
+       minor: MISC_DYNAMIC_MINOR,
+       name:  MGA_NAME,
+       fops:  &mga_fops,
+};
+
+static drm_ioctl_desc_t              mga_ioctls[] = {
+       [DRM_IOCTL_NR(DRM_IOCTL_VERSION)]     = { mga_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 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)]  = { drm_setunique,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)]       = { drm_block,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)]     = { drm_unblock,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)]     = { mga_control,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)]  = { drm_authmagic,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)]     = { drm_addmap,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)]    = { mga_addbufs,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MARK_BUFS)]   = { mga_markbufs,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)]   = { mga_infobufs,   1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)]    = { mga_mapbufs,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)]   = { mga_freebufs,   1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)]     = { mga_addctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)]      = { mga_rmctx,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)]     = { mga_modctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)]     = { mga_getctx,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)]  = { mga_switchctx,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)]     = { mga_newctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)]     = { mga_resctx,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)]    = { drm_adddraw,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)]     = { drm_rmdraw,     1, 1 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_DMA)]         = { mga_dma,        1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_LOCK)]        = { mga_lock,       1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)]      = { mga_unlock,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FINISH)]      = { drm_finish,     1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { drm_agp_acquire, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)]  = { drm_agp_enable,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)]    = { drm_agp_info,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)]   = { drm_agp_alloc,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)]    = { drm_agp_free,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)]    = { drm_agp_bind,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)]  = { drm_agp_unbind,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_INIT)]    = { mga_dma_init,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_SWAP)]    = { mga_swap_bufs,   1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_CLEAR)]   = { mga_clear_bufs,  1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_ILOAD)]   = { mga_iload,       1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_VERTEX)]  = { mga_vertex,      1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_FLUSH)]   = { mga_flush_ioctl, 1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MGA_INDICES)] = { mga_indices,     1, 0 },
+};
+
+#define MGA_IOCTL_COUNT DRM_ARRAY_SIZE(mga_ioctls)
+
+#ifdef MODULE
+static char                  *mga = NULL;
+#endif
+
+MODULE_AUTHOR("VA Linux Systems, Inc.");
+MODULE_DESCRIPTION("Matrox g200/g400");
+MODULE_PARM(mga, "s");
+
+module_init(mga_init);
+module_exit(mga_cleanup);
+
+#ifndef MODULE
+/* mga_options is called by the kernel to parse command-line options passed
+ * via the boot-loader (e.g., LILO).  It calls the insmod option routine,
+ * drm_parse_drm.
+ */
+
+static int __init mga_options(char *str)
+{
+       drm_parse_options(str);
+       return 1;
+}
+
+__setup("mga=", mga_options);
+#endif
+
+static int mga_setup(drm_device_t *dev)
+{
+       int i;
+       
+       atomic_set(&dev->ioctl_count, 0);
+       atomic_set(&dev->vma_count, 0);
+       dev->buf_use      = 0;
+       atomic_set(&dev->buf_alloc, 0);
+
+       drm_dma_setup(dev);
+
+       atomic_set(&dev->total_open, 0);
+       atomic_set(&dev->total_close, 0);
+       atomic_set(&dev->total_ioctl, 0);
+       atomic_set(&dev->total_irq, 0);
+       atomic_set(&dev->total_ctx, 0);
+       atomic_set(&dev->total_locks, 0);
+       atomic_set(&dev->total_unlocks, 0);
+       atomic_set(&dev->total_contends, 0);
+       atomic_set(&dev->total_sleeps, 0);
+
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               dev->magiclist[i].head = NULL;
+               dev->magiclist[i].tail = NULL;
+       }
+       dev->maplist        = NULL;
+       dev->map_count      = 0;
+       dev->vmalist        = NULL;
+       dev->lock.hw_lock   = NULL;
+       init_waitqueue_head(&dev->lock.lock_queue);
+       dev->queue_count    = 0;
+       dev->queue_reserved = 0;
+       dev->queue_slots    = 0;
+       dev->queuelist      = NULL;
+       dev->irq            = 0;
+       dev->context_flag   = 0;
+       dev->interrupt_flag = 0;
+       dev->dma_flag       = 0;
+       dev->last_context   = 0;
+       dev->last_switch    = 0;
+       dev->last_checked   = 0;
+       init_timer(&dev->timer);
+       init_waitqueue_head(&dev->context_wait);
+
+       dev->ctx_start      = 0;
+       dev->lck_start      = 0;
+       
+       dev->buf_rp       = dev->buf;
+       dev->buf_wp       = dev->buf;
+       dev->buf_end      = dev->buf + DRM_BSZ;
+       dev->buf_async    = NULL;
+       init_waitqueue_head(&dev->buf_readers);
+       init_waitqueue_head(&dev->buf_writers);
+                       
+       DRM_DEBUG("\n");
+                       
+       /* The kernel's context could be created here, but is now created
+          in drm_dma_enqueue.  This is more resource-efficient for
+          hardware that does not do DMA, but may mean that
+          drm_select_queue fails between the time the interrupt is
+          initialized and the time the queues are initialized. */
+                       
+       return 0;
+}
+
+
+static int mga_takedown(drm_device_t *dev)
+{
+       int               i;
+       drm_magic_entry_t *pt, *next;
+       drm_map_t         *map;
+       drm_vma_entry_t   *vma, *vma_next;
+
+       DRM_DEBUG("\n");
+
+       if (dev->irq) mga_irq_uninstall(dev);
+       
+       down(&dev->struct_sem);
+       del_timer(&dev->timer);
+       
+       if (dev->devname) {
+               drm_free(dev->devname, strlen(dev->devname)+1, DRM_MEM_DRIVER);
+               dev->devname = NULL;
+       }
+       
+       if (dev->unique) {
+               drm_free(dev->unique, strlen(dev->unique)+1, DRM_MEM_DRIVER);
+               dev->unique = NULL;
+               dev->unique_len = 0;
+       }
+                               /* Clear pid list */
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               for (pt = dev->magiclist[i].head; pt; pt = next) {
+                       next = pt->next;
+                       drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
+               }
+               dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
+       }
+                               /* Clear AGP information */
+       if (dev->agp) {
+               drm_agp_mem_t *entry;
+               drm_agp_mem_t *nexte;
+               
+                               /* Remove AGP resources, but leave dev->agp
+                                   intact until cleanup is called. */
+               for (entry = dev->agp->memory; entry; entry = nexte) {
+                       nexte = entry->next;
+                       if (entry->bound) drm_unbind_agp(entry->memory);
+                       drm_free_agp(entry->memory, entry->pages);
+                       drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+               }
+               dev->agp->memory = NULL;
+               
+               if (dev->agp->acquired && drm_agp.release)
+                       (*drm_agp.release)();
+               
+               dev->agp->acquired = 0;
+               dev->agp->enabled  = 0;
+       }
+                               /* Clear vma list (only built for debugging) */
+       if (dev->vmalist) {
+               for (vma = dev->vmalist; vma; vma = vma_next) {
+                       vma_next = vma->next;
+                       drm_free(vma, sizeof(*vma), DRM_MEM_VMAS);
+               }
+               dev->vmalist = NULL;
+       }
+       
+                               /* Clear map area and mtrr information */
+       if (dev->maplist) {
+               for (i = 0; i < dev->map_count; i++) {
+                       map = dev->maplist[i];
+                       switch (map->type) {
+                       case _DRM_REGISTERS:
+                       case _DRM_FRAME_BUFFER:
+#ifdef CONFIG_MTRR
+                               if (map->mtrr >= 0) {
+                                       int retcode;
+                                       retcode = mtrr_del(map->mtrr,
+                                                          map->offset,
+                                                          map->size);
+                                       DRM_DEBUG("mtrr_del = %d\n", retcode);
+                               }
+#endif
+                               drm_ioremapfree(map->handle, map->size);
+                               break;
+                       case _DRM_SHM:
+                               drm_free_pages((unsigned long)map->handle,
+                                              drm_order(map->size)
+                                              - PAGE_SHIFT,
+                                              DRM_MEM_SAREA);
+                               break;
+                       case _DRM_AGP:
+                               break;
+                       }
+                       drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+               }
+               drm_free(dev->maplist,
+                        dev->map_count * sizeof(*dev->maplist),
+                        DRM_MEM_MAPS);
+               dev->maplist   = NULL;
+               dev->map_count = 0;
+       }
+       
+       if (dev->queuelist) {
+               for (i = 0; i < dev->queue_count; i++) {
+                       drm_waitlist_destroy(&dev->queuelist[i]->waitlist);
+                       if (dev->queuelist[i]) {
+                               drm_free(dev->queuelist[i],
+                                        sizeof(*dev->queuelist[0]),
+                                        DRM_MEM_QUEUES);
+                               dev->queuelist[i] = NULL;
+                       }
+               }
+               drm_free(dev->queuelist,
+                        dev->queue_slots * sizeof(*dev->queuelist),
+                        DRM_MEM_QUEUES);
+               dev->queuelist   = NULL;
+       }
+
+       drm_dma_takedown(dev);
+
+       dev->queue_count     = 0;
+       if (dev->lock.hw_lock) {
+               dev->lock.hw_lock    = NULL; /* SHM removed */
+               dev->lock.pid        = 0;
+               wake_up_interruptible(&dev->lock.lock_queue);
+       }
+       up(&dev->struct_sem);
+       
+       return 0;
+}
+
+/* mga_init is called via init_module at module load time, or via
+ * linux/init/main.c (this is not currently supported). */
+
+int mga_init(void)
+{
+       int                   retcode;
+       drm_device_t          *dev = &mga_device;
+
+       DRM_DEBUG("\n");
+
+       memset((void *)dev, 0, sizeof(*dev));
+       dev->count_lock   = SPIN_LOCK_UNLOCKED;
+       sema_init(&dev->struct_sem, 1);
+       
+#ifdef MODULE
+       drm_parse_options(mga);
+#endif
+       DRM_DEBUG("doing misc_register\n");
+       if ((retcode = misc_register(&mga_misc))) {
+               DRM_ERROR("Cannot register \"%s\"\n", MGA_NAME);
+               return retcode;
+       }
+       dev->device = MKDEV(MISC_MAJOR, mga_misc.minor);
+       dev->name   = MGA_NAME;
+
+       DRM_DEBUG("doing mem init\n");
+       drm_mem_init();
+       DRM_DEBUG("doing proc init\n");
+       drm_proc_init(dev);
+       DRM_DEBUG("doing agp init\n");
+       dev->agp    = drm_agp_init();
+       if(dev->agp == NULL) {
+               DRM_INFO("The mga drm module requires the agpgart module"
+                        " to function correctly\nPlease load the agpgart"
+                        " module before you load the mga module\n");
+               drm_proc_cleanup();
+               misc_deregister(&mga_misc);
+               mga_takedown(dev);
+               return -ENOMEM;
+       }
+#ifdef CONFIG_MTRR
+       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
+       DRM_DEBUG("doing ctxbitmap init\n");
+       if((retcode = drm_ctxbitmap_init(dev))) {
+               DRM_ERROR("Cannot allocate memory for context bitmap.\n");
+               drm_proc_cleanup();
+               misc_deregister(&mga_misc);
+               mga_takedown(dev);
+               return retcode;
+       }
+
+       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
+                MGA_NAME,
+                MGA_MAJOR,
+                MGA_MINOR,
+                MGA_PATCHLEVEL,
+                MGA_DATE,
+                mga_misc.minor);
+
+       return 0;
+}
+
+/* mga_cleanup is called via cleanup_module at module unload time. */
+
+void mga_cleanup(void)
+{
+       drm_device_t          *dev = &mga_device;
+
+       DRM_DEBUG("\n");
+       
+       drm_proc_cleanup();
+       if (misc_deregister(&mga_misc)) {
+               DRM_ERROR("Cannot unload module\n");
+       } else {
+               DRM_INFO("Module unloaded\n");
+       }
+       drm_ctxbitmap_cleanup(dev);
+       mga_dma_cleanup(dev);
+#ifdef CONFIG_MTRR
+       if(dev->agp && dev->agp->agp_mtrr) {
+               int retval;
+               retval = mtrr_del(dev->agp->agp_mtrr, 
+                                 dev->agp->agp_info.aper_base,
+                                 dev->agp->agp_info.aper_size * 1024*1024);
+               DRM_DEBUG("mtrr_del = %d\n", retval);
+       }
+#endif
+
+       mga_takedown(dev);
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+}
+
+int mga_version(struct inode *inode, struct file *filp, unsigned int cmd,
+                 unsigned long arg)
+{
+       drm_version_t version;
+       int           len;
+
+       copy_from_user_ret(&version,
+                          (drm_version_t *)arg,
+                          sizeof(version),
+                          -EFAULT);
+
+#define DRM_COPY(name,value)                                \
+       len = strlen(value);                                 \
+       if (len > name##_len) len = name##_len;              \
+       name##_len = strlen(value);                          \
+       if (len && name) {                                   \
+               copy_to_user_ret(name, value, len, -EFAULT); \
+       }
+
+       version.version_major      = MGA_MAJOR;
+       version.version_minor      = MGA_MINOR;
+       version.version_patchlevel = MGA_PATCHLEVEL;
+
+       DRM_COPY(version.name, MGA_NAME);
+       DRM_COPY(version.date, MGA_DATE);
+       DRM_COPY(version.desc, MGA_DESC);
+
+       copy_to_user_ret((drm_version_t *)arg,
+                        &version,
+                        sizeof(version),
+                        -EFAULT);
+       return 0;
+}
+
+int mga_open(struct inode *inode, struct file *filp)
+{
+       drm_device_t  *dev    = &mga_device;
+       int           retcode = 0;
+       
+       DRM_DEBUG("open_count = %d\n", dev->open_count);
+       if (!(retcode = drm_open_helper(inode, filp, dev))) {
+               MOD_INC_USE_COUNT;
+               atomic_inc(&dev->total_open);
+               spin_lock(&dev->count_lock);
+               if (!dev->open_count++) {
+                       spin_unlock(&dev->count_lock);
+                       return mga_setup(dev);
+               }
+               spin_unlock(&dev->count_lock);
+       }
+       return retcode;
+}
+
+int mga_release(struct inode *inode, struct file *filp)
+{
+       drm_file_t    *priv   = filp->private_data;
+       drm_device_t  *dev    = priv->dev;
+       int           retcode = 0;
+
+       DRM_DEBUG("pid = %d, device = 0x%x, open_count = %d\n",
+                 current->pid, dev->device, dev->open_count);
+
+       if (dev->lock.hw_lock && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)
+           && dev->lock.pid == current->pid) {
+               mga_reclaim_buffers(dev, priv->pid);
+               DRM_ERROR("Process %d dead, freeing lock for context %d\n",
+                         current->pid,
+                         _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+               drm_lock_free(dev,
+                             &dev->lock.hw_lock->lock,
+                             _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+               
+                               /* FIXME: may require heavy-handed reset of
+                                   hardware at this point, possibly
+                                   processed via a callback to the X
+                                   server. */
+       } else if (dev->lock.hw_lock) {
+               /* The lock is required to reclaim buffers */
+               DECLARE_WAITQUEUE(entry, current);
+               add_wait_queue(&dev->lock.lock_queue, &entry);
+               for (;;) {
+                       if (!dev->lock.hw_lock) {
+                               /* Device has been unregistered */
+                               retcode = -EINTR;
+                               break;
+                       }
+                       if (drm_lock_take(&dev->lock.hw_lock->lock,
+                                         DRM_KERNEL_CONTEXT)) {
+                               dev->lock.pid       = priv->pid;
+                               dev->lock.lock_time = jiffies;
+                               atomic_inc(&dev->total_locks);
+                               break;  /* Got lock */
+                       }                       
+                               /* Contention */
+                       atomic_inc(&dev->total_sleeps);
+                       current->state = TASK_INTERRUPTIBLE;
+                       schedule();
+                       if (signal_pending(current)) {
+                               retcode = -ERESTARTSYS;
+                               break;
+                       }
+               }
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev->lock.lock_queue, &entry);
+               if(!retcode) {
+                       mga_reclaim_buffers(dev, priv->pid);
+                       drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                                     DRM_KERNEL_CONTEXT);
+               }
+       }
+       drm_fasync(-1, filp, 0);
+
+       down(&dev->struct_sem);
+       if (priv->prev) priv->prev->next = priv->next;
+       else            dev->file_first  = priv->next;
+       if (priv->next) priv->next->prev = priv->prev;
+       else            dev->file_last   = priv->prev;
+       up(&dev->struct_sem);
+       
+       drm_free(priv, sizeof(*priv), DRM_MEM_FILES);
+       MOD_DEC_USE_COUNT;
+       atomic_inc(&dev->total_close);
+       spin_lock(&dev->count_lock);
+       if (!--dev->open_count) {
+               if (atomic_read(&dev->ioctl_count) || dev->blocked) {
+                       DRM_ERROR("Device busy: %d %d\n",
+                                 atomic_read(&dev->ioctl_count),
+                                 dev->blocked);
+                       spin_unlock(&dev->count_lock);
+                       return -EBUSY;
+               }
+               spin_unlock(&dev->count_lock);
+               return mga_takedown(dev);
+       }
+       spin_unlock(&dev->count_lock);
+       return retcode;
+}
+
+
+/* drm_ioctl is called whenever a process performs an ioctl on /dev/drm. */
+
+int mga_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       int              nr      = DRM_IOCTL_NR(cmd);
+       drm_file_t       *priv   = filp->private_data;
+       drm_device_t     *dev    = priv->dev;
+       int              retcode = 0;
+       drm_ioctl_desc_t *ioctl;
+       drm_ioctl_t      *func;
+
+       atomic_inc(&dev->ioctl_count);
+       atomic_inc(&dev->total_ioctl);
+       ++priv->ioctl_count;
+       
+       DRM_DEBUG("pid = %d, cmd = 0x%02x, nr = 0x%02x, dev 0x%x, auth = %d\n",
+                 current->pid, cmd, nr, dev->device, priv->authenticated);
+
+       if (nr >= MGA_IOCTL_COUNT) {
+               retcode = -EINVAL;
+       } else {
+               ioctl     = &mga_ioctls[nr];
+               func      = ioctl->func;
+
+               if (!func) {
+                       DRM_DEBUG("no function\n");
+                       retcode = -EINVAL;
+               } else if ((ioctl->root_only && !capable(CAP_SYS_ADMIN))
+                           || (ioctl->auth_needed && !priv->authenticated)) {
+                       retcode = -EACCES;
+               } else {
+                       retcode = (func)(inode, filp, cmd, arg);
+               }
+       }
+       
+       atomic_dec(&dev->ioctl_count);
+       return retcode;
+}
+
+int mga_unlock(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_lock_t        lock;
+
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+       
+       if (lock.context == DRM_KERNEL_CONTEXT) {
+               DRM_ERROR("Process %d using kernel context %d\n",
+                         current->pid, lock.context);
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("%d frees lock (%d holds)\n",
+                 lock.context,
+                 _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+       atomic_inc(&dev->total_unlocks);
+       if (_DRM_LOCK_IS_CONT(dev->lock.hw_lock->lock))
+               atomic_inc(&dev->total_contends);
+       drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT);
+       mga_dma_schedule(dev, 1);
+
+       if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                         DRM_KERNEL_CONTEXT)) {
+          DRM_ERROR("\n");
+       }
+
+       return 0;
+}
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
new file mode 100644 (file)
index 0000000..f217acb
--- /dev/null
@@ -0,0 +1,447 @@
+/* mga_drv.h -- Private header for the Matrox g200/g400 driver -*- linux-c -*-
+ * Created: Mon Dec 13 01:50:01 1999 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ *
+ */
+
+#ifndef _MGA_DRV_H_
+#define _MGA_DRV_H_
+
+#define MGA_BUF_IN_USE         0
+#define MGA_BUF_SWAP_PENDING   1
+#define MGA_BUF_FORCE_FIRE     2
+#define MGA_BUF_NEEDS_OVERFLOW 3
+
+typedef struct {
+       u32 buffer_status;
+       unsigned int num_dwords;
+       unsigned int max_dwords;
+       u32 *current_dma_ptr;
+       u32 *head;
+       u32 phys_head;
+       unsigned int prim_age;
+       int sec_used;
+       int idx;
+} drm_mga_prim_buf_t;
+
+typedef struct _drm_mga_freelist {
+       unsigned int age;
+       drm_buf_t *buf;
+       struct _drm_mga_freelist *next;
+       struct _drm_mga_freelist *prev;
+} drm_mga_freelist_t;
+
+#define MGA_IN_DISPATCH   0
+#define MGA_IN_FLUSH      1
+#define MGA_IN_WAIT       2
+#define MGA_IN_GETBUF    3
+
+typedef struct _drm_mga_private {
+       u32 dispatch_status;
+       unsigned int next_prim_age;
+       __volatile__ unsigned int last_prim_age;
+       int reserved_map_idx;
+       int buffer_map_idx;
+       drm_mga_sarea_t *sarea_priv;
+       int primary_size;
+       int warp_ucode_size;
+       int chipset;
+       unsigned int frontOffset;
+       unsigned int backOffset;
+       unsigned int depthOffset;
+       unsigned int textureOffset;
+       unsigned int textureSize;
+       int cpp;
+       unsigned int stride;
+       int sgram;
+       int use_agp;
+       drm_mga_warp_index_t WarpIndex[MGA_MAX_G400_PIPES];
+       unsigned int WarpPipe;
+       atomic_t pending_bufs;
+       void *status_page;
+       unsigned long real_status_page;
+       u8 *ioremap;
+       drm_mga_prim_buf_t **prim_bufs;
+       drm_mga_prim_buf_t *next_prim;
+       drm_mga_prim_buf_t *last_prim;
+       drm_mga_prim_buf_t *current_prim;
+       int current_prim_idx;
+       drm_mga_freelist_t *head;
+       drm_mga_freelist_t *tail;
+       wait_queue_head_t flush_queue;  /* Processes waiting until flush    */
+       wait_queue_head_t wait_queue;   /* Processes waiting until interrupt */
+       wait_queue_head_t buf_queue;    /* Processes waiting for a free buf */
+       /* Some validated register values:
+        */     
+       u32 mAccess;
+} drm_mga_private_t;
+
+                               /* mga_drv.c */
+extern int  mga_init(void);
+extern void mga_cleanup(void);
+extern int  mga_version(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  mga_open(struct inode *inode, struct file *filp);
+extern int  mga_release(struct inode *inode, struct file *filp);
+extern int  mga_ioctl(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  mga_unlock(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+
+                               /* mga_dma.c */
+extern int  mga_dma_schedule(drm_device_t *dev, int locked);
+extern int  mga_dma(struct inode *inode, struct file *filp,
+                     unsigned int cmd, unsigned long arg);
+extern int  mga_irq_install(drm_device_t *dev, int irq);
+extern int  mga_irq_uninstall(drm_device_t *dev);
+extern int  mga_control(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  mga_lock(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+
+/* mga_dma_init does init and release */
+extern int mga_dma_init(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int mga_dma_cleanup(drm_device_t *dev);
+extern int mga_flush_ioctl(struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg);
+extern void mga_flush_write_combine(void);
+extern unsigned int mga_create_sync_tag(drm_device_t *dev);
+extern drm_buf_t *mga_freelist_get(drm_device_t *dev);
+extern int mga_freelist_put(drm_device_t *dev, drm_buf_t *buf);
+extern int mga_advance_primary(drm_device_t *dev);
+extern void mga_reclaim_buffers(drm_device_t *dev, pid_t pid);
+
+
+                               /* mga_bufs.c */
+extern int  mga_addbufs(struct inode *inode, struct file *filp, 
+                       unsigned int cmd, unsigned long arg);
+extern int  mga_infobufs(struct inode *inode, struct file *filp, 
+                        unsigned int cmd, unsigned long arg);
+extern int  mga_markbufs(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int  mga_freebufs(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int  mga_mapbufs(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  mga_addmap(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+                               /* mga_state.c */
+extern int  mga_clear_bufs(struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg);
+extern int  mga_swap_bufs(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  mga_iload(struct inode *inode, struct file *filp,
+                     unsigned int cmd, unsigned long arg);
+extern int  mga_vertex(struct inode *inode, struct file *filp,
+                     unsigned int cmd, unsigned long arg);
+extern int  mga_indices(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+                               /* mga_context.c */
+extern int  mga_resctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  mga_addctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  mga_modctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  mga_getctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  mga_switchctx(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  mga_newctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  mga_rmctx(struct inode *inode, struct file *filp,
+                     unsigned int cmd, unsigned long arg);
+
+extern int  mga_context_switch(drm_device_t *dev, int old, int new);
+extern int  mga_context_switch_complete(drm_device_t *dev, int new);
+
+
+typedef enum {
+       TT_GENERAL,
+       TT_BLIT,
+       TT_VECTOR,
+       TT_VERTEX
+} transferType_t;
+
+typedef struct {
+       drm_mga_freelist_t *my_freelist;
+       int discard;
+       int dispatched;
+} drm_mga_buf_priv_t;
+
+#define DWGREG0        0x1c00
+#define DWGREG0_END    0x1dff
+#define DWGREG1                0x2c00
+#define DWGREG1_END    0x2dff
+
+#define ISREG0(r)      (r >= DWGREG0 && r <= DWGREG0_END)
+#define ADRINDEX0(r)   (u8)((r - DWGREG0) >> 2)
+#define ADRINDEX1(r)   (u8)(((r - DWGREG1) >> 2) | 0x80)
+#define ADRINDEX(r)    (ISREG0(r) ? ADRINDEX0(r) : ADRINDEX1(r)) 
+
+#define MGA_VERBOSE 0
+#define MGA_NUM_PRIM_BUFS      8
+
+#define PRIMLOCALS     u8 tempIndex[4]; u32 *dma_ptr; u32 phys_head; \
+                       int outcount, num_dwords
+
+#define PRIM_OVERFLOW(dev, dev_priv, length) do {                      \
+       drm_mga_prim_buf_t *tmp_buf =                                   \
+               dev_priv->prim_bufs[dev_priv->current_prim_idx];        \
+       if( test_bit(MGA_BUF_NEEDS_OVERFLOW,                            \
+                 &tmp_buf->buffer_status)) {                           \
+               mga_advance_primary(dev);                               \
+               mga_dma_schedule(dev, 1);                               \
+       } else if( tmp_buf->max_dwords - tmp_buf->num_dwords < length ||\
+           tmp_buf->sec_used > MGA_DMA_BUF_NR/2) {                     \
+               set_bit(MGA_BUF_FORCE_FIRE, &tmp_buf->buffer_status);   \
+               mga_advance_primary(dev);                               \
+               mga_dma_schedule(dev, 1);                               \
+       }                                                               \
+} while(0)
+
+#define PRIMGETPTR(dev_priv) do {                                      \
+       drm_mga_prim_buf_t *tmp_buf =                                   \
+               dev_priv->prim_bufs[dev_priv->current_prim_idx];        \
+       if(MGA_VERBOSE)                                                 \
+               DRM_DEBUG("PRIMGETPTR in %s\n", __FUNCTION__);          \
+       dma_ptr = tmp_buf->current_dma_ptr;                             \
+       num_dwords = tmp_buf->num_dwords;                               \
+       phys_head = tmp_buf->phys_head;                                 \
+       outcount = 0;                                                   \
+} while(0)
+
+#define PRIMPTR(prim_buf) do {                                 \
+       if(MGA_VERBOSE)                                         \
+               DRM_DEBUG("PRIMPTR in %s\n", __FUNCTION__);     \
+       dma_ptr = prim_buf->current_dma_ptr;                    \
+       num_dwords = prim_buf->num_dwords;                      \
+       phys_head = prim_buf->phys_head;                        \
+       outcount = 0;                                           \
+} while(0)
+
+#define PRIMFINISH(prim_buf) do {                              \
+       if (MGA_VERBOSE) {                                      \
+               DRM_DEBUG( "PRIMFINISH in %s\n", __FUNCTION__); \
+                if (outcount & 3)                              \
+                      DRM_DEBUG(" --- truncation\n");          \
+        }                                                      \
+       prim_buf->num_dwords = num_dwords;                      \
+       prim_buf->current_dma_ptr = dma_ptr;                    \
+} while(0)
+
+#define PRIMADVANCE(dev_priv)  do {                            \
+drm_mga_prim_buf_t *tmp_buf =                                  \
+       dev_priv->prim_bufs[dev_priv->current_prim_idx];        \
+       if (MGA_VERBOSE) {                                      \
+               DRM_DEBUG("PRIMADVANCE in %s\n", __FUNCTION__); \
+                if (outcount & 3)                              \
+                      DRM_DEBUG(" --- truncation\n");  \
+        }                                                      \
+       tmp_buf->num_dwords = num_dwords;                       \
+       tmp_buf->current_dma_ptr = dma_ptr;                     \
+} while (0)
+
+#define PRIMUPDATE(dev_priv)   do {                                    \
+       drm_mga_prim_buf_t *tmp_buf =                                   \
+               dev_priv->prim_bufs[dev_priv->current_prim_idx];        \
+       tmp_buf->sec_used++;                                            \
+} while (0)
+
+#define AGEBUF(dev_priv, buf_priv)     do {                            \
+       drm_mga_prim_buf_t *tmp_buf =                                   \
+               dev_priv->prim_bufs[dev_priv->current_prim_idx];        \
+       buf_priv->my_freelist->age = tmp_buf->prim_age;                 \
+} while (0)
+
+
+#define PRIMOUTREG(reg, val) do {                                      \
+       tempIndex[outcount]=ADRINDEX(reg);                              \
+       dma_ptr[1+outcount] = val;                                      \
+       if (MGA_VERBOSE)                                                \
+               DRM_DEBUG("   PRIMOUT %d: 0x%x -- 0x%x\n",              \
+                      num_dwords + 1 + outcount, ADRINDEX(reg), val);  \
+       if( ++outcount == 4) {                                          \
+               outcount = 0;                                           \
+               dma_ptr[0] = *(u32 *)tempIndex;                         \
+               dma_ptr+=5;                                             \
+               num_dwords += 5;                                        \
+       }                                                               \
+}while (0)
+
+/* A reduced set of the mga registers.
+ */
+
+#define MGAREG_MGA_EXEC                        0x0100
+#define MGAREG_ALPHACTRL                       0x2c7c
+#define MGAREG_AR0                             0x1c60
+#define MGAREG_AR1                             0x1c64
+#define MGAREG_AR2                             0x1c68
+#define MGAREG_AR3                             0x1c6c
+#define MGAREG_AR4                             0x1c70
+#define MGAREG_AR5                             0x1c74
+#define MGAREG_AR6                             0x1c78
+#define MGAREG_CXBNDRY                         0x1c80
+#define MGAREG_CXLEFT                          0x1ca0
+#define MGAREG_CXRIGHT                         0x1ca4
+#define MGAREG_DMAPAD                          0x1c54
+#define MGAREG_DSTORG                          0x2cb8
+#define MGAREG_DWGCTL                          0x1c00
+#define MGAREG_DWGSYNC                         0x2c4c
+#define MGAREG_FCOL                            0x1c24
+#define MGAREG_FIFOSTATUS                      0x1e10
+#define MGAREG_FOGCOL                          0x1cf4
+#define MGAREG_FXBNDRY                         0x1c84
+#define MGAREG_FXLEFT                          0x1ca8
+#define MGAREG_FXRIGHT                         0x1cac
+#define MGAREG_ICLEAR                          0x1e18
+#define MGAREG_IEN                             0x1e1c
+#define MGAREG_LEN                             0x1c5c
+#define MGAREG_MACCESS                         0x1c04
+#define MGAREG_PITCH                           0x1c8c
+#define MGAREG_PLNWT                           0x1c1c
+#define MGAREG_PRIMADDRESS                     0x1e58
+#define MGAREG_PRIMEND                         0x1e5c
+#define MGAREG_PRIMPTR                         0x1e50
+#define MGAREG_SECADDRESS                      0x2c40
+#define MGAREG_SECEND                          0x2c44
+#define MGAREG_SETUPADDRESS                    0x2cd0
+#define MGAREG_SETUPEND                        0x2cd4
+#define MGAREG_SOFTRAP                         0x2c48
+#define MGAREG_SRCORG                          0x2cb4
+#define MGAREG_STATUS                          0x1e14
+#define MGAREG_STENCIL                         0x2cc8
+#define MGAREG_STENCILCTL                      0x2ccc
+#define MGAREG_TDUALSTAGE0                     0x2cf8
+#define MGAREG_TDUALSTAGE1                     0x2cfc
+#define MGAREG_TEXBORDERCOL                    0x2c5c
+#define MGAREG_TEXCTL                          0x2c30
+#define MGAREG_TEXCTL2                         0x2c3c
+#define MGAREG_TEXFILTER                       0x2c58
+#define MGAREG_TEXHEIGHT                       0x2c2c
+#define MGAREG_TEXORG                          0x2c24
+#define MGAREG_TEXORG1                         0x2ca4
+#define MGAREG_TEXORG2                         0x2ca8
+#define MGAREG_TEXORG3                         0x2cac
+#define MGAREG_TEXORG4                         0x2cb0
+#define MGAREG_TEXTRANS                        0x2c34
+#define MGAREG_TEXTRANSHIGH                    0x2c38
+#define MGAREG_TEXWIDTH                        0x2c28
+#define MGAREG_WACCEPTSEQ                      0x1dd4
+#define MGAREG_WCODEADDR                       0x1e6c
+#define MGAREG_WFLAG                           0x1dc4
+#define MGAREG_WFLAG1                          0x1de0
+#define MGAREG_WFLAGNB                         0x1e64
+#define MGAREG_WFLAGNB1                        0x1e08
+#define MGAREG_WGETMSB                         0x1dc8
+#define MGAREG_WIADDR                          0x1dc0
+#define MGAREG_WIADDR2                         0x1dd8
+#define MGAREG_WMISC                           0x1e70
+#define MGAREG_WVRTXSZ                         0x1dcc
+#define MGAREG_YBOT                            0x1c9c
+#define MGAREG_YDST                            0x1c90
+#define MGAREG_YDSTLEN                         0x1c88
+#define MGAREG_YDSTORG                         0x1c94
+#define MGAREG_YTOP                            0x1c98
+#define MGAREG_ZORG                            0x1c0c
+
+#define PDEA_pagpxfer_enable                   0x2
+
+#define WIA_wmode_suspend                      0x0
+#define WIA_wmode_start                        0x3
+#define WIA_wagp_agp                           0x4
+
+#define DC_opcod_line_open                     0x0
+#define DC_opcod_autoline_open                         0x1
+#define DC_opcod_line_close                    0x2
+#define DC_opcod_autoline_close                0x3
+#define DC_opcod_trap                          0x4
+#define DC_opcod_texture_trap                  0x6
+#define DC_opcod_bitblt                        0x8
+#define DC_opcod_iload                                 0x9
+#define DC_atype_rpl                           0x0
+#define DC_atype_rstr                          0x10
+#define DC_atype_zi                            0x30
+#define DC_atype_blk                           0x40
+#define DC_atype_i                             0x70
+#define DC_linear_xy                           0x0             
+#define DC_linear_linear                       0x80            
+#define DC_zmode_nozcmp                        0x0
+#define DC_zmode_ze                            0x200
+#define DC_zmode_zne                           0x300
+#define DC_zmode_zlt                           0x400
+#define DC_zmode_zlte                          0x500
+#define DC_zmode_zgt                           0x600
+#define DC_zmode_zgte                          0x700
+#define DC_solid_disable                       0x0             
+#define DC_solid_enable                        0x800           
+#define DC_arzero_disable                      0x0             
+#define DC_arzero_enable                       0x1000          
+#define DC_sgnzero_disable                     0x0             
+#define DC_sgnzero_enable                      0x2000          
+#define DC_shftzero_disable                    0x0             
+#define DC_shftzero_enable                     0x4000          
+#define DC_bop_SHIFT                           16              
+#define DC_trans_SHIFT                                 20              
+#define DC_bltmod_bmonolef                     0x0
+#define DC_bltmod_bmonowf                      0x8000000
+#define DC_bltmod_bplan                        0x2000000
+#define DC_bltmod_bfcol                        0x4000000
+#define DC_bltmod_bu32bgr                      0x6000000
+#define DC_bltmod_bu32rgb                      0xe000000
+#define DC_bltmod_bu24bgr                      0x16000000
+#define DC_bltmod_bu24rgb                      0x1e000000
+#define DC_pattern_disable                     0x0             
+#define DC_pattern_enable                      0x20000000      
+#define DC_transc_disable                      0x0             
+#define DC_transc_enable                       0x40000000      
+#define DC_clipdis_disable                     0x0             
+#define DC_clipdis_enable                      0x80000000      
+
+#define SETADD_mode_vertlist                           0x0     
+
+
+#define MGA_CLEAR_CMD (DC_opcod_trap | DC_arzero_enable |              \
+                      DC_sgnzero_enable | DC_shftzero_enable |         \
+                      (0xC << DC_bop_SHIFT) | DC_clipdis_enable |      \
+                      DC_solid_enable | DC_transc_enable)
+         
+
+#define MGA_COPY_CMD (DC_opcod_bitblt | DC_atype_rpl | DC_linear_xy |  \
+                     DC_solid_disable | DC_arzero_disable |            \
+                     DC_sgnzero_enable | DC_shftzero_enable |          \
+                     (0xC << DC_bop_SHIFT) | DC_bltmod_bfcol |         \
+                     DC_pattern_disable | DC_transc_disable |          \
+                     DC_clipdis_enable)                                \
+
+#define MGA_FLUSH_CMD (DC_opcod_texture_trap | (0xF << DC_trans_SHIFT) |\
+                      DC_arzero_enable | DC_sgnzero_enable |           \
+                      DC_atype_i)
+
+#endif
diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c
new file mode 100644 (file)
index 0000000..723ccc5
--- /dev/null
@@ -0,0 +1,1067 @@
+/* mga_state.c -- State support for mga g200/g400 -*- linux-c -*-
+ * Created: Thu Jan 27 02:53:43 2000 by jhartmann@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Jeff Hartmann <jhartmann@valinux.com>
+ *         Keith Whitwell <keithw@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "mga_drv.h"
+#include "drm.h"
+
+static void mgaEmitClipRect(drm_mga_private_t * dev_priv,
+                           drm_clip_rect_t * box)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->ContextState;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       /* This takes 10 dwords */
+       PRIMGETPTR(dev_priv);
+
+       /* Force reset of dwgctl (eliminates clip disable) */
+#if 0
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DWGSYNC, 0);
+       PRIMOUTREG(MGAREG_DWGSYNC, 0);
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+#else
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+       PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 0x80000000);
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+       PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 0x80000000);
+#endif
+
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_CXBNDRY, ((box->x2) << 16) | (box->x1));
+       PRIMOUTREG(MGAREG_YTOP, box->y1 * dev_priv->stride / 2);
+       PRIMOUTREG(MGAREG_YBOT, box->y2 * dev_priv->stride / 2);
+
+       PRIMADVANCE(dev_priv);
+}
+
+static void mgaEmitContext(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->ContextState;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       /* This takes a max of 15 dwords */
+       PRIMGETPTR(dev_priv);
+
+       PRIMOUTREG(MGAREG_DSTORG, regs[MGA_CTXREG_DSTORG]);
+       PRIMOUTREG(MGAREG_MACCESS, regs[MGA_CTXREG_MACCESS]);
+       PRIMOUTREG(MGAREG_PLNWT, regs[MGA_CTXREG_PLNWT]);
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+
+       PRIMOUTREG(MGAREG_ALPHACTRL, regs[MGA_CTXREG_ALPHACTRL]);
+       PRIMOUTREG(MGAREG_FOGCOL, regs[MGA_CTXREG_FOGCOLOR]);
+       PRIMOUTREG(MGAREG_WFLAG, regs[MGA_CTXREG_WFLAG]);
+       PRIMOUTREG(MGAREG_ZORG, dev_priv->depthOffset); /* invarient */
+
+       if (dev_priv->chipset == MGA_CARD_TYPE_G400) {
+               PRIMOUTREG(MGAREG_WFLAG1, regs[MGA_CTXREG_WFLAG]);
+               PRIMOUTREG(MGAREG_TDUALSTAGE0, regs[MGA_CTXREG_TDUAL0]);
+               PRIMOUTREG(MGAREG_TDUALSTAGE1, regs[MGA_CTXREG_TDUAL1]);
+               PRIMOUTREG(MGAREG_FCOL, regs[MGA_CTXREG_FCOL]);
+       } else {
+               PRIMOUTREG(MGAREG_FCOL, regs[MGA_CTXREG_FCOL]);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+       }
+
+       PRIMADVANCE(dev_priv);
+}
+
+static void mgaG200EmitTex(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->TexState[0];
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       PRIMGETPTR(dev_priv);
+
+       /* This takes 20 dwords */
+
+       PRIMOUTREG(MGAREG_TEXCTL2, regs[MGA_TEXREG_CTL2]);
+       PRIMOUTREG(MGAREG_TEXCTL, regs[MGA_TEXREG_CTL]);
+       PRIMOUTREG(MGAREG_TEXFILTER, regs[MGA_TEXREG_FILTER]);
+       PRIMOUTREG(MGAREG_TEXBORDERCOL, regs[MGA_TEXREG_BORDERCOL]);
+
+       PRIMOUTREG(MGAREG_TEXORG, regs[MGA_TEXREG_ORG]);
+       PRIMOUTREG(MGAREG_TEXORG1, regs[MGA_TEXREG_ORG1]);
+       PRIMOUTREG(MGAREG_TEXORG2, regs[MGA_TEXREG_ORG2]);
+       PRIMOUTREG(MGAREG_TEXORG3, regs[MGA_TEXREG_ORG3]);
+
+       PRIMOUTREG(MGAREG_TEXORG4, regs[MGA_TEXREG_ORG4]);
+       PRIMOUTREG(MGAREG_TEXWIDTH, regs[MGA_TEXREG_WIDTH]);
+       PRIMOUTREG(MGAREG_TEXHEIGHT, regs[MGA_TEXREG_HEIGHT]);
+       PRIMOUTREG(0x2d00 + 24 * 4, regs[MGA_TEXREG_WIDTH]);
+
+       PRIMOUTREG(0x2d00 + 34 * 4, regs[MGA_TEXREG_HEIGHT]);
+       PRIMOUTREG(MGAREG_TEXTRANS, 0xffff);
+       PRIMOUTREG(MGAREG_TEXTRANSHIGH, 0xffff);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+       PRIMADVANCE(dev_priv);
+}
+
+static void mgaG400EmitTex0(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->TexState[0];
+       int multitex = sarea_priv->WarpPipe & MGA_T2;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       PRIMGETPTR(dev_priv);
+
+       /* This takes a max of 30 dwords */
+
+       PRIMOUTREG(MGAREG_TEXCTL2, regs[MGA_TEXREG_CTL2] | 0x00008000);
+       PRIMOUTREG(MGAREG_TEXCTL, regs[MGA_TEXREG_CTL]);
+       PRIMOUTREG(MGAREG_TEXFILTER, regs[MGA_TEXREG_FILTER]);
+       PRIMOUTREG(MGAREG_TEXBORDERCOL, regs[MGA_TEXREG_BORDERCOL]);
+
+       PRIMOUTREG(MGAREG_TEXORG, regs[MGA_TEXREG_ORG]);
+       PRIMOUTREG(MGAREG_TEXORG1, regs[MGA_TEXREG_ORG1]);
+       PRIMOUTREG(MGAREG_TEXORG2, regs[MGA_TEXREG_ORG2]);
+       PRIMOUTREG(MGAREG_TEXORG3, regs[MGA_TEXREG_ORG3]);
+
+       PRIMOUTREG(MGAREG_TEXORG4, regs[MGA_TEXREG_ORG4]);
+       PRIMOUTREG(MGAREG_TEXWIDTH, regs[MGA_TEXREG_WIDTH]);
+       PRIMOUTREG(MGAREG_TEXHEIGHT, regs[MGA_TEXREG_HEIGHT]);
+       PRIMOUTREG(0x2d00 + 49 * 4, 0);
+
+       PRIMOUTREG(0x2d00 + 57 * 4, 0);
+       PRIMOUTREG(0x2d00 + 53 * 4, 0);
+       PRIMOUTREG(0x2d00 + 61 * 4, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+       if (!multitex) {
+               PRIMOUTREG(0x2d00 + 52 * 4, 0x40);
+               PRIMOUTREG(0x2d00 + 60 * 4, 0x40);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+       }
+
+       PRIMOUTREG(0x2d00 + 54 * 4, regs[MGA_TEXREG_WIDTH] | 0x40);
+       PRIMOUTREG(0x2d00 + 62 * 4, regs[MGA_TEXREG_HEIGHT] | 0x40);
+       PRIMOUTREG(MGAREG_TEXTRANS, 0xffff);
+       PRIMOUTREG(MGAREG_TEXTRANSHIGH, 0xffff);
+
+       PRIMADVANCE(dev_priv);
+}
+
+#define TMC_map1_enable                0x80000000
+
+static void mgaG400EmitTex1(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->TexState[1];
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       PRIMGETPTR(dev_priv);
+
+       /* This takes 25 dwords */
+
+       PRIMOUTREG(MGAREG_TEXCTL2,
+                  regs[MGA_TEXREG_CTL2] | TMC_map1_enable | 0x00008000);
+       PRIMOUTREG(MGAREG_TEXCTL, regs[MGA_TEXREG_CTL]);
+       PRIMOUTREG(MGAREG_TEXFILTER, regs[MGA_TEXREG_FILTER]);
+       PRIMOUTREG(MGAREG_TEXBORDERCOL, regs[MGA_TEXREG_BORDERCOL]);
+
+       PRIMOUTREG(MGAREG_TEXORG, regs[MGA_TEXREG_ORG]);
+       PRIMOUTREG(MGAREG_TEXORG1, regs[MGA_TEXREG_ORG1]);
+       PRIMOUTREG(MGAREG_TEXORG2, regs[MGA_TEXREG_ORG2]);
+       PRIMOUTREG(MGAREG_TEXORG3, regs[MGA_TEXREG_ORG3]);
+
+       PRIMOUTREG(MGAREG_TEXORG4, regs[MGA_TEXREG_ORG4]);
+       PRIMOUTREG(MGAREG_TEXWIDTH, regs[MGA_TEXREG_WIDTH]);
+       PRIMOUTREG(MGAREG_TEXHEIGHT, regs[MGA_TEXREG_HEIGHT]);
+       PRIMOUTREG(0x2d00 + 49 * 4, 0);
+
+       PRIMOUTREG(0x2d00 + 57 * 4, 0);
+       PRIMOUTREG(0x2d00 + 53 * 4, 0);
+       PRIMOUTREG(0x2d00 + 61 * 4, 0);
+       PRIMOUTREG(0x2d00 + 52 * 4, regs[MGA_TEXREG_WIDTH] | 0x40);
+
+       PRIMOUTREG(0x2d00 + 60 * 4, regs[MGA_TEXREG_HEIGHT] | 0x40);
+       PRIMOUTREG(MGAREG_TEXTRANS, 0xffff);
+       PRIMOUTREG(MGAREG_TEXTRANSHIGH, 0xffff);
+       PRIMOUTREG(MGAREG_TEXCTL2, regs[MGA_TEXREG_CTL2] | 0x00008000);
+
+       PRIMADVANCE(dev_priv);
+}
+
+#define EMIT_PIPE 50
+static void mgaG400EmitPipe(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int pipe = sarea_priv->WarpPipe;
+       float fParam = 12800.0f;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       PRIMGETPTR(dev_priv);
+
+       /* This takes 50 dwords */
+
+       /* Establish vertex size.  
+        */
+       PRIMOUTREG(MGAREG_WIADDR2, WIA_wmode_suspend);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+       if (pipe & MGA_T2) {
+               PRIMOUTREG(MGAREG_WVRTXSZ, 0x00001e09);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0x1e000000);
+       } else {
+               if (dev_priv->WarpPipe & MGA_T2) {
+                       /* Flush the WARP pipe */
+                       PRIMOUTREG(MGAREG_YDST, 0);
+                       PRIMOUTREG(MGAREG_FXLEFT, 0);
+                       PRIMOUTREG(MGAREG_FXRIGHT, 1);
+                       PRIMOUTREG(MGAREG_DWGCTL, MGA_FLUSH_CMD);
+
+                       PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 1);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DWGSYNC, 0x7000);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+                       PRIMOUTREG(MGAREG_TEXCTL2, 0 | 0x00008000);
+                       PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 0);
+                       PRIMOUTREG(MGAREG_TEXCTL2, 0x80 | 0x00008000);
+                       PRIMOUTREG(MGAREG_LEN + MGAREG_MGA_EXEC, 0);
+               }
+
+               PRIMOUTREG(MGAREG_WVRTXSZ, 0x00001807);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+               PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0);
+               PRIMOUTREG(MGAREG_WACCEPTSEQ, 0x18000000);
+       }
+
+       PRIMOUTREG(MGAREG_WFLAG, 0);
+       PRIMOUTREG(MGAREG_WFLAG1, 0);
+       PRIMOUTREG(0x2d00 + 56 * 4, *((u32 *) (&fParam)));
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+
+       PRIMOUTREG(0x2d00 + 49 * 4, 0); /* Tex stage 0 */
+       PRIMOUTREG(0x2d00 + 57 * 4, 0); /* Tex stage 0 */
+       PRIMOUTREG(0x2d00 + 53 * 4, 0); /* Tex stage 1 */
+       PRIMOUTREG(0x2d00 + 61 * 4, 0); /* Tex stage 1 */
+
+       PRIMOUTREG(0x2d00 + 54 * 4, 0x40);      /* Tex stage 0 : w */
+       PRIMOUTREG(0x2d00 + 62 * 4, 0x40);      /* Tex stage 0 : h */
+       PRIMOUTREG(0x2d00 + 52 * 4, 0x40);      /* Tex stage 1 : w */
+       PRIMOUTREG(0x2d00 + 60 * 4, 0x40);      /* Tex stage 1 : h */
+
+       /* Dma pading required due to hw bug */
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_WIADDR2,
+                  (u32) (dev_priv->WarpIndex[pipe].
+                         phys_addr | WIA_wmode_start | WIA_wagp_agp));
+       PRIMADVANCE(dev_priv);
+}
+
+static void mgaG200EmitPipe(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int pipe = sarea_priv->WarpPipe;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       PRIMGETPTR(dev_priv);
+
+       /* This takes 15 dwords */
+
+       PRIMOUTREG(MGAREG_WIADDR, WIA_wmode_suspend);
+       PRIMOUTREG(MGAREG_WVRTXSZ, 7);
+       PRIMOUTREG(MGAREG_WFLAG, 0);
+       PRIMOUTREG(0x2d00 + 24 * 4, 0); /* tex w/h */
+
+       PRIMOUTREG(0x2d00 + 25 * 4, 0x100);
+       PRIMOUTREG(0x2d00 + 34 * 4, 0); /* tex w/h */
+       PRIMOUTREG(0x2d00 + 42 * 4, 0xFFFF);
+       PRIMOUTREG(0x2d00 + 60 * 4, 0xFFFF);
+
+       /* Dma pading required due to hw bug */
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_DMAPAD, 0xffffffff);
+       PRIMOUTREG(MGAREG_WIADDR,
+                  (u32) (dev_priv->WarpIndex[pipe].
+                         phys_addr | WIA_wmode_start | WIA_wagp_agp));
+
+       PRIMADVANCE( dev_priv );
+}
+
+static void mgaEmitState(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int dirty = sarea_priv->dirty;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (dev_priv->chipset == MGA_CARD_TYPE_G400) {
+               int multitex = sarea_priv->WarpPipe & MGA_T2;
+
+               if (sarea_priv->WarpPipe != dev_priv->WarpPipe) {
+                       mgaG400EmitPipe(dev_priv);
+                       dev_priv->WarpPipe = sarea_priv->WarpPipe;
+               }
+
+               if (dirty & MGA_UPLOAD_CTX) {
+                       mgaEmitContext(dev_priv);
+                       sarea_priv->dirty &= ~MGA_UPLOAD_CTX;
+               }
+
+               if (dirty & MGA_UPLOAD_TEX0) {
+                       mgaG400EmitTex0(dev_priv);
+                       sarea_priv->dirty &= ~MGA_UPLOAD_TEX0;
+               }
+
+               if ((dirty & MGA_UPLOAD_TEX1) && multitex) {
+                       mgaG400EmitTex1(dev_priv);
+                       sarea_priv->dirty &= ~MGA_UPLOAD_TEX1;
+               }
+       } else {
+               if (sarea_priv->WarpPipe != dev_priv->WarpPipe) {
+                       mgaG200EmitPipe(dev_priv);
+                       dev_priv->WarpPipe = sarea_priv->WarpPipe;
+               }
+
+               if (dirty & MGA_UPLOAD_CTX) {
+                       mgaEmitContext(dev_priv);
+                       sarea_priv->dirty &= ~MGA_UPLOAD_CTX;
+               }
+
+               if (dirty & MGA_UPLOAD_TEX0) {
+                       mgaG200EmitTex(dev_priv);
+                       sarea_priv->dirty &= ~MGA_UPLOAD_TEX0;
+               }
+       }
+}
+
+
+/* Disallow all write destinations except the front and backbuffer.
+ */
+static int mgaVerifyContext(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->ContextState;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (regs[MGA_CTXREG_DSTORG] != dev_priv->frontOffset &&
+           regs[MGA_CTXREG_DSTORG] != dev_priv->backOffset) {
+               DRM_DEBUG("BAD DSTORG: %x (front %x, back %x)\n\n",
+                         regs[MGA_CTXREG_DSTORG], dev_priv->frontOffset,
+                         dev_priv->backOffset);
+               regs[MGA_CTXREG_DSTORG] = 0;
+               return -1;
+       }
+
+       return 0;
+}
+
+/* Disallow texture reads from PCI space.
+ */
+static int mgaVerifyTex(drm_mga_private_t * dev_priv, int unit)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if ((sarea_priv->TexState[unit][MGA_TEXREG_ORG] & 0x3) == 0x1) {
+               DRM_DEBUG("BAD TEXREG_ORG: %x, unit %d\n",
+                         sarea_priv->TexState[unit][MGA_TEXREG_ORG],
+                         unit);
+               sarea_priv->TexState[unit][MGA_TEXREG_ORG] = 0;
+               return -1;
+       }
+
+       return 0;
+}
+
+static int mgaVerifyState(drm_mga_private_t * dev_priv)
+{
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int dirty = sarea_priv->dirty;
+       int rv = 0;
+
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (sarea_priv->nbox > MGA_NR_SAREA_CLIPRECTS)
+               sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS;
+
+       if (dirty & MGA_UPLOAD_CTX)
+               rv |= mgaVerifyContext(dev_priv);
+
+       if (dirty & MGA_UPLOAD_TEX0)
+               rv |= mgaVerifyTex(dev_priv, 0);
+
+       if (dev_priv->chipset == MGA_CARD_TYPE_G400) {
+               if (dirty & MGA_UPLOAD_TEX1)
+                       rv |= mgaVerifyTex(dev_priv, 1);
+
+               if (dirty & MGA_UPLOAD_PIPE)
+                       rv |= (sarea_priv->WarpPipe > MGA_MAX_G400_PIPES);
+       } else {
+               if (dirty & MGA_UPLOAD_PIPE)
+                       rv |= (sarea_priv->WarpPipe > MGA_MAX_G200_PIPES);
+       }
+
+       return rv == 0;
+}
+
+static int mgaVerifyIload(drm_mga_private_t * dev_priv,
+                         unsigned long bus_address,
+                         unsigned int dstOrg, int length)
+{
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (dstOrg < dev_priv->textureOffset ||
+           dstOrg + length >
+           (dev_priv->textureOffset + dev_priv->textureSize)) {
+               return -EINVAL;
+       }
+       if (length % 64) {
+               return -EINVAL;
+       }
+       return 0;
+}
+
+/* This copies a 64 byte aligned agp region to the frambuffer
+ * with a standard blit, the ioctl needs to do checking */
+
+static void mga_dma_dispatch_tex_blit(drm_device_t * dev,
+                                     unsigned long bus_address,
+                                     int length, unsigned int destOrg)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       int use_agp = PDEA_pagpxfer_enable | 0x00000001;
+       u16 y2;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       y2 = length / 64;
+
+       PRIM_OVERFLOW(dev, dev_priv, 30);
+       PRIMGETPTR(dev_priv);
+
+       PRIMOUTREG(MGAREG_DSTORG, destOrg);
+       PRIMOUTREG(MGAREG_MACCESS, 0x00000000);
+       DRM_DEBUG("srcorg : %lx\n", bus_address | use_agp);
+       PRIMOUTREG(MGAREG_SRCORG, (u32) bus_address | use_agp);
+       PRIMOUTREG(MGAREG_AR5, 64);
+
+       PRIMOUTREG(MGAREG_PITCH, 64);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DWGCTL, MGA_COPY_CMD);
+
+       PRIMOUTREG(MGAREG_AR0, 63);
+       PRIMOUTREG(MGAREG_AR3, 0);
+       PRIMOUTREG(MGAREG_FXBNDRY, (63 << 16));
+       PRIMOUTREG(MGAREG_YDSTLEN + MGAREG_MGA_EXEC, y2);
+
+       PRIMOUTREG(MGAREG_SRCORG, 0);
+       PRIMOUTREG(MGAREG_PITCH, dev_priv->stride / dev_priv->cpp);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMADVANCE(dev_priv);
+}
+
+static void mga_dma_dispatch_vertex(drm_device_t * dev, drm_buf_t * buf)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_buf_priv_t *buf_priv = buf->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned long address = (unsigned long) buf->bus_address;
+       int length = buf->used;
+       int use_agp = PDEA_pagpxfer_enable;
+       int i = 0;
+       int primary_needed;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       DRM_DEBUG("dispatch vertex %d addr 0x%lx, "
+                 "length 0x%x nbox %d dirty %x\n",
+                 buf->idx, address, length,
+                 sarea_priv->nbox, sarea_priv->dirty);
+
+       DRM_DEBUG("used : %d, total : %d\n", buf->used, buf->total);
+
+       if (buf->used) {
+               /* WARNING: if you change any of the state functions verify
+                * these numbers (Overestimating this doesn't hurt).  
+                */
+               buf_priv->dispatched = 1;
+               primary_needed = (50 + 15 + 15 + 30 + 25 +
+                                 10 + 15 * MGA_NR_SAREA_CLIPRECTS);
+               PRIM_OVERFLOW(dev, dev_priv, primary_needed);
+               mgaEmitState(dev_priv);
+               do {
+                       if (i < sarea_priv->nbox) {
+                               DRM_DEBUG("idx %d Emit box %d/%d:"
+                                         "%d,%d - %d,%d\n",
+                                         buf->idx,
+                                         i, sarea_priv->nbox,
+                                         sarea_priv->boxes[i].x1,
+                                         sarea_priv->boxes[i].y1,
+                                         sarea_priv->boxes[i].x2,
+                                         sarea_priv->boxes[i].y2);
+
+                               mgaEmitClipRect(dev_priv,
+                                               &sarea_priv->boxes[i]);
+                       }
+
+                       PRIMGETPTR(dev_priv);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_SECADDRESS,
+                                  ((u32) address) | TT_VERTEX);
+                       PRIMOUTREG(MGAREG_SECEND,
+                                  (((u32) (address + length)) | use_agp));
+                       PRIMADVANCE(dev_priv);
+               } while (++i < sarea_priv->nbox);
+       }
+       if (buf_priv->discard) {
+               if (buf_priv->dispatched == 1)
+                       AGEBUF(dev_priv, buf_priv);
+               buf_priv->dispatched = 0;
+               mga_freelist_put(dev, buf);
+       }
+
+
+}
+
+
+static void mga_dma_dispatch_indices(drm_device_t * dev,
+                                    drm_buf_t * buf,
+                                    unsigned int start, unsigned int end)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_buf_priv_t *buf_priv = buf->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int address = (unsigned int) buf->bus_address;
+       int use_agp = PDEA_pagpxfer_enable;
+       int i = 0;
+       int primary_needed;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       DRM_DEBUG("dispatch indices %d addr 0x%x, "
+                 "start 0x%x end 0x%x nbox %d dirty %x\n",
+                 buf->idx, address, start, end,
+                 sarea_priv->nbox, sarea_priv->dirty);
+
+       if (start != end) {
+               /* WARNING: if you change any of the state functions verify
+                * these numbers (Overestimating this doesn't hurt).  
+                */
+               buf_priv->dispatched = 1;
+               primary_needed = (50 + 15 + 15 + 30 + 25 +
+                                 10 + 15 * MGA_NR_SAREA_CLIPRECTS);
+               PRIM_OVERFLOW(dev, dev_priv, primary_needed);
+               mgaEmitState(dev_priv);
+
+               do {
+                       if (i < sarea_priv->nbox) {
+                               DRM_DEBUG("idx %d Emit box %d/%d:"
+                                         "%d,%d - %d,%d\n",
+                                         buf->idx,
+                                         i, sarea_priv->nbox,
+                                         sarea_priv->boxes[i].x1,
+                                         sarea_priv->boxes[i].y1,
+                                         sarea_priv->boxes[i].x2,
+                                         sarea_priv->boxes[i].y2);
+
+                               mgaEmitClipRect(dev_priv,
+                                               &sarea_priv->boxes[i]);
+                       }
+
+                       PRIMGETPTR(dev_priv);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_SETUPADDRESS,
+                                  ((address + start) |
+                                   SETADD_mode_vertlist));
+                       PRIMOUTREG(MGAREG_SETUPEND,
+                                  ((address + end) | use_agp));
+                       PRIMADVANCE(dev_priv);
+               } while (++i < sarea_priv->nbox);
+       }
+       if (buf_priv->discard) {
+               if (buf_priv->dispatched == 1)
+                       AGEBUF(dev_priv, buf_priv);
+               buf_priv->dispatched = 0;
+               mga_freelist_put(dev, buf);
+       }
+}
+
+
+static void mga_dma_dispatch_clear(drm_device_t * dev, int flags,
+                                  unsigned int clear_color,
+                                  unsigned int clear_zval)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->ContextState;
+       int nbox = sarea_priv->nbox;
+       drm_clip_rect_t *pbox = sarea_priv->boxes;
+       unsigned int cmd;
+       int i;
+       int primary_needed;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (dev_priv->sgram)
+               cmd = MGA_CLEAR_CMD | DC_atype_blk;
+       else
+               cmd = MGA_CLEAR_CMD | DC_atype_rstr;
+
+       primary_needed = nbox * 70;
+       if (primary_needed == 0)
+               primary_needed = 70;
+       PRIM_OVERFLOW(dev, dev_priv, primary_needed);
+       PRIMGETPTR(dev_priv);
+
+       for (i = 0; i < nbox; i++) {
+               unsigned int height = pbox[i].y2 - pbox[i].y1;
+
+               DRM_DEBUG("dispatch clear %d,%d-%d,%d flags %x!\n",
+                         pbox[i].x1, pbox[i].y1, pbox[i].x2,
+                         pbox[i].y2, flags);
+
+               if (flags & MGA_FRONT) {
+                       DRM_DEBUG("clear front\n");
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_YDSTLEN,
+                                  (pbox[i].y1 << 16) | height);
+                       PRIMOUTREG(MGAREG_FXBNDRY,
+                                  (pbox[i].x2 << 16) | pbox[i].x1);
+
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_FCOL, clear_color);
+                       PRIMOUTREG(MGAREG_DSTORG, dev_priv->frontOffset);
+                       PRIMOUTREG(MGAREG_DWGCTL + MGAREG_MGA_EXEC, cmd);
+               }
+
+               if (flags & MGA_BACK) {
+                       DRM_DEBUG("clear back\n");
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_YDSTLEN,
+                                  (pbox[i].y1 << 16) | height);
+                       PRIMOUTREG(MGAREG_FXBNDRY,
+                                  (pbox[i].x2 << 16) | pbox[i].x1);
+
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_FCOL, clear_color);
+                       PRIMOUTREG(MGAREG_DSTORG, dev_priv->backOffset);
+                       PRIMOUTREG(MGAREG_DWGCTL + MGAREG_MGA_EXEC, cmd);
+               }
+
+               if (flags & MGA_DEPTH) {
+                       DRM_DEBUG("clear depth\n");
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_YDSTLEN,
+                                  (pbox[i].y1 << 16) | height);
+                       PRIMOUTREG(MGAREG_FXBNDRY,
+                                  (pbox[i].x2 << 16) | pbox[i].x1);
+
+                       PRIMOUTREG(MGAREG_DMAPAD, 0);
+                       PRIMOUTREG(MGAREG_FCOL, clear_zval);
+                       PRIMOUTREG(MGAREG_DSTORG, dev_priv->depthOffset);
+                       PRIMOUTREG(MGAREG_DWGCTL + MGAREG_MGA_EXEC, cmd);
+               }
+       }
+
+       /* Force reset of DWGCTL */
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+       PRIMADVANCE(dev_priv);
+}
+
+static void mga_dma_dispatch_swap(drm_device_t * dev)
+{
+       drm_mga_private_t *dev_priv = dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       unsigned int *regs = sarea_priv->ContextState;
+       int nbox = sarea_priv->nbox;
+       drm_clip_rect_t *pbox = sarea_priv->boxes;
+       int i;
+       int primary_needed;
+       PRIMLOCALS;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       primary_needed = nbox * 5;
+       primary_needed += 65;
+       PRIM_OVERFLOW(dev, dev_priv, primary_needed);
+       PRIMGETPTR(dev_priv);
+
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DWGSYNC, 0x7100);
+       PRIMOUTREG(MGAREG_DWGSYNC, 0x7000);
+
+       PRIMOUTREG(MGAREG_DSTORG, dev_priv->frontOffset);
+       PRIMOUTREG(MGAREG_MACCESS, dev_priv->mAccess);
+       PRIMOUTREG(MGAREG_SRCORG, dev_priv->backOffset);
+       PRIMOUTREG(MGAREG_AR5, dev_priv->stride / 2);
+
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DWGCTL, MGA_COPY_CMD);
+
+       for (i = 0; i < nbox; i++) {
+               unsigned int h = pbox[i].y2 - pbox[i].y1;
+               unsigned int start = pbox[i].y1 * dev_priv->stride / 2;
+
+               DRM_DEBUG("dispatch swap %d,%d-%d,%d!\n",
+                         pbox[i].x1, pbox[i].y1, pbox[i].x2, pbox[i].y2);
+
+               PRIMOUTREG(MGAREG_AR0, start + pbox[i].x2 - 1);
+               PRIMOUTREG(MGAREG_AR3, start + pbox[i].x1);
+               PRIMOUTREG(MGAREG_FXBNDRY,
+                          pbox[i].x1 | ((pbox[i].x2 - 1) << 16));
+               PRIMOUTREG(MGAREG_YDSTLEN + MGAREG_MGA_EXEC,
+                          (pbox[i].y1 << 16) | h);
+       }
+
+       /* Force reset of DWGCTL */
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_DMAPAD, 0);
+       PRIMOUTREG(MGAREG_SRCORG, 0);
+       PRIMOUTREG(MGAREG_DWGCTL, regs[MGA_CTXREG_DWGCTL]);
+
+       PRIMADVANCE(dev_priv);
+}
+
+int mga_clear_bufs(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_mga_private_t *dev_priv =
+           (drm_mga_private_t *) dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       drm_mga_clear_t clear;
+
+       copy_from_user_ret(&clear, (drm_mga_clear_t *) arg, sizeof(clear),
+                          -EFAULT);
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_clear_bufs called without lock held\n");
+               return -EINVAL;
+       }
+
+       if (sarea_priv->nbox > MGA_NR_SAREA_CLIPRECTS)
+               sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS;
+
+       /* Make sure we restore the 3D state next time.
+        */
+       dev_priv->sarea_priv->dirty |= MGA_UPLOAD_CTX;
+       mga_dma_dispatch_clear(dev, clear.flags,
+                              clear.clear_color, clear.clear_depth);
+       PRIMUPDATE(dev_priv);
+       mga_flush_write_combine();
+       mga_dma_schedule(dev, 1);
+       return 0;
+}
+
+int mga_swap_bufs(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_mga_private_t *dev_priv =
+           (drm_mga_private_t *) dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_swap_bufs called without lock held\n");
+               return -EINVAL;
+       }
+
+       if (sarea_priv->nbox > MGA_NR_SAREA_CLIPRECTS)
+               sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS;
+
+       /* Make sure we restore the 3D state next time.
+        */
+       dev_priv->sarea_priv->dirty |= MGA_UPLOAD_CTX;
+       mga_dma_dispatch_swap(dev);
+       PRIMUPDATE(dev_priv);
+       set_bit(MGA_BUF_SWAP_PENDING,
+               &dev_priv->current_prim->buffer_status);
+       mga_flush_write_combine();
+       mga_dma_schedule(dev, 1);
+       return 0;
+}
+
+int mga_iload(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_device_dma_t *dma = dev->dma;
+       drm_mga_private_t *dev_priv =
+           (drm_mga_private_t *) dev->dev_private;
+       drm_mga_sarea_t *sarea_priv = dev_priv->sarea_priv;
+       drm_buf_t *buf;
+       drm_mga_buf_priv_t *buf_priv;
+       drm_mga_iload_t iload;
+       unsigned long bus_address;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       DRM_DEBUG("Starting Iload\n");
+       copy_from_user_ret(&iload, (drm_mga_iload_t *) arg, sizeof(iload),
+                          -EFAULT);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_iload called without lock held\n");
+               return -EINVAL;
+       }
+
+       buf = dma->buflist[iload.idx];
+       buf_priv = buf->dev_private;
+       bus_address = buf->bus_address;
+       DRM_DEBUG("bus_address %lx, length %d, destorg : %x\n",
+                 bus_address, iload.length, iload.destOrg);
+
+       if (mgaVerifyIload(dev_priv,
+                          bus_address, iload.destOrg, iload.length)) {
+               mga_freelist_put(dev, buf);
+               return -EINVAL;
+       }
+
+       sarea_priv->dirty |= MGA_UPLOAD_CTX;
+
+       mga_dma_dispatch_tex_blit(dev, bus_address, iload.length,
+                                 iload.destOrg);
+       AGEBUF(dev_priv, buf_priv);
+       buf_priv->discard = 1;
+       mga_freelist_put(dev, buf);
+       mga_flush_write_combine();
+       mga_dma_schedule(dev, 1);
+       return 0;
+}
+
+int mga_vertex(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_mga_private_t *dev_priv =
+           (drm_mga_private_t *) dev->dev_private;
+       drm_device_dma_t *dma = dev->dma;
+       drm_buf_t *buf;
+       drm_mga_buf_priv_t *buf_priv;
+       drm_mga_vertex_t vertex;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       copy_from_user_ret(&vertex, (drm_mga_vertex_t *) arg,
+                          sizeof(vertex), -EFAULT);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_vertex called without lock held\n");
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("mga_vertex\n");
+
+       buf = dma->buflist[vertex.idx];
+       buf_priv = buf->dev_private;
+
+       buf->used = vertex.used;
+       buf_priv->discard = vertex.discard;
+
+       if (!mgaVerifyState(dev_priv)) {
+               if (vertex.discard) {
+                       if (buf_priv->dispatched == 1)
+                               AGEBUF(dev_priv, buf_priv);
+                       buf_priv->dispatched = 0;
+                       mga_freelist_put(dev, buf);
+               }
+               DRM_DEBUG("bad state\n");
+               return -EINVAL;
+       }
+
+       mga_dma_dispatch_vertex(dev, buf);
+
+       PRIMUPDATE(dev_priv);
+       mga_flush_write_combine();
+       mga_dma_schedule(dev, 1);
+       return 0;
+}
+
+
+int mga_indices(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_mga_private_t *dev_priv =
+           (drm_mga_private_t *) dev->dev_private;
+       drm_device_dma_t *dma = dev->dma;
+       drm_buf_t *buf;
+       drm_mga_buf_priv_t *buf_priv;
+       drm_mga_indices_t indices;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       copy_from_user_ret(&indices, (drm_mga_indices_t *) arg,
+                          sizeof(indices), -EFAULT);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_indices called without lock held\n");
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("mga_indices\n");
+
+       buf = dma->buflist[indices.idx];
+       buf_priv = buf->dev_private;
+
+       buf_priv->discard = indices.discard;
+
+       if (!mgaVerifyState(dev_priv)) {
+               if (indices.discard) {
+                       if (buf_priv->dispatched == 1)
+                               AGEBUF(dev_priv, buf_priv);
+                       buf_priv->dispatched = 0;
+                       mga_freelist_put(dev, buf);
+               }
+               return -EINVAL;
+       }
+
+       mga_dma_dispatch_indices(dev, buf, indices.start, indices.end);
+
+       PRIMUPDATE(dev_priv);
+       mga_flush_write_combine();
+       mga_dma_schedule(dev, 1);
+       return 0;
+}
+
+
+
+static int mga_dma_get_buffers(drm_device_t * dev, drm_dma_t * d)
+{
+       int i;
+       drm_buf_t *buf;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       for (i = d->granted_count; i < d->request_count; i++) {
+               buf = mga_freelist_get(dev);
+               if (!buf)
+                       break;
+               buf->pid = current->pid;
+               copy_to_user_ret(&d->request_indices[i],
+                                &buf->idx, sizeof(buf->idx), -EFAULT);
+               copy_to_user_ret(&d->request_sizes[i],
+                                &buf->total, sizeof(buf->total), -EFAULT);
+               ++d->granted_count;
+       }
+       return 0;
+}
+
+int mga_dma(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_device_dma_t *dma = dev->dma;
+       int retcode = 0;
+       drm_dma_t d;
+       DRM_DEBUG("%s\n", __FUNCTION__);
+
+       copy_from_user_ret(&d, (drm_dma_t *) arg, sizeof(d), -EFAULT);
+       DRM_DEBUG("%d %d: %d send, %d req\n",
+                 current->pid, d.context, d.send_count, d.request_count);
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+               DRM_ERROR("mga_dma called without lock held\n");
+               return -EINVAL;
+       }
+
+       /* Please don't send us buffers.
+        */
+       if (d.send_count != 0) {
+               DRM_ERROR
+                   ("Process %d trying to send %d buffers via drmDMA\n",
+                    current->pid, d.send_count);
+               return -EINVAL;
+       }
+
+       /* We'll send you buffers.
+        */
+       if (d.request_count < 0 || d.request_count > dma->buf_count) {
+               DRM_ERROR
+                   ("Process %d trying to get %d buffers (of %d max)\n",
+                    current->pid, d.request_count, dma->buf_count);
+               return -EINVAL;
+       }
+
+       d.granted_count = 0;
+
+       if (d.request_count) {
+               retcode = mga_dma_get_buffers(dev, &d);
+       }
+
+       DRM_DEBUG("%d returning, granted = %d\n",
+                 current->pid, d.granted_count);
+       copy_to_user_ret((drm_dma_t *) arg, &d, sizeof(d), -EFAULT);
+       return retcode;
+}
index 7f85da2c93fe4beb7092e53232bff336bb23d855..24dfe5f3560f91b0b65687d6597e28a51d59fc5b 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan 11 09:48:47 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
- * 
- * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
  *
+ * Authors:
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  */
 
 #define __NO_VERSION__
@@ -164,7 +164,10 @@ static int _drm_vm_info(char *buf, char **start, off_t offset, int len,
 {
        drm_device_t *dev = (drm_device_t *)data;
        drm_map_t    *map;
-       const char   *types[] = { "FB", "REG", "SHM" };
+                               /* Hardcoded from _DRM_FRAME_BUFFER,
+                                   _DRM_REGISTERS, _DRM_SHM, and
+                                   _DRM_AGP. */
+       const char   *types[] = { "FB", "REG", "SHM", "AGP" };
        const char   *type;
        int          i;
 
@@ -175,7 +178,7 @@ static int _drm_vm_info(char *buf, char **start, off_t offset, int len,
                       "address mtrr\n\n");
        for (i = 0; i < dev->map_count; i++) {
                map = dev->maplist[i];
-               if (map->type < 0 || map->type > 2) type = "??";
+               if (map->type < 0 || map->type > 3) type = "??";
                else                                type = types[map->type];
                DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s  0x%02x 0x%08lx ",
                               i,
@@ -348,17 +351,21 @@ static int drm_clients_info(char *buf, char **start, off_t offset, int len,
 
 #if DRM_DEBUG_CODE
 
+#define DRM_VMA_VERBOSE 0
+
 static int _drm_vma_info(char *buf, char **start, off_t offset, int len,
                         int *eof, void *data)
 {
        drm_device_t          *dev = (drm_device_t *)data;
        drm_vma_entry_t       *pt;
+       struct vm_area_struct *vma;
+#if DRM_VMA_VERBOSE
+       unsigned long         i;
+       unsigned long         address;
        pgd_t                 *pgd;
        pmd_t                 *pmd;
        pte_t                 *pte;
-       unsigned long         i;
-       struct vm_area_struct *vma;
-       unsigned long         address;
+#endif
 #if defined(__i386__)
        unsigned int          pgprot;
 #endif
@@ -397,6 +404,7 @@ static int _drm_vma_info(char *buf, char **start, off_t offset, int len,
                               pgprot & _PAGE_GLOBAL   ? 'g' : 'l' );
 #endif         
                DRM_PROC_PRINT("\n");
+#if 0
                for (i = vma->vm_start; i < vma->vm_end; i += PAGE_SIZE) {
                        pgd = pgd_offset(vma->vm_mm, i);
                        pmd = pmd_offset(pgd, i);
@@ -417,6 +425,7 @@ static int _drm_vma_info(char *buf, char **start, off_t offset, int len,
                                DRM_PROC_PRINT("      0x%08lx\n", i);
                        }
                }
+#endif
        }
        
        return len;
@@ -512,9 +521,9 @@ static int _drm_histo_info(char *buf, char **start, off_t offset, int len,
        } else {
                DRM_PROC_PRINT("lock                 none\n");
        }
-       DRM_PROC_PRINT("context_flag   0x%08lx\n", dev->context_flag);
-       DRM_PROC_PRINT("interrupt_flag 0x%08lx\n", dev->interrupt_flag);
-       DRM_PROC_PRINT("dma_flag       0x%08lx\n", dev->dma_flag);
+       DRM_PROC_PRINT("context_flag   0x%08x\n", dev->context_flag);
+       DRM_PROC_PRINT("interrupt_flag 0x%08x\n", dev->interrupt_flag);
+       DRM_PROC_PRINT("dma_flag       0x%08x\n", dev->dma_flag);
 
        DRM_PROC_PRINT("queue_count    %10d\n",  dev->queue_count);
        DRM_PROC_PRINT("last_context   %10d\n",  dev->last_context);
diff --git a/drivers/char/drm/r128_bufs.c b/drivers/char/drm/r128_bufs.c
new file mode 100644 (file)
index 0000000..e8ff4df
--- /dev/null
@@ -0,0 +1,308 @@
+/* r128_bufs.c -- IOCTLs to manage buffers -*- linux-c -*-
+ * Created: Wed Apr 12 16:19:08 2000 by kevin@precisioninsight.com
+ *
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Authors: Kevin E. Martin <martin@valinux.com>
+ *          Rickard E. (Rik) Faith <faith@valinux.com>
+ *         Jeff Hartmann <jhartmann@valinux.com>
+ * 
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "r128_drv.h"
+#include "linux/un.h"
+
+
+#ifdef DRM_AGP
+int r128_addbufs_agp(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_device_dma_t *dma  = dev->dma;
+       drm_buf_desc_t    request;
+       drm_buf_entry_t  *entry;
+       drm_buf_t        *buf;
+       unsigned long     offset;
+       unsigned long     agp_offset;
+       int               count;
+       int               order;
+       int               size;
+       int               alignment;
+       int               page_order;
+       int               total;
+       int               byte_count;
+       int               i;
+
+       if (!dma) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       count      = request.count;
+       order      = drm_order(request.size);
+       size       = 1 << order;
+
+       alignment  = (request.flags & _DRM_PAGE_ALIGN) ? PAGE_ALIGN(size):size;
+       page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
+       total      = PAGE_SIZE << page_order;
+
+       byte_count = 0;
+       agp_offset = dev->agp->base + request.agp_start;
+
+       DRM_DEBUG("count:      %d\n",  count);
+       DRM_DEBUG("order:      %d\n",  order);
+       DRM_DEBUG("size:       %d\n",  size);
+       DRM_DEBUG("agp_offset: %ld\n", agp_offset);
+       DRM_DEBUG("alignment:  %d\n",  alignment);
+       DRM_DEBUG("page_order: %d\n",  page_order);
+       DRM_DEBUG("total:      %d\n",  total);
+
+       if (order < DRM_MIN_ORDER || order > DRM_MAX_ORDER) return -EINVAL;
+       if (dev->queue_count) return -EBUSY; /* Not while in use */
+
+       spin_lock(&dev->count_lock);
+       if (dev->buf_use) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       atomic_inc(&dev->buf_alloc);
+       spin_unlock(&dev->count_lock);
+   
+       down(&dev->struct_sem);
+       entry = &dma->bufs[order];
+       if (entry->buf_count) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM; /* May only call once for each order */
+       }
+   
+       entry->buflist = drm_alloc(count * sizeof(*entry->buflist),
+                                  DRM_MEM_BUFS);
+       if (!entry->buflist) {
+               up(&dev->struct_sem);
+               atomic_dec(&dev->buf_alloc);
+               return -ENOMEM;
+       }
+       memset(entry->buflist, 0, count * sizeof(*entry->buflist));
+   
+       entry->buf_size   = size;
+       entry->page_order = page_order;
+       offset            = 0;
+
+       for (offset = 0;
+            entry->buf_count < count;
+            offset += alignment, ++entry->buf_count) {
+               buf          = &entry->buflist[entry->buf_count];
+               buf->idx     = dma->buf_count + entry->buf_count;
+               buf->total   = alignment;
+               buf->order   = order;
+               buf->used    = 0;
+               buf->offset  = (dma->byte_count + offset);
+               buf->address = (void *)(agp_offset + offset);
+               buf->next    = NULL;
+               buf->waiting = 0;
+               buf->pending = 0;
+               init_waitqueue_head(&buf->dma_wait);
+               buf->pid     = 0;
+
+               buf->dev_priv_size = sizeof(drm_r128_buf_priv_t);
+               buf->dev_private   = drm_alloc(sizeof(drm_r128_buf_priv_t),
+                                              DRM_MEM_BUFS);
+               memset(buf->dev_private, 0, buf->dev_priv_size);
+
+#if DRM_DMA_HISTOGRAM
+               buf->time_queued     = 0;
+               buf->time_dispatched = 0;
+               buf->time_completed  = 0;
+               buf->time_freed      = 0;
+#endif
+
+               byte_count += PAGE_SIZE << page_order;
+
+               DRM_DEBUG("buffer %d @ %p\n",
+                         entry->buf_count, buf->address);
+       }
+
+       DRM_DEBUG("byte_count: %d\n", byte_count);
+
+       dma->buflist = drm_realloc(dma->buflist,
+                                  dma->buf_count * sizeof(*dma->buflist),
+                                  (dma->buf_count + entry->buf_count)
+                                  * sizeof(*dma->buflist),
+                                  DRM_MEM_BUFS);
+       for (i = dma->buf_count; i < dma->buf_count + entry->buf_count; i++)
+               dma->buflist[i] = &entry->buflist[i - dma->buf_count];
+
+       dma->buf_count  += entry->buf_count;
+       dma->byte_count += byte_count;
+
+       drm_freelist_create(&entry->freelist, entry->buf_count);
+       for (i = 0; i < entry->buf_count; i++) {
+               drm_freelist_put(dev, &entry->freelist, &entry->buflist[i]);
+       }
+
+       up(&dev->struct_sem);
+
+       request.count = entry->buf_count;
+       request.size  = size;
+
+       copy_to_user_ret((drm_buf_desc_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+
+       dma->flags = _DRM_DMA_USE_AGP;
+
+       atomic_dec(&dev->buf_alloc);
+       return 0;
+}
+#endif
+
+int r128_addbufs(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_r128_private_t      *dev_priv       = dev->dev_private;
+       drm_buf_desc_t          request;
+
+       if (!dev_priv || dev_priv->is_pci) return -EINVAL;
+
+       copy_from_user_ret(&request,
+                          (drm_buf_desc_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+#ifdef DRM_AGP
+       if (request.flags & _DRM_AGP_BUFFER)
+               return r128_addbufs_agp(inode, filp, cmd, arg);
+       else
+#endif
+               return -EINVAL;
+}
+
+int r128_mapbufs(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_r128_private_t      *dev_priv       = dev->dev_private;
+       drm_device_dma_t        *dma            = dev->dma;
+       int                      retcode        = 0;
+       const int                zero           = 0;
+       unsigned long            virtual;
+       unsigned long            address;
+       drm_buf_map_t            request;
+       int                      i;
+
+       if (!dma || !dev_priv || dev_priv->is_pci) return -EINVAL;
+
+       DRM_DEBUG("\n");
+
+       spin_lock(&dev->count_lock);
+       if (atomic_read(&dev->buf_alloc)) {
+               spin_unlock(&dev->count_lock);
+               return -EBUSY;
+       }
+       ++dev->buf_use;         /* Can't allocate more after this call */
+       spin_unlock(&dev->count_lock);
+
+       copy_from_user_ret(&request,
+                          (drm_buf_map_t *)arg,
+                          sizeof(request),
+                          -EFAULT);
+
+       if (request.count >= dma->buf_count) {
+               if (dma->flags & _DRM_DMA_USE_AGP) {
+                       drm_map_t *map;
+
+                       map = dev_priv->agp_vertbufs;
+                       if (!map) {
+                               retcode = -EINVAL;
+                               goto done;
+                       }
+
+                       down(&current->mm->mmap_sem);
+                       virtual = do_mmap(filp, 0, map->size, 
+                                         PROT_READ|PROT_WRITE,
+                                         MAP_SHARED, 
+                                         (unsigned long)map->offset);
+                       up(&current->mm->mmap_sem);
+               } else {
+                       down(&current->mm->mmap_sem);
+                       virtual = do_mmap(filp, 0, dma->byte_count,
+                                         PROT_READ|PROT_WRITE, MAP_SHARED, 0);
+                       up(&current->mm->mmap_sem);
+               }
+               if (virtual > -1024UL) {
+                       /* Real error */
+                       retcode = (signed long)virtual;
+                       goto done;
+               }
+               request.virtual = (void *)virtual;
+
+               for (i = 0; i < dma->buf_count; i++) {
+                       if (copy_to_user(&request.list[i].idx,
+                                        &dma->buflist[i]->idx,
+                                        sizeof(request.list[0].idx))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       if (copy_to_user(&request.list[i].total,
+                                        &dma->buflist[i]->total,
+                                        sizeof(request.list[0].total))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       if (copy_to_user(&request.list[i].used,
+                                        &zero,
+                                        sizeof(zero))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+                       address = virtual + dma->buflist[i]->offset;
+                       if (copy_to_user(&request.list[i].address,
+                                        &address,
+                                        sizeof(address))) {
+                               retcode = -EFAULT;
+                               goto done;
+                       }
+               }
+       }
+ done:
+       request.count = dma->buf_count;
+       DRM_DEBUG("%d buffers, retcode = %d\n", request.count, retcode);
+
+       copy_to_user_ret((drm_buf_map_t *)arg,
+                        &request,
+                        sizeof(request),
+                        -EFAULT);
+
+       return retcode;
+}
diff --git a/drivers/char/drm/r128_context.c b/drivers/char/drm/r128_context.c
new file mode 100644 (file)
index 0000000..f11453b
--- /dev/null
@@ -0,0 +1,213 @@
+/* r128_context.c -- IOCTLs for r128 contexts -*- linux-c -*-
+ * Created: Mon Dec 13 09:51:35 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Author: Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#include <linux/sched.h>
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "r128_drv.h"
+
+extern drm_ctx_t r128_res_ctx;
+
+static int r128_alloc_queue(drm_device_t *dev)
+{
+#if 0
+       static int context = 0;
+#endif
+
+       return drm_ctxbitmap_next(dev);
+}
+
+int r128_context_switch(drm_device_t *dev, int old, int new)
+{
+        char        buf[64];
+
+        atomic_inc(&dev->total_ctx);
+
+        if (test_and_set_bit(0, &dev->context_flag)) {
+                DRM_ERROR("Reentering -- FIXME\n");
+                return -EBUSY;
+        }
+
+#if DRM_DMA_HISTOGRAM
+        dev->ctx_start = get_cycles();
+#endif
+        
+        DRM_DEBUG("Context switch from %d to %d\n", old, new);
+
+        if (new == dev->last_context) {
+                clear_bit(0, &dev->context_flag);
+                return 0;
+        }
+        
+        if (drm_flags & DRM_FLAG_NOCTX) {
+                r128_context_switch_complete(dev, new);
+        } else {
+                sprintf(buf, "C %d %d\n", old, new);
+                drm_write_string(dev, buf);
+        }
+        
+        return 0;
+}
+
+int r128_context_switch_complete(drm_device_t *dev, int new)
+{
+        dev->last_context = new;  /* PRE/POST: This is the _only_ writer. */
+        dev->last_switch  = jiffies;
+        
+        if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
+                DRM_ERROR("Lock isn't held after context switch\n");
+        }
+
+                               /* If a context switch is ever initiated
+                                   when the kernel holds the lock, release
+                                   that lock here. */
+#if DRM_DMA_HISTOGRAM
+        atomic_inc(&dev->histo.ctx[drm_histogram_slot(get_cycles()
+                                                      - dev->ctx_start)]);
+                   
+#endif
+        clear_bit(0, &dev->context_flag);
+        wake_up(&dev->context_wait);
+        
+        return 0;
+}
+
+
+int r128_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
+              unsigned long arg)
+{
+       drm_ctx_res_t   res;
+       drm_ctx_t       ctx;
+       int             i;
+
+       DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
+       copy_from_user_ret(&res, (drm_ctx_res_t *)arg, sizeof(res), -EFAULT);
+       if (res.count >= DRM_RESERVED_CONTEXTS) {
+               memset(&ctx, 0, sizeof(ctx));
+               for (i = 0; i < DRM_RESERVED_CONTEXTS; i++) {
+                       ctx.handle = i;
+                       copy_to_user_ret(&res.contexts[i],
+                                        &i,
+                                        sizeof(i),
+                                        -EFAULT);
+               }
+       }
+       res.count = DRM_RESERVED_CONTEXTS;
+       copy_to_user_ret((drm_ctx_res_t *)arg, &res, sizeof(res), -EFAULT);
+       return 0;
+}
+
+
+int r128_addctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       if ((ctx.handle = r128_alloc_queue(dev)) == DRM_KERNEL_CONTEXT) {
+                               /* Skip kernel's context and get a new one. */
+               ctx.handle = r128_alloc_queue(dev);
+       }
+       DRM_DEBUG("%d\n", ctx.handle);
+       if (ctx.handle == -1) {
+               DRM_DEBUG("Not enough free contexts.\n");
+                               /* Should this return -EBUSY instead? */
+               return -ENOMEM;
+       }
+
+       copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int r128_modctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       drm_ctx_t ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT);
+       if (ctx.flags==_DRM_CONTEXT_PRESERVED)
+               r128_res_ctx.handle=ctx.handle;
+       return 0;
+}
+
+int r128_getctx(struct inode *inode, struct file *filp, unsigned int cmd,
+       unsigned long arg)
+{
+       drm_ctx_t ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t*)arg, sizeof(ctx), -EFAULT);
+       /* This is 0, because we don't hanlde any context flags */
+       ctx.flags = 0;
+       copy_to_user_ret((drm_ctx_t*)arg, &ctx, sizeof(ctx), -EFAULT);
+       return 0;
+}
+
+int r128_switchctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       return r128_context_switch(dev, dev->last_context, ctx.handle);
+}
+
+int r128_newctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       r128_context_switch_complete(dev, ctx.handle);
+
+       return 0;
+}
+
+int r128_rmctx(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_ctx_t       ctx;
+
+       copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
+       DRM_DEBUG("%d\n", ctx.handle);
+       drm_ctxbitmap_free(dev, ctx.handle);
+
+       return 0;
+}
diff --git a/drivers/char/drm/r128_dma.c b/drivers/char/drm/r128_dma.c
new file mode 100644 (file)
index 0000000..16f79c1
--- /dev/null
@@ -0,0 +1,922 @@
+/* r128_drv.c -- ATI Rage 128 driver -*- linux-c -*-
+ * Created: Wed Apr  5 19:24:19 2000 by kevin@precisioninsight.com
+ *
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Kevin E. Martin <martin@valinux.com>
+ *
+ */
+
+#define __NO_VERSION__
+#include "drmP.h"
+#include "r128_drv.h"
+
+#include <linux/interrupt.h>   /* For task queue support */
+#include <linux/delay.h>
+
+
+
+#define DO_REMAP(_m) (_m)->handle = drm_ioremap((_m)->offset, (_m)->size)
+
+#define DO_REMAPFREE(_m)                                                    \
+       do {                                                                \
+               if ((_m)->handle && (_m)->size)                             \
+                       drm_ioremapfree((_m)->handle, (_m)->size);          \
+       } while (0)
+
+#define DO_FIND_MAP(_m, _o)                                                 \
+       do {                                                                \
+               int _i;                                                     \
+               for (_i = 0; _i < dev->map_count; _i++) {                   \
+                       if (dev->maplist[_i]->offset == _o) {               \
+                               _m = dev->maplist[_i];                      \
+                               break;                                      \
+                       }                                                   \
+               }                                                           \
+       } while (0)
+
+
+#define R128_MAX_VBUF_AGE      0x10000000
+#define R128_VB_AGE_REG                R128_GUI_SCRATCH_REG0
+
+int R128_READ_PLL(drm_device_t *dev, int addr)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+
+       R128_WRITE8(R128_CLOCK_CNTL_INDEX, addr & 0x1f);
+       return R128_READ(R128_CLOCK_CNTL_DATA);
+}
+
+static void r128_flush_write_combine(void)
+{
+       int xchangeDummy;
+
+       __asm__ volatile("push %%eax ;"
+                        "xchg %%eax, %0 ;"
+                        "pop %%eax" : : "m" (xchangeDummy));
+       __asm__ volatile("push %%eax ;"
+                        "push %%ebx ;"
+                        "push %%ecx ;"
+                        "push %%edx ;"
+                        "movl $0,%%eax ;"
+                        "cpuid ;"
+                        "pop %%edx ;"
+                        "pop %%ecx ;"
+                        "pop %%ebx ;"
+                        "pop %%eax" : /* no outputs */ :  /* no inputs */ );
+}
+
+static void r128_status(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+
+       printk("GUI_STAT           = 0x%08x\n",
+              (unsigned int)R128_READ(R128_GUI_STAT));
+       printk("PM4_STAT           = 0x%08x\n",
+              (unsigned int)R128_READ(R128_PM4_STAT));
+       printk("PM4_BUFFER_DL_WPTR = 0x%08x\n",
+              (unsigned int)R128_READ(R128_PM4_BUFFER_DL_WPTR));
+       printk("PM4_BUFFER_DL_RPTR = 0x%08x\n",
+              (unsigned int)R128_READ(R128_PM4_BUFFER_DL_RPTR));
+}
+
+static int r128_do_cleanup_cce(drm_device_t *dev)
+{
+       if (dev->dev_private) {
+               drm_r128_private_t *dev_priv = dev->dev_private;
+
+               if (!dev_priv->is_pci) {
+                       DO_REMAPFREE(dev_priv->agp_ring);
+                       DO_REMAPFREE(dev_priv->agp_read_ptr);
+                       DO_REMAPFREE(dev_priv->agp_vertbufs);
+                       DO_REMAPFREE(dev_priv->agp_indbufs);
+                       DO_REMAPFREE(dev_priv->agp_textures);
+               }
+
+               drm_free(dev->dev_private, sizeof(drm_r128_private_t),
+                        DRM_MEM_DRIVER);
+               dev->dev_private = NULL;
+       }
+
+       return 0;
+}
+
+static int r128_do_init_cce(drm_device_t *dev, drm_r128_init_t *init)
+{
+       drm_r128_private_t *dev_priv;
+        int                 i;
+
+       dev_priv = drm_alloc(sizeof(drm_r128_private_t), DRM_MEM_DRIVER);
+       if (dev_priv == NULL) return -ENOMEM;
+       dev->dev_private = (void *)dev_priv;
+
+       memset(dev_priv, 0, sizeof(drm_r128_private_t));
+
+       dev_priv->is_pci         = init->is_pci;
+
+       dev_priv->usec_timeout   = init->usec_timeout;
+       if (dev_priv->usec_timeout < 1 ||
+           dev_priv->usec_timeout > R128_MAX_USEC_TIMEOUT) {
+               drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER);
+               dev->dev_private = NULL;
+               return -EINVAL;
+       }
+
+       dev_priv->cce_mode       = init->cce_mode;
+       dev_priv->cce_fifo_size  = init->cce_fifo_size;
+       dev_priv->cce_is_bm_mode =
+               ((init->cce_mode == R128_PM4_192BM) ||
+                (init->cce_mode == R128_PM4_128BM_64INDBM) ||
+                (init->cce_mode == R128_PM4_64BM_128INDBM) ||
+                (init->cce_mode == R128_PM4_64BM_64VCBM_64INDBM));
+       dev_priv->cce_secure     = init->cce_secure;
+
+       if (dev_priv->cce_is_bm_mode && dev_priv->is_pci) {
+               drm_free(dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER);
+               dev->dev_private = NULL;
+               return -EINVAL;
+       }
+
+       for (i = 0; i < dev->map_count; i++) {
+               if (dev->maplist[i]->type == _DRM_SHM) {
+                       dev_priv->sarea = dev->maplist[i];
+                       break;
+               }
+       }
+
+       DO_FIND_MAP(dev_priv->fb,           init->fb_offset);
+       if (!dev_priv->is_pci) {
+               DO_FIND_MAP(dev_priv->agp_ring,     init->agp_ring_offset);
+               DO_FIND_MAP(dev_priv->agp_read_ptr, init->agp_read_ptr_offset);
+               DO_FIND_MAP(dev_priv->agp_vertbufs, init->agp_vertbufs_offset);
+               DO_FIND_MAP(dev_priv->agp_indbufs,  init->agp_indbufs_offset);
+               DO_FIND_MAP(dev_priv->agp_textures, init->agp_textures_offset);
+       }
+       DO_FIND_MAP(dev_priv->mmio,         init->mmio_offset);
+
+       dev_priv->sarea_priv =
+               (drm_r128_sarea_t *)((u8 *)dev_priv->sarea->handle +
+                                    init->sarea_priv_offset);
+
+       if (!dev_priv->is_pci) {
+               DO_REMAP(dev_priv->agp_ring);
+               DO_REMAP(dev_priv->agp_read_ptr);
+               DO_REMAP(dev_priv->agp_vertbufs);
+#if 0
+               DO_REMAP(dev_priv->agp_indirectbufs);
+               DO_REMAP(dev_priv->agp_textures);
+#endif
+
+               dev_priv->ring_size     = init->ring_size;
+               dev_priv->ring_sizel2qw = drm_order(init->ring_size/8);
+               dev_priv->ring_entries  = init->ring_size/sizeof(u32);
+               dev_priv->ring_read_ptr = ((__volatile__ u32 *)
+                                          dev_priv->agp_read_ptr->handle);
+               dev_priv->ring_start    = (u32 *)dev_priv->agp_ring->handle;
+               dev_priv->ring_end      = ((u32 *)dev_priv->agp_ring->handle
+                                          + dev_priv->ring_entries);
+       }
+
+       dev_priv->submit_age    = 0;
+       R128_WRITE(R128_VB_AGE_REG, dev_priv->submit_age);
+
+       return 0;
+}
+
+int r128_init_cce(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_r128_init_t    init;
+
+       copy_from_user_ret(&init, (drm_r128_init_t *)arg, sizeof(init),
+                          -EFAULT);
+
+       switch (init.func) {
+       case R128_INIT_CCE:
+               return r128_do_init_cce(dev, &init);
+       case R128_CLEANUP_CCE:
+               return r128_do_cleanup_cce(dev);
+       }
+
+       return -EINVAL;
+}
+
+static void r128_mark_vertbufs_done(drm_device_t *dev)
+{
+       drm_device_dma_t   *dma      = dev->dma;
+       int                 i;
+
+       for (i = 0; i < dma->buf_count; i++) {
+               drm_buf_t           *buf      = dma->buflist[i];
+               drm_r128_buf_priv_t *buf_priv = buf->dev_private;
+               buf_priv->age = 0;
+       }
+}
+
+static int r128_do_pixcache_flush(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       u32                 tmp;
+       int                 i;
+
+       tmp = R128_READ(R128_PC_NGUI_CTLSTAT) | R128_PC_FLUSH_ALL;
+       R128_WRITE(R128_PC_NGUI_CTLSTAT, tmp);
+
+       for (i = 0; i < dev_priv->usec_timeout; i++) {
+               if (!(R128_READ(R128_PC_NGUI_CTLSTAT) & R128_PC_BUSY))
+                       return 0;
+               udelay(1);
+       }
+
+       return -EBUSY;
+}
+
+static int r128_do_wait_for_fifo(drm_device_t *dev, int entries)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 i;
+
+       for (i = 0; i < dev_priv->usec_timeout; i++) {
+               int slots = R128_READ(R128_GUI_STAT) & R128_GUI_FIFOCNT_MASK;
+               if (slots >= entries) return 0;
+               udelay(1);
+       }
+       return -EBUSY;
+}
+
+static int r128_do_wait_for_idle(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 i, ret;
+
+       if (!(ret = r128_do_wait_for_fifo(dev, 64))) return ret;
+
+       for (i = 0; i < dev_priv->usec_timeout; i++) {
+               if (!(R128_READ(R128_GUI_STAT) & R128_GUI_ACTIVE)) {
+                       (void)r128_do_pixcache_flush(dev);
+                       return 0;
+               }
+               udelay(1);
+       }
+       return -EBUSY;
+}
+
+int r128_do_engine_reset(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       u32                 clock_cntl_index, mclk_cntl, gen_reset_cntl;
+
+       (void)r128_do_pixcache_flush(dev);
+
+       clock_cntl_index = R128_READ(R128_CLOCK_CNTL_INDEX);
+       mclk_cntl        = R128_READ_PLL(dev, R128_MCLK_CNTL);
+
+       R128_WRITE_PLL(R128_MCLK_CNTL,
+                      mclk_cntl | R128_FORCE_GCP | R128_FORCE_PIPE3D_CP);
+
+       gen_reset_cntl   = R128_READ(R128_GEN_RESET_CNTL);
+
+       R128_WRITE(R128_GEN_RESET_CNTL, gen_reset_cntl | R128_SOFT_RESET_GUI);
+       (void)R128_READ(R128_GEN_RESET_CNTL);
+       R128_WRITE(R128_GEN_RESET_CNTL, gen_reset_cntl & ~R128_SOFT_RESET_GUI);
+       (void)R128_READ(R128_GEN_RESET_CNTL);
+
+       R128_WRITE_PLL(R128_MCLK_CNTL,    mclk_cntl);
+       R128_WRITE(R128_CLOCK_CNTL_INDEX, clock_cntl_index);
+       R128_WRITE(R128_GEN_RESET_CNTL,   gen_reset_cntl);
+
+       /* For CCE ring buffer only */
+       if (dev_priv->cce_is_bm_mode) {
+               R128_WRITE(R128_PM4_BUFFER_DL_WPTR, 0);
+               R128_WRITE(R128_PM4_BUFFER_DL_RPTR, 0);
+               *dev_priv->ring_read_ptr = 0;
+               dev_priv->sarea_priv->ring_write = 0;
+       }
+
+       /* Reset the CCE mode */
+       (void)r128_do_wait_for_idle(dev);
+       R128_WRITE(R128_PM4_BUFFER_CNTL,
+                  dev_priv->cce_mode | dev_priv->ring_sizel2qw);
+       (void)R128_READ(R128_PM4_BUFFER_ADDR); /* as per the sample code */
+       R128_WRITE(R128_PM4_MICRO_CNTL, R128_PM4_MICRO_FREERUN);
+
+       r128_mark_vertbufs_done(dev);
+       return 0;
+}
+
+int r128_eng_reset(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;
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
+           dev->lock.pid != current->pid) {
+               DRM_ERROR("r128_eng_reset called without holding the lock\n");
+               return -EINVAL;
+       }
+
+       return r128_do_engine_reset(dev);
+}
+
+static int r128_do_engine_flush(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       u32                 tmp;
+
+       tmp = R128_READ(R128_PM4_BUFFER_DL_WPTR);
+       R128_WRITE(R128_PM4_BUFFER_DL_WPTR, tmp | R128_PM4_BUFFER_DL_DONE);
+
+       return 0;
+}
+
+int r128_eng_flush(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;
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
+           dev->lock.pid != current->pid) {
+               DRM_ERROR("r128_eng_flush called without holding the lock\n");
+               return -EINVAL;
+       }
+
+       return r128_do_engine_flush(dev);
+}
+
+static int r128_do_cce_wait_for_fifo(drm_device_t *dev, int entries)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 i;
+
+       for (i = 0; i < dev_priv->usec_timeout; i++) {
+               int slots = R128_READ(R128_PM4_STAT) & R128_PM4_FIFOCNT_MASK;
+               if (slots >= entries) return 0;
+               udelay(1);
+       }
+       return -EBUSY;
+}
+
+int r128_do_cce_wait_for_idle(drm_device_t *dev)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 i;
+
+       if (dev_priv->cce_is_bm_mode) {
+               for (i = 0; i < dev_priv->usec_timeout; i++) {
+                       if (*dev_priv->ring_read_ptr == dev_priv->sarea_priv->ring_write) {
+                               int pm4stat = R128_READ(R128_PM4_STAT);
+                               if ((pm4stat & R128_PM4_FIFOCNT_MASK) >= dev_priv->cce_fifo_size &&
+                                   !(pm4stat & (R128_PM4_BUSY | R128_PM4_GUI_ACTIVE))) {
+                                       return r128_do_pixcache_flush(dev);
+                               }
+                       }
+                       udelay(1);
+               }
+               return -EBUSY;
+       } else {
+               int ret = r128_do_cce_wait_for_fifo(dev, dev_priv->cce_fifo_size);
+               if (ret < 0) return ret;
+
+               for (i = 0; i < dev_priv->usec_timeout; i++) {
+                       int pm4stat = R128_READ(R128_PM4_STAT);
+                       if (!(pm4stat & (R128_PM4_BUSY | R128_PM4_GUI_ACTIVE))) {
+                               return r128_do_pixcache_flush(dev);
+                       }
+                       udelay(1);
+               }
+               return -EBUSY;
+       }
+}
+
+int r128_cce_idle(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;
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
+           dev->lock.pid != current->pid) {
+               DRM_ERROR("r128_wait_idle called without holding the lock\n");
+               return -EINVAL;
+       }
+
+       return r128_do_cce_wait_for_idle(dev);
+}
+
+static int r128_submit_packets_ring_secure(drm_device_t *dev,
+                                          u32 *commands, int *count)
+{
+       drm_r128_private_t *dev_priv  = dev->dev_private;
+       int                 write     = dev_priv->sarea_priv->ring_write;
+       int                *write_ptr = dev_priv->ring_start + write;
+       int                 c         = *count;
+       u32                 tmp       = 0;
+       int                 psize     = 0;
+       int                 writing   = 1;
+       int                 timeout;
+
+       while (c > 0) {
+               tmp = *commands++;
+               if (!psize) {
+                       writing = 1;
+
+                       if ((tmp & R128_CCE_PACKET_MASK) == R128_CCE_PACKET0) {
+                               if ((tmp & R128_CCE_PACKET0_REG_MASK) <= (0x1004 >> 2)) {
+                                       if ((tmp & R128_CCE_PACKET0_REG_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP >> 2)) {
+                                               writing = 0;
+                                       }
+                               }
+                               psize = ((tmp & R128_CCE_PACKET_COUNT_MASK) >> 16) + 2;
+                       } else if ((tmp & R128_CCE_PACKET_MASK) == R128_CCE_PACKET1) {
+                               if ((tmp & R128_CCE_PACKET1_REG0_MASK) <= (0x1004 >> 2)) {
+                                       if ((tmp & R128_CCE_PACKET1_REG0_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP >> 2)) {
+                                               writing = 0;
+                                       }
+                               } else if ((tmp & R128_CCE_PACKET1_REG1_MASK) <=
+                                          (0x1004 << 9)) {
+                                       if ((tmp & R128_CCE_PACKET1_REG1_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP << 9)) {
+                                               writing = 0;
+                                       }
+                               }
+                               psize = 3;
+                       } else {
+                               psize = ((tmp & R128_CCE_PACKET_COUNT_MASK) >> 16) + 2;
+                       }
+               }
+               psize--;
+
+               if (writing) {
+                       write++;
+                       *write_ptr++ = tmp;
+               }
+               if (write >= dev_priv->ring_entries) {
+                       write     = 0;
+                       write_ptr = dev_priv->ring_start;
+               }
+               timeout = 0;
+               while (write == *dev_priv->ring_read_ptr) {
+                       (void)R128_READ(R128_PM4_BUFFER_DL_RPTR);
+                       if (timeout++ >= dev_priv->usec_timeout)
+                               return -EBUSY;
+                       udelay(1);
+               }
+               c--;
+       }
+
+       if (write < 32)
+           memcpy(dev_priv->ring_end,
+                  dev_priv->ring_start,
+                  write * sizeof(u32));
+
+       /* Make sure WC cache has been flushed */
+       r128_flush_write_combine();
+
+       dev_priv->sarea_priv->ring_write = write;
+       R128_WRITE(R128_PM4_BUFFER_DL_WPTR, write);
+
+       *count = 0;
+
+       return 0;
+}
+
+static int r128_submit_packets_pio_secure(drm_device_t *dev,
+                                         u32 *commands, int *count)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       u32                 tmp      = 0;
+       int                 psize    = 0;
+       int                 writing  = 1;
+       int                 addr     = R128_PM4_FIFO_DATA_EVEN;
+       int                 ret;
+
+       while (*count > 0) {
+               tmp = *commands++;
+               if (!psize) {
+                       writing = 1;
+
+                       if ((tmp & R128_CCE_PACKET_MASK) == R128_CCE_PACKET0) {
+                               if ((tmp & R128_CCE_PACKET0_REG_MASK) <= (0x1004 >> 2)) {
+                                       if ((tmp & R128_CCE_PACKET0_REG_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP >> 2)) {
+                                               writing = 0;
+                                       }
+                               }
+                               psize = ((tmp & R128_CCE_PACKET_COUNT_MASK) >> 16) + 2;
+                       } else if ((tmp & R128_CCE_PACKET_MASK) == R128_CCE_PACKET1) {
+                               if ((tmp & R128_CCE_PACKET1_REG0_MASK) <= (0x1004 >> 2)) {
+                                       if ((tmp & R128_CCE_PACKET1_REG0_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP >> 2)) {
+                                               writing = 0;
+                                       }
+                               } else if ((tmp & R128_CCE_PACKET1_REG1_MASK) <=
+                                          (0x1004 << 9)) {
+                                       if ((tmp & R128_CCE_PACKET1_REG1_MASK) !=
+                                           (R128_PM4_VC_FPU_SETUP << 9)) {
+                                               writing = 0;
+                                       }
+                               }
+                               psize = 3;
+                       } else {
+                               psize = ((tmp & R128_CCE_PACKET_COUNT_MASK) >> 16) + 2;
+                       }
+               }
+               psize--;
+
+               if (writing) {
+                       if ((ret = r128_do_cce_wait_for_fifo(dev, 1)) < 0)
+                               return ret;
+                       R128_WRITE(addr, tmp);
+                       addr ^= 0x0004;
+               }
+
+               *count -= 1;
+       }
+
+       if (addr == R128_PM4_FIFO_DATA_ODD) {
+               if ((ret = r128_do_cce_wait_for_fifo(dev, 1)) < 0) return ret;
+               R128_WRITE(addr, R128_CCE_PACKET2);
+       }
+
+       return 0;
+}
+
+static int r128_submit_packets_ring(drm_device_t *dev,
+                                   u32 *commands, int *count)
+{
+       drm_r128_private_t *dev_priv  = dev->dev_private;
+       int                 write     = dev_priv->sarea_priv->ring_write;
+       int                *write_ptr = dev_priv->ring_start + write;
+       int                 c         = *count;
+       int                 timeout;
+
+       while (c > 0) {
+               write++;
+               *write_ptr++ = *commands++;
+               if (write >= dev_priv->ring_entries) {
+                       write     = 0;
+                       write_ptr = dev_priv->ring_start;
+               }
+               timeout = 0;
+               while (write == *dev_priv->ring_read_ptr) {
+                       (void)R128_READ(R128_PM4_BUFFER_DL_RPTR);
+                       if (timeout++ >= dev_priv->usec_timeout)
+                               return -EBUSY;
+                       udelay(1);
+               }
+               c--;
+       }
+
+       if (write < 32)
+           memcpy(dev_priv->ring_end,
+                  dev_priv->ring_start,
+                  write * sizeof(u32));
+
+       /* Make sure WC cache has been flushed */
+       r128_flush_write_combine();
+
+       dev_priv->sarea_priv->ring_write = write;
+       R128_WRITE(R128_PM4_BUFFER_DL_WPTR, write);
+
+       *count = 0;
+
+       return 0;
+}
+
+static int r128_submit_packets_pio(drm_device_t *dev,
+                                  u32 *commands, int *count)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 ret;
+
+       while (*count > 1) {
+               if ((ret = r128_do_cce_wait_for_fifo(dev, 2)) < 0) return ret;
+               R128_WRITE(R128_PM4_FIFO_DATA_EVEN, *commands++);
+               R128_WRITE(R128_PM4_FIFO_DATA_ODD,  *commands++);
+               *count -= 2;
+       }
+
+       if (*count) {
+               if ((ret = r128_do_cce_wait_for_fifo(dev, 2)) < 0) return ret;
+               R128_WRITE(R128_PM4_FIFO_DATA_EVEN, *commands++);
+               R128_WRITE(R128_PM4_FIFO_DATA_ODD,  R128_CCE_PACKET2);
+               *count = 0;
+       }
+
+       return 0;
+}
+
+static int r128_do_submit_packets(drm_device_t *dev, u32 *buffer, int count)
+{
+       drm_r128_private_t *dev_priv = dev->dev_private;
+       int                 c = count;
+       int                 ret;
+
+       if (dev_priv->cce_is_bm_mode) {
+               int left = 0;
+
+               if (c >= dev_priv->ring_entries) {
+                       c    = dev_priv->ring_entries-1;
+                       left = count - c;
+               }
+
+               /* Since this is only used by the kernel we can use the
+                   insecure ring buffer submit packet routine */
+               ret = r128_submit_packets_ring(dev, buffer, &c);
+
+               c += left;
+       } else {
+               /* Since this is only used by the kernel we can use the
+                   insecure PIO submit packet routine */
+               ret = r128_submit_packets_pio(dev, buffer, &c);
+       }
+
+       if (ret < 0) return ret;
+       else         return c;
+}
+
+int r128_submit_pkt(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_r128_private_t *dev_priv = dev->dev_private;
+       drm_r128_packet_t   packet;
+       u32                *buffer;
+       int                 c;
+       int                 size;
+       int                 ret = 0;
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
+           dev->lock.pid != current->pid) {
+               DRM_ERROR("r128_submit_pkt called without holding the lock\n");
+               return -EINVAL;
+       }
+
+       copy_from_user_ret(&packet, (drm_r128_packet_t *)arg, sizeof(packet),
+                          -EFAULT);
+
+       c    = packet.count;
+       size = c * sizeof(*buffer);
+
+       if (dev_priv->cce_is_bm_mode) {
+               int left = 0;
+
+               if (c >= dev_priv->ring_entries) {
+                       c    = dev_priv->ring_entries-1;
+                       size = c * sizeof(*buffer);
+                       left = packet.count - c;
+               }
+
+               if ((buffer = kmalloc(size, 0)) == NULL) return -ENOMEM;
+               copy_from_user_ret(buffer, packet.buffer, size, -EFAULT);
+
+               if (dev_priv->cce_secure)
+                       ret = r128_submit_packets_ring_secure(dev, buffer, &c);
+               else
+                       ret = r128_submit_packets_ring(dev, buffer, &c);
+
+               c += left;
+       } else {
+               if ((buffer = kmalloc(size, 0)) == NULL) return -ENOMEM;
+               copy_from_user_ret(buffer, packet.buffer, size, -EFAULT);
+
+               if (dev_priv->cce_secure)
+                       ret = r128_submit_packets_pio_secure(dev, buffer, &c);
+               else
+                       ret = r128_submit_packets_pio(dev, buffer, &c);
+       }
+
+       kfree(buffer);
+
+       packet.count = c;
+       copy_to_user_ret((drm_r128_packet_t *)arg, &packet, sizeof(packet),
+                        -EFAULT);
+
+       if (ret)        return ret;
+       else if (c > 0) return -EAGAIN;
+
+       return 0;
+}
+
+static int r128_send_vertbufs(drm_device_t *dev, drm_r128_vertex_t *v)
+{
+       drm_device_dma_t    *dma      = dev->dma;
+       drm_r128_private_t  *dev_priv = dev->dev_private;
+       drm_r128_buf_priv_t *buf_priv;
+       drm_buf_t           *buf;
+       int                  i, ret;
+       u32                  cce[2];
+
+       /* Make sure we have valid data */
+       for (i = 0; i < v->send_count; i++) {
+               int idx = v->send_indices[i];
+
+               if (idx < 0 || idx >= dma->buf_count) {
+                       DRM_ERROR("Index %d (of %d max)\n",
+                                 idx, dma->buf_count - 1);
+                       return -EINVAL;
+               }
+               buf = dma->buflist[idx];
+               if (buf->pid != current->pid) {
+                       DRM_ERROR("Process %d using buffer owned by %d\n",
+                                 current->pid, buf->pid);
+                       return -EINVAL;
+               }
+               if (buf->pending) {
+                       DRM_ERROR("Sending pending buffer:"
+                                 " buffer %d, offset %d\n",
+                                 v->send_indices[i], i);
+                       return -EINVAL;
+               }
+       }
+
+       /* Wait for idle, if we've wrapped to make sure that all pending
+           buffers have been processed */
+       if (dev_priv->submit_age == R128_MAX_VBUF_AGE) {
+               if ((ret = r128_do_cce_wait_for_idle(dev)) < 0) return ret;
+               dev_priv->submit_age = 0;
+               r128_mark_vertbufs_done(dev);
+       }
+
+       /* Make sure WC cache has been flushed (if in PIO mode) */
+       if (!dev_priv->cce_is_bm_mode) r128_flush_write_combine();
+
+       /* FIXME: Add support for sending vertex buffer to the CCE here
+          instead of in client code.  The v->prim holds the primitive
+          type that should be drawn.  Loop over the list buffers in
+          send_indices[] and submit a packet for each VB.
+
+          This will require us to loop over the clip rects here as
+          well, which implies that we extend the kernel driver to allow
+          cliprects to be stored here.  Note that the cliprects could
+          possibly come from the X server instead of the client, but
+          this will require additional changes to the DRI to allow for
+          this optimization. */
+
+       /* Submit a CCE packet that writes submit_age to R128_VB_AGE_REG */
+       cce[0] = R128CCE0(R128_CCE_PACKET0, R128_VB_AGE_REG, 0);
+       cce[1] = dev_priv->submit_age;
+       if ((ret = r128_do_submit_packets(dev, cce, 2)) < 0) {
+               /* Until we add support for sending VBs to the CCE in
+                  this routine, we can recover from this error.  After
+                  we add that support, we won't be able to easily
+                  recover, so we will probably have to implement
+                  another mechanism for handling timeouts from packets
+                  submitted directly by the kernel. */
+               return ret;
+       }
+
+       /* Now that the submit packet request has succeeded, we can mark
+           the buffers as pending */
+       for (i = 0; i < v->send_count; i++) {
+               buf = dma->buflist[v->send_indices[i]];
+               buf->pending = 1;
+
+               buf_priv      = buf->dev_private;
+               buf_priv->age = dev_priv->submit_age;
+       }
+
+       dev_priv->submit_age++;
+
+       return 0;
+}
+
+static drm_buf_t *r128_freelist_get(drm_device_t *dev)
+{
+       drm_device_dma_t    *dma      = dev->dma;
+       drm_r128_private_t  *dev_priv = dev->dev_private;
+       drm_r128_buf_priv_t *buf_priv;
+       drm_buf_t           *buf;
+       int                  i, t;
+
+       /* FIXME: Optimize -- use freelist code */
+
+       for (i = 0; i < dma->buf_count; i++) {
+               buf = dma->buflist[i];
+               buf_priv = buf->dev_private;
+               if (buf->pid == 0) return buf;
+       }
+
+       for (t = 0; t < dev_priv->usec_timeout; t++) {
+               u32 done_age = R128_READ(R128_VB_AGE_REG);
+
+               for (i = 0; i < dma->buf_count; i++) {
+                       buf = dma->buflist[i];
+                       buf_priv = buf->dev_private;
+                       if (buf->pending && buf_priv->age <= done_age) {
+                               /* The buffer has been processed, so it
+                                   can now be used */
+                               buf->pending = 0;
+                               return buf;
+                       }
+               }
+               udelay(1);
+       }
+
+       r128_status(dev);
+       return NULL;
+}
+
+
+static int r128_get_vertbufs(drm_device_t *dev, drm_r128_vertex_t *v)
+{
+       drm_buf_t *buf;
+       int        i;
+
+       for (i = v->granted_count; i < v->request_count; i++) {
+               buf = r128_freelist_get(dev);
+               if (!buf) break;
+               buf->pid = current->pid;
+               copy_to_user_ret(&v->request_indices[i],
+                                &buf->idx,
+                                sizeof(buf->idx),
+                                -EFAULT);
+               copy_to_user_ret(&v->request_sizes[i],
+                                &buf->total,
+                                sizeof(buf->total),
+                                -EFAULT);
+               ++v->granted_count;
+       }
+       return 0;
+}
+
+int r128_vertex_buf(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_r128_private_t *dev_priv = dev->dev_private;
+       drm_device_dma_t   *dma      = dev->dma;
+       int                 retcode  = 0;
+       drm_r128_vertex_t   v;
+
+       if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) ||
+           dev->lock.pid != current->pid) {
+               DRM_ERROR("r128_vertex_buf called without holding the lock\n");
+               return -EINVAL;
+       }
+
+       if (!dev_priv || dev_priv->is_pci) {
+               DRM_ERROR("r128_vertex_buf called with a PCI card\n");
+               return -EINVAL;
+       }
+
+       copy_from_user_ret(&v, (drm_r128_vertex_t *)arg, sizeof(v), -EFAULT);
+       DRM_DEBUG("%d: %d send, %d req\n",
+                 current->pid, v.send_count, v.request_count);
+
+       if (v.send_count < 0 || v.send_count > dma->buf_count) {
+               DRM_ERROR("Process %d trying to send %d buffers (of %d max)\n",
+                         current->pid, v.send_count, dma->buf_count);
+               return -EINVAL;
+       }
+       if (v.request_count < 0 || v.request_count > dma->buf_count) {
+               DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n",
+                         current->pid, v.request_count, dma->buf_count);
+               return -EINVAL;
+       }
+
+       if (v.send_count) {
+               retcode = r128_send_vertbufs(dev, &v);
+       }
+
+       v.granted_count = 0;
+
+       if (!retcode && v.request_count) {
+               retcode = r128_get_vertbufs(dev, &v);
+       }
+
+       DRM_DEBUG("%d returning, granted = %d\n",
+                 current->pid, v.granted_count);
+       copy_to_user_ret((drm_r128_vertex_t *)arg, &v, sizeof(v), -EFAULT);
+
+       return retcode;
+}
diff --git a/drivers/char/drm/r128_drm.h b/drivers/char/drm/r128_drm.h
new file mode 100644 (file)
index 0000000..ac6f73b
--- /dev/null
@@ -0,0 +1,111 @@
+/* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
+ * Created: Wed Apr  5 19:24:19 2000 by kevin@precisioninsight.com
+ *
+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Kevin E. Martin <martin@valinux.com>
+ *
+ */
+
+#ifndef _R128_DRM_H_
+#define _R128_DRM_H_
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (xf86drmR128.h)
+ */
+typedef struct drm_r128_init {
+       enum { 
+               R128_INIT_CCE    = 0x01,
+               R128_CLEANUP_CCE = 0x02
+       } func;
+       int sarea_priv_offset;
+       int is_pci;
+       int cce_mode;
+       int cce_fifo_size;
+       int cce_secure;
+       int ring_size;
+       int usec_timeout;
+
+       int fb_offset;
+       int agp_ring_offset;
+       int agp_read_ptr_offset;
+       int agp_vertbufs_offset;
+       int agp_indbufs_offset;
+       int agp_textures_offset;
+       int mmio_offset;
+} drm_r128_init_t;
+
+typedef struct drm_r128_packet {
+       unsigned long *buffer;
+       int            count;
+       int            flags;
+} drm_r128_packet_t;
+
+typedef enum drm_r128_prim {
+       _DRM_R128_PRIM_NONE             = 0x0001,
+       _DRM_R128_PRIM_POINT            = 0x0002,
+       _DRM_R128_PRIM_LINE             = 0x0004,
+       _DRM_R128_PRIM_POLY_LINE        = 0x0008,
+       _DRM_R128_PRIM_TRI_LIST         = 0x0010,
+       _DRM_R128_PRIM_TRI_FAN          = 0x0020,
+       _DRM_R128_PRIM_TRI_STRIP        = 0x0040,
+       _DRM_R128_PRIM_TRI_TYPE2        = 0x0080
+} drm_r128_prim_t;
+
+typedef struct drm_r128_vertex {
+                               /* Indices here refer to the offset into
+                                  buflist in drm_buf_get_t.  */
+       int             send_count;       /* Number of buffers to send      */
+       int             *send_indices;    /* List of handles to buffers     */
+       int             *send_sizes;      /* Lengths of data to send        */
+       drm_r128_prim_t prim;             /* Primitive type                 */
+       int             request_count;    /* Number of buffers requested    */
+       int             *request_indices; /* Buffer information             */
+       int             *request_sizes;
+       int             granted_count;    /* Number of buffers granted      */
+} drm_r128_vertex_t;
+
+/* WARNING: If you change any of these defines, make sure to change the
+ * defines in the Xserver file (r128_sarea.h)
+ */
+#define R128_LOCAL_TEX_HEAP       0
+#define R128_AGP_TEX_HEAP         1
+#define R128_NR_TEX_HEAPS         2
+#define R128_NR_TEX_REGIONS      64
+#define R128_LOG_TEX_GRANULARITY 16
+
+typedef struct drm_tex_region {
+       unsigned char next, prev;       
+       unsigned char in_use;   
+       int age;                        
+} drm_tex_region_t;
+
+typedef struct drm_r128_sarea {
+       drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
+       int              tex_age[R128_NR_TEX_HEAPS];
+       int              ctx_owner;
+       int              ring_write;
+} drm_r128_sarea_t;
+
+#endif
diff --git a/drivers/char/drm/r128_drv.c b/drivers/char/drm/r128_drv.c
new file mode 100644 (file)
index 0000000..e78d023
--- /dev/null
@@ -0,0 +1,717 @@
+/* r128_drv.c -- ATI Rage 128 driver -*- linux-c -*-
+ * Created: Mon Dec 13 09:47:27 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *          Kevin E. Martin <martin@valinux.com>
+ *
+ */
+
+#include <linux/config.h>
+#ifndef EXPORT_SYMTAB
+#define EXPORT_SYMTAB
+#endif
+#include "drmP.h"
+#include "r128_drv.h"
+EXPORT_SYMBOL(r128_init);
+EXPORT_SYMBOL(r128_cleanup);
+
+#define R128_NAME       "r128"
+#define R128_DESC       "ATI Rage 128"
+#define R128_DATE       "20000719"
+#define R128_MAJOR      1
+#define R128_MINOR      0
+#define R128_PATCHLEVEL  0
+
+static drm_device_t          r128_device;
+drm_ctx_t                    r128_res_ctx;
+
+static struct file_operations r128_fops = {
+#if LINUX_VERSION_CODE >= 0x020322
+                               /* This started being used approx. 2.3.34 */
+       owner:   THIS_MODULE,
+#endif
+       open:    r128_open,
+       flush:   drm_flush,
+       release: r128_release,
+       ioctl:   r128_ioctl,
+       mmap:    drm_mmap,
+       read:    drm_read,
+       fasync:  drm_fasync,
+       poll:    drm_poll,
+};
+
+static struct miscdevice      r128_misc = {
+       minor: MISC_DYNAMIC_MINOR,
+       name:  R128_NAME,
+       fops:  &r128_fops,
+};
+
+static drm_ioctl_desc_t              r128_ioctls[] = {
+       [DRM_IOCTL_NR(DRM_IOCTL_VERSION)]     = { r128_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 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)]  = { drm_setunique,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)]       = { drm_block,       1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)]     = { drm_unblock,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)]  = { drm_authmagic,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)]     = { drm_addmap,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)]    = { r128_addbufs,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MARK_BUFS)]   = { drm_markbufs,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)]   = { drm_infobufs,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)]    = { r128_mapbufs,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FREE_BUFS)]   = { drm_freebufs,    1, 0 },
+
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)]     = { r128_addctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)]      = { r128_rmctx,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)]     = { r128_modctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)]     = { r128_getctx,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)]  = { r128_switchctx,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)]     = { r128_newctx,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)]     = { r128_resctx,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)]    = { drm_adddraw,     1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)]     = { drm_rmdraw,      1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_LOCK)]        = { r128_lock,       1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)]      = { r128_unlock,     1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_FINISH)]      = { drm_finish,      1, 0 },
+
+#ifdef DRM_AGP
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { drm_agp_acquire, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release, 1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)]  = { drm_agp_enable,  1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)]    = { drm_agp_info,    1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)]   = { drm_agp_alloc,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)]    = { drm_agp_free,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)]    = { drm_agp_bind,    1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)]  = { drm_agp_unbind,  1, 1 },
+#endif
+
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_INIT)]   = { r128_init_cce,   1, 1 },
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_RESET)]  = { r128_eng_reset,  1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_FLUSH)]  = { r128_eng_flush,  1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_PACKET)] = { r128_submit_pkt, 1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_IDLE)]   = { r128_cce_idle,   1, 0 },
+       [DRM_IOCTL_NR(DRM_IOCTL_R128_VERTEX)] = { r128_vertex_buf, 1, 0 },
+};
+#define R128_IOCTL_COUNT DRM_ARRAY_SIZE(r128_ioctls)
+
+#ifdef MODULE
+static char                  *r128 = NULL;
+#endif
+
+MODULE_AUTHOR("VA Linux Systems, Inc.");
+MODULE_DESCRIPTION("r128");
+MODULE_PARM(r128, "s");
+
+module_init(r128_init);
+module_exit(r128_cleanup);
+
+#ifndef MODULE
+/* r128_options is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO).  It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+static int __init r128_options(char *str)
+{
+       drm_parse_options(str);
+       return 1;
+}
+
+__setup("r128=", r128_options);
+#endif
+
+static int r128_setup(drm_device_t *dev)
+{
+       int i;
+
+       atomic_set(&dev->ioctl_count, 0);
+       atomic_set(&dev->vma_count, 0);
+       dev->buf_use      = 0;
+       atomic_set(&dev->buf_alloc, 0);
+
+       drm_dma_setup(dev);
+
+       atomic_set(&dev->total_open, 0);
+       atomic_set(&dev->total_close, 0);
+       atomic_set(&dev->total_ioctl, 0);
+       atomic_set(&dev->total_irq, 0);
+       atomic_set(&dev->total_ctx, 0);
+       atomic_set(&dev->total_locks, 0);
+       atomic_set(&dev->total_unlocks, 0);
+       atomic_set(&dev->total_contends, 0);
+       atomic_set(&dev->total_sleeps, 0);
+
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               dev->magiclist[i].head = NULL;
+               dev->magiclist[i].tail = NULL;
+       }
+       dev->maplist        = NULL;
+       dev->map_count      = 0;
+       dev->vmalist        = NULL;
+       dev->lock.hw_lock   = NULL;
+       init_waitqueue_head(&dev->lock.lock_queue);
+       dev->queue_count    = 0;
+       dev->queue_reserved = 0;
+       dev->queue_slots    = 0;
+       dev->queuelist      = NULL;
+       dev->irq            = 0;
+       dev->context_flag   = 0;
+       dev->interrupt_flag = 0;
+       dev->dma_flag       = 0;
+       dev->last_context   = 0;
+       dev->last_switch    = 0;
+       dev->last_checked   = 0;
+       init_timer(&dev->timer);
+       init_waitqueue_head(&dev->context_wait);
+
+       dev->ctx_start      = 0;
+       dev->lck_start      = 0;
+
+       dev->buf_rp       = dev->buf;
+       dev->buf_wp       = dev->buf;
+       dev->buf_end      = dev->buf + DRM_BSZ;
+       dev->buf_async    = NULL;
+       init_waitqueue_head(&dev->buf_readers);
+       init_waitqueue_head(&dev->buf_writers);
+
+       r128_res_ctx.handle=-1;
+
+       DRM_DEBUG("\n");
+
+       /* The kernel's context could be created here, but is now created
+          in drm_dma_enqueue.  This is more resource-efficient for
+          hardware that does not do DMA, but may mean that
+          drm_select_queue fails between the time the interrupt is
+          initialized and the time the queues are initialized. */
+
+       return 0;
+}
+
+
+static int r128_takedown(drm_device_t *dev)
+{
+       int               i;
+       drm_magic_entry_t *pt, *next;
+       drm_map_t         *map;
+       drm_vma_entry_t   *vma, *vma_next;
+
+       DRM_DEBUG("\n");
+
+       down(&dev->struct_sem);
+       del_timer(&dev->timer);
+
+       if (dev->devname) {
+               drm_free(dev->devname, strlen(dev->devname)+1, DRM_MEM_DRIVER);
+               dev->devname = NULL;
+       }
+
+       if (dev->unique) {
+               drm_free(dev->unique, strlen(dev->unique)+1, DRM_MEM_DRIVER);
+               dev->unique = NULL;
+               dev->unique_len = 0;
+       }
+                               /* Clear pid list */
+       for (i = 0; i < DRM_HASH_SIZE; i++) {
+               for (pt = dev->magiclist[i].head; pt; pt = next) {
+                       next = pt->next;
+                       drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
+               }
+               dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
+       }
+
+#ifdef DRM_AGP
+                               /* Clear AGP information */
+       if (dev->agp) {
+               drm_agp_mem_t *entry;
+               drm_agp_mem_t *nexte;
+
+                               /* Remove AGP resources, but leave dev->agp
+                                   intact until r128_cleanup is called. */
+               for (entry = dev->agp->memory; entry; entry = nexte) {
+                       nexte = entry->next;
+                       if (entry->bound) drm_unbind_agp(entry->memory);
+                       drm_free_agp(entry->memory, entry->pages);
+                       drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
+               }
+               dev->agp->memory = NULL;
+
+               if (dev->agp->acquired && drm_agp.release)
+                       (*drm_agp.release)();
+
+               dev->agp->acquired = 0;
+               dev->agp->enabled  = 0;
+       }
+#endif
+
+                               /* Clear vma list (only built for debugging) */
+       if (dev->vmalist) {
+               for (vma = dev->vmalist; vma; vma = vma_next) {
+                       vma_next = vma->next;
+                       drm_free(vma, sizeof(*vma), DRM_MEM_VMAS);
+               }
+               dev->vmalist = NULL;
+       }
+
+                               /* Clear map area and mtrr information */
+       if (dev->maplist) {
+               for (i = 0; i < dev->map_count; i++) {
+                       map = dev->maplist[i];
+                       switch (map->type) {
+                       case _DRM_REGISTERS:
+                       case _DRM_FRAME_BUFFER:
+#ifdef CONFIG_MTRR
+                               if (map->mtrr >= 0) {
+                                       int retcode;
+                                       retcode = mtrr_del(map->mtrr,
+                                                          map->offset,
+                                                          map->size);
+                                       DRM_DEBUG("mtrr_del = %d\n", retcode);
+                               }
+#endif
+                               drm_ioremapfree(map->handle, map->size);
+                               break;
+                       case _DRM_SHM:
+                               drm_free_pages((unsigned long)map->handle,
+                                              drm_order(map->size)
+                                              - PAGE_SHIFT,
+                                              DRM_MEM_SAREA);
+                               break;
+                       case _DRM_AGP:
+                               /* Do nothing here, because this is all
+                                   handled in the AGP/GART driver. */
+                               break;
+                       }
+                       drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+               }
+               drm_free(dev->maplist,
+                        dev->map_count * sizeof(*dev->maplist),
+                        DRM_MEM_MAPS);
+               dev->maplist   = NULL;
+               dev->map_count = 0;
+       }
+
+       drm_dma_takedown(dev);
+
+       dev->queue_count     = 0;
+       if (dev->lock.hw_lock) {
+               dev->lock.hw_lock    = NULL; /* SHM removed */
+               dev->lock.pid        = 0;
+               wake_up_interruptible(&dev->lock.lock_queue);
+       }
+       up(&dev->struct_sem);
+
+       return 0;
+}
+
+/* r128_init is called via init_module at module load time, or via
+ * linux/init/main.c (this is not currently supported). */
+
+int r128_init(void)
+{
+       int                   retcode;
+       drm_device_t          *dev = &r128_device;
+
+       DRM_DEBUG("\n");
+
+       memset((void *)dev, 0, sizeof(*dev));
+       dev->count_lock   = SPIN_LOCK_UNLOCKED;
+       sema_init(&dev->struct_sem, 1);
+
+#ifdef MODULE
+       drm_parse_options(r128);
+#endif
+
+       if ((retcode = misc_register(&r128_misc))) {
+               DRM_ERROR("Cannot register \"%s\"\n", R128_NAME);
+               return retcode;
+       }
+       dev->device = MKDEV(MISC_MAJOR, r128_misc.minor);
+       dev->name   = R128_NAME;
+
+       drm_mem_init();
+       drm_proc_init(dev);
+
+#ifdef DRM_AGP
+       dev->agp    = drm_agp_init();
+       if (dev->agp == NULL) {
+               DRM_ERROR("Cannot initialize agpgart module.\n");
+               drm_proc_cleanup();
+               misc_deregister(&r128_misc);
+               r128_takedown(dev);
+               return -ENOMEM;
+       }
+
+#ifdef CONFIG_MTRR
+       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((retcode = drm_ctxbitmap_init(dev))) {
+               DRM_ERROR("Cannot allocate memory for context bitmap.\n");
+               drm_proc_cleanup();
+               misc_deregister(&r128_misc);
+               r128_takedown(dev);
+               return retcode;
+       }
+
+       DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
+                R128_NAME,
+                R128_MAJOR,
+                R128_MINOR,
+                R128_PATCHLEVEL,
+                R128_DATE,
+                r128_misc.minor);
+
+       return 0;
+}
+
+/* r128_cleanup is called via cleanup_module at module unload time. */
+
+void r128_cleanup(void)
+{
+       drm_device_t          *dev = &r128_device;
+
+       DRM_DEBUG("\n");
+
+       drm_proc_cleanup();
+       if (misc_deregister(&r128_misc)) {
+               DRM_ERROR("Cannot unload module\n");
+       } else {
+               DRM_INFO("Module unloaded\n");
+       }
+       drm_ctxbitmap_cleanup(dev);
+       r128_takedown(dev);
+#ifdef DRM_AGP
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+#endif
+}
+
+int r128_version(struct inode *inode, struct file *filp, unsigned int cmd,
+                 unsigned long arg)
+{
+       drm_version_t version;
+       int           len;
+
+       copy_from_user_ret(&version,
+                          (drm_version_t *)arg,
+                          sizeof(version),
+                          -EFAULT);
+
+#define DRM_COPY(name,value)                                \
+       len = strlen(value);                                 \
+       if (len > name##_len) len = name##_len;              \
+       name##_len = strlen(value);                          \
+       if (len && name) {                                   \
+               copy_to_user_ret(name, value, len, -EFAULT); \
+       }
+
+       version.version_major      = R128_MAJOR;
+       version.version_minor      = R128_MINOR;
+       version.version_patchlevel = R128_PATCHLEVEL;
+
+       DRM_COPY(version.name, R128_NAME);
+       DRM_COPY(version.date, R128_DATE);
+       DRM_COPY(version.desc, R128_DESC);
+
+       copy_to_user_ret((drm_version_t *)arg,
+                        &version,
+                        sizeof(version),
+                        -EFAULT);
+       return 0;
+}
+
+int r128_open(struct inode *inode, struct file *filp)
+{
+       drm_device_t  *dev    = &r128_device;
+       int           retcode = 0;
+
+       DRM_DEBUG("open_count = %d\n", dev->open_count);
+       if (!(retcode = drm_open_helper(inode, filp, dev))) {
+               MOD_INC_USE_COUNT;
+               atomic_inc(&dev->total_open);
+               spin_lock(&dev->count_lock);
+               if (!dev->open_count++) {
+                       spin_unlock(&dev->count_lock);
+                       return r128_setup(dev);
+               }
+               spin_unlock(&dev->count_lock);
+       }
+       return retcode;
+}
+
+int r128_release(struct inode *inode, struct file *filp)
+{
+       drm_file_t    *priv   = filp->private_data;
+       drm_device_t  *dev    = priv->dev;
+       int           retcode = 0;
+
+       DRM_DEBUG("open_count = %d\n", dev->open_count);
+       if (!(retcode = drm_release(inode, filp))) {
+               MOD_DEC_USE_COUNT;
+               atomic_inc(&dev->total_close);
+               spin_lock(&dev->count_lock);
+               if (!--dev->open_count) {
+                       if (atomic_read(&dev->ioctl_count) || dev->blocked) {
+                               DRM_ERROR("Device busy: %d %d\n",
+                                         atomic_read(&dev->ioctl_count),
+                                         dev->blocked);
+                               spin_unlock(&dev->count_lock);
+                               return -EBUSY;
+                       }
+                       spin_unlock(&dev->count_lock);
+                       return r128_takedown(dev);
+               }
+               spin_unlock(&dev->count_lock);
+       }
+       return retcode;
+}
+
+/* r128_ioctl is called whenever a process performs an ioctl on /dev/drm. */
+
+int r128_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
+               unsigned long arg)
+{
+       int              nr      = DRM_IOCTL_NR(cmd);
+       drm_file_t       *priv   = filp->private_data;
+       drm_device_t     *dev    = priv->dev;
+       int              retcode = 0;
+       drm_ioctl_desc_t *ioctl;
+       drm_ioctl_t      *func;
+
+       atomic_inc(&dev->ioctl_count);
+       atomic_inc(&dev->total_ioctl);
+       ++priv->ioctl_count;
+
+       DRM_DEBUG("pid = %d, cmd = 0x%02x, nr = 0x%02x, dev 0x%x, auth = %d\n",
+                 current->pid, cmd, nr, dev->device, priv->authenticated);
+
+       if (nr >= R128_IOCTL_COUNT) {
+               retcode = -EINVAL;
+       } else {
+               ioctl     = &r128_ioctls[nr];
+               func      = ioctl->func;
+
+               if (!func) {
+                       DRM_DEBUG("no function\n");
+                       retcode = -EINVAL;
+               } else if ((ioctl->root_only && !capable(CAP_SYS_ADMIN))
+                           || (ioctl->auth_needed && !priv->authenticated)) {
+                       retcode = -EACCES;
+               } else {
+                       retcode = (func)(inode, filp, cmd, arg);
+               }
+       }
+
+       atomic_dec(&dev->ioctl_count);
+       return retcode;
+}
+
+int r128_lock(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;
+        DECLARE_WAITQUEUE(entry, current);
+        int               ret   = 0;
+        drm_lock_t        lock;
+#if DRM_DMA_HISTOGRAM
+        cycles_t          start;
+
+        dev->lck_start = start = get_cycles();
+#endif
+
+        copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+
+        if (lock.context == DRM_KERNEL_CONTEXT) {
+                DRM_ERROR("Process %d using kernel context %d\n",
+                          current->pid, lock.context);
+                return -EINVAL;
+        }
+
+        DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n",
+                  lock.context, current->pid, dev->lock.hw_lock->lock,
+                  lock.flags);
+
+#if 0
+                               /* dev->queue_count == 0 right now for
+                                   r128.  FIXME? */
+        if (lock.context < 0 || lock.context >= dev->queue_count)
+                return -EINVAL;
+#endif
+
+        if (!ret) {
+#if 0
+                if (_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)
+                    != lock.context) {
+                        long j = jiffies - dev->lock.lock_time;
+
+                        if (lock.context == r128_res_ctx.handle &&
+                               j >= 0 && j < DRM_LOCK_SLICE) {
+                                /* Can't take lock if we just had it and
+                                   there is contention. */
+                                DRM_DEBUG("%d (pid %d) delayed j=%d dev=%d jiffies=%d\n",
+                                       lock.context, current->pid, j,
+                                       dev->lock.lock_time, jiffies);
+                                current->state = TASK_INTERRUPTIBLE;
+                               current->policy |= SCHED_YIELD;
+                                schedule_timeout(DRM_LOCK_SLICE-j);
+                               DRM_DEBUG("jiffies=%d\n", jiffies);
+                        }
+                }
+#endif
+                add_wait_queue(&dev->lock.lock_queue, &entry);
+                for (;;) {
+                        if (!dev->lock.hw_lock) {
+                                /* Device has been unregistered */
+                                ret = -EINTR;
+                                break;
+                        }
+                        if (drm_lock_take(&dev->lock.hw_lock->lock,
+                                          lock.context)) {
+                                dev->lock.pid       = current->pid;
+                                dev->lock.lock_time = jiffies;
+                                atomic_inc(&dev->total_locks);
+                                break;  /* Got lock */
+                        }
+
+                                /* Contention */
+                        atomic_inc(&dev->total_sleeps);
+                        current->state = TASK_INTERRUPTIBLE;
+#if 1
+                       current->policy |= SCHED_YIELD;
+#endif
+                        schedule();
+                        if (signal_pending(current)) {
+                                ret = -ERESTARTSYS;
+                                break;
+                        }
+                }
+                current->state = TASK_RUNNING;
+                remove_wait_queue(&dev->lock.lock_queue, &entry);
+        }
+
+#if 0
+       if (!ret && dev->last_context != lock.context &&
+               lock.context != r128_res_ctx.handle &&
+               dev->last_context != r128_res_ctx.handle) {
+               add_wait_queue(&dev->context_wait, &entry);
+               current->state = TASK_INTERRUPTIBLE;
+                /* PRE: dev->last_context != lock.context */
+               r128_context_switch(dev, dev->last_context, lock.context);
+               /* POST: we will wait for the context
+                   switch and will dispatch on a later call
+                   when dev->last_context == lock.context
+                   NOTE WE HOLD THE LOCK THROUGHOUT THIS
+                   TIME! */
+               current->policy |= SCHED_YIELD;
+               schedule();
+               current->state = TASK_RUNNING;
+               remove_wait_queue(&dev->context_wait, &entry);
+               if (signal_pending(current)) {
+                       ret = -EINTR;
+               } else if (dev->last_context != lock.context) {
+                       DRM_ERROR("Context mismatch: %d %d\n",
+                               dev->last_context, lock.context);
+               }
+       }
+#endif
+
+        if (!ret) {
+                if (lock.flags & _DRM_LOCK_READY) {
+                               /* Wait for space in DMA/FIFO */
+               }
+                if (lock.flags & _DRM_LOCK_QUIESCENT) {
+                               /* Make hardware quiescent */
+#if 0
+                        r128_quiescent(dev);
+#endif
+               }
+        }
+
+#if LINUX_VERSION_CODE < 0x020400
+       if (lock.context != r128_res_ctx.handle) {
+               current->counter = 5;
+               current->priority = DEF_PRIORITY/4;
+       }
+#endif
+        DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
+
+#if DRM_DMA_HISTOGRAM
+        atomic_inc(&dev->histo.lacq[drm_histogram_slot(get_cycles() - start)]);
+#endif
+
+        return ret;
+}
+
+
+int r128_unlock(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_lock_t        lock;
+
+       copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+
+       if (lock.context == DRM_KERNEL_CONTEXT) {
+               DRM_ERROR("Process %d using kernel context %d\n",
+                         current->pid, lock.context);
+               return -EINVAL;
+       }
+
+       DRM_DEBUG("%d frees lock (%d holds)\n",
+                 lock.context,
+                 _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
+       atomic_inc(&dev->total_unlocks);
+       if (_DRM_LOCK_IS_CONT(dev->lock.hw_lock->lock))
+               atomic_inc(&dev->total_contends);
+       drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT);
+                               /* FIXME: Try to send data to card here */
+       if (!dev->context_flag) {
+               if (drm_lock_free(dev, &dev->lock.hw_lock->lock,
+                                 DRM_KERNEL_CONTEXT)) {
+                       DRM_ERROR("\n");
+               }
+       }
+
+#if LINUX_VERSION_CODE < 0x020400
+       if (lock.context != r128_res_ctx.handle) {
+               current->counter = 5;
+               current->priority = DEF_PRIORITY;
+       }
+#endif
+
+       return 0;
+}
diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h
new file mode 100644 (file)
index 0000000..81390bb
--- /dev/null
@@ -0,0 +1,226 @@
+/* r128_drv.h -- Private header for r128 driver -*- linux-c -*-
+ * Created: Mon Dec 13 09:51:11 1999 by faith@precisioninsight.com
+ *
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * 
+ * Authors: Rickard E. (Rik) Faith <faith@valinux.com>
+ *          Kevin E. Martin <martin@valinux.com>
+ *
+ */
+
+#ifndef _R128_DRV_H_
+#define _R128_DRV_H_
+
+typedef struct drm_r128_private {
+       int               is_pci;
+
+       int               cce_mode;
+       int               cce_fifo_size;
+       int               cce_is_bm_mode;
+       int               cce_secure;
+
+       drm_r128_sarea_t *sarea_priv;
+
+       __volatile__ u32 *ring_read_ptr;
+
+       u32              *ring_start;
+       u32              *ring_end;
+       int               ring_size;
+       int               ring_sizel2qw;
+       int               ring_entries;
+
+       int               submit_age;
+
+       int               usec_timeout;
+
+       drm_map_t        *sarea;
+       drm_map_t        *fb;
+       drm_map_t        *agp_ring;
+       drm_map_t        *agp_read_ptr;
+       drm_map_t        *agp_vertbufs;
+       drm_map_t        *agp_indbufs;
+       drm_map_t        *agp_textures;
+       drm_map_t        *mmio;
+} drm_r128_private_t;
+
+typedef struct drm_r128_buf_priv {
+       u32               age;
+} drm_r128_buf_priv_t;
+
+                               /* r128_drv.c */
+extern int  r128_init(void);
+extern void r128_cleanup(void);
+extern int  r128_version(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int  r128_open(struct inode *inode, struct file *filp);
+extern int  r128_release(struct inode *inode, struct file *filp);
+extern int  r128_ioctl(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_lock(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+extern int  r128_unlock(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+
+                               /* r128_dma.c */
+extern int r128_init_cce(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int r128_eng_reset(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int r128_eng_flush(struct inode *inode, struct file *filp,
+                         unsigned int cmd, unsigned long arg);
+extern int r128_submit_pkt(struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg);
+extern int r128_cce_idle(struct inode *inode, struct file *filp,
+                        unsigned int cmd, unsigned long arg);
+extern int r128_vertex_buf(struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg);
+
+                               /* r128_bufs.c */
+extern int r128_addbufs(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int r128_mapbufs(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+
+                               /* r128_context.c */
+extern int  r128_resctx(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_addctx(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_modctx(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_getctx(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_switchctx(struct inode *inode, struct file *filp,
+                          unsigned int cmd, unsigned long arg);
+extern int  r128_newctx(struct inode *inode, struct file *filp,
+                       unsigned int cmd, unsigned long arg);
+extern int  r128_rmctx(struct inode *inode, struct file *filp,
+                      unsigned int cmd, unsigned long arg);
+
+extern int  r128_context_switch(drm_device_t *dev, int old, int new);
+extern int  r128_context_switch_complete(drm_device_t *dev, int new);
+
+
+/* Register definitions, register access macros and drmAddMap constants
+ * for Rage 128 kernel driver.
+ */
+
+#define R128_PC_NGUI_CTLSTAT   0x0184
+#       define R128_PC_FLUSH_ALL       0x00ff
+#       define R128_PC_BUSY            (1 << 31)
+
+#define R128_CLOCK_CNTL_INDEX  0x0008
+#define R128_CLOCK_CNTL_DATA   0x000c
+#       define R128_PLL_WR_EN          (1 << 7)
+
+#define R128_MCLK_CNTL         0x000f
+#       define R128_FORCE_GCP          (1 << 16)
+#       define R128_FORCE_PIPE3D_CP    (1 << 17)
+#       define R128_FORCE_RCP          (1 << 18)
+
+#define R128_GEN_RESET_CNTL    0x00f0
+#       define R128_SOFT_RESET_GUI     (1 <<  0)
+
+#define R128_PM4_BUFFER_CNTL   0x0704
+#       define R128_PM4_NONPM4                 (0  << 28)
+#       define R128_PM4_192PIO                 (1  << 28)
+#       define R128_PM4_192BM                  (2  << 28)
+#       define R128_PM4_128PIO_64INDBM         (3  << 28)
+#       define R128_PM4_128BM_64INDBM          (4  << 28)
+#       define R128_PM4_64PIO_128INDBM         (5  << 28)
+#       define R128_PM4_64BM_128INDBM          (6  << 28)
+#       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_DL_RPTR        0x0710
+#define R128_PM4_BUFFER_DL_WPTR        0x0714
+#       define R128_PM4_BUFFER_DL_DONE         (1 << 31)
+
+#define R128_PM4_VC_FPU_SETUP  0x071c
+
+#define R128_PM4_STAT          0x07b8
+#       define R128_PM4_FIFOCNT_MASK           0x0fff
+#       define R128_PM4_BUSY                   (1 << 16)
+#       define R128_PM4_GUI_ACTIVE             (1 << 31)
+
+#define R128_PM4_BUFFER_ADDR   0x07f0
+#define R128_PM4_MICRO_CNTL    0x07fc
+#       define R128_PM4_MICRO_FREERUN          (1 << 30)
+
+#define R128_PM4_FIFO_DATA_EVEN        0x1000
+#define R128_PM4_FIFO_DATA_ODD 0x1004
+
+#define R128_GUI_SCRATCH_REG0  0x15e0
+#define R128_GUI_SCRATCH_REG1  0x15e4
+#define R128_GUI_SCRATCH_REG2  0x15e8
+#define R128_GUI_SCRATCH_REG3  0x15ec
+#define R128_GUI_SCRATCH_REG4  0x15f0
+#define R128_GUI_SCRATCH_REG5  0x15f4
+
+#define R128_GUI_STAT          0x1740
+#       define R128_GUI_FIFOCNT_MASK           0x0fff
+#       define R128_GUI_ACTIVE                 (1 << 31)
+
+
+/* CCE command packets */
+#define R128_CCE_PACKET0       0x00000000
+#define R128_CCE_PACKET1       0x40000000
+#define R128_CCE_PACKET2       0x80000000
+#       define R128_CCE_PACKET_MASK            0xC0000000
+#       define R128_CCE_PACKET_COUNT_MASK      0x3fff0000
+#       define R128_CCE_PACKET0_REG_MASK       0x000007ff
+#       define R128_CCE_PACKET1_REG0_MASK      0x000007ff
+#       define R128_CCE_PACKET1_REG1_MASK      0x003ff800
+
+
+#define R128_MAX_USEC_TIMEOUT  100000  /* 100 ms */
+
+
+#define R128_BASE(reg)         ((u32)(dev_priv->mmio->handle))
+#define R128_ADDR(reg)         (R128_BASE(reg) + reg)
+
+#define R128_DEREF(reg)                *(__volatile__ int *)R128_ADDR(reg)
+#define R128_READ(reg)         R128_DEREF(reg)
+#define R128_WRITE(reg,val)    do { R128_DEREF(reg) = val; } while (0)
+
+#define R128_DEREF8(reg)       *(__volatile__ char *)R128_ADDR(reg)
+#define R128_READ8(reg)                R128_DEREF8(reg)
+#define R128_WRITE8(reg,val)   do { R128_DEREF8(reg) = val; } while (0)
+
+#define R128_WRITE_PLL(addr,val)                                              \
+do {                                                                          \
+       R128_WRITE8(R128_CLOCK_CNTL_INDEX, ((addr) & 0x1f) | R128_PLL_WR_EN); \
+       R128_WRITE(R128_CLOCK_CNTL_DATA, (val));                              \
+} while (0)
+
+extern int R128_READ_PLL(drm_device_t *dev, int addr);
+
+#define R128CCE0(p,r,n)   ((p) | ((n) << 16) | ((r) >> 2))
+#define R128CCE1(p,r1,r2) ((p) | (((r2) >> 2) << 11) | ((r1) >> 2))
+#define R128CCE2(p)       ((p))
+#define R128CCE3(p,n)     ((p) | ((n) << 16))
+
+#endif
index 22bf59ff39fd11674682e3044731ecddb8174802..c8d6e50ea98ec0c9af7abc88cb087291dbea2964 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Thu Oct  7 10:50:22 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,8 +25,9 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
- *
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
+ *    Daryll Strauss <daryll@valinux.com>
+ * 
  */
 
 #include <linux/sched.h>
@@ -38,9 +40,7 @@ extern drm_ctx_t tdfx_res_ctx;
 
 static int tdfx_alloc_queue(drm_device_t *dev)
 {
-       static int context = 0;
-
-       return ++context;       /* Should this reuse contexts in the future? */
+       return drm_ctxbitmap_next(dev);
 }
 
 int tdfx_context_switch(drm_device_t *dev, int old, int new)
@@ -137,6 +137,12 @@ int tdfx_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
                ctx.handle = tdfx_alloc_queue(dev);
        }
        DRM_DEBUG("%d\n", ctx.handle);
+       if (ctx.handle == -1) {
+               DRM_DEBUG("Not enough free contexts.\n");
+                               /* Should this return -EBUSY instead? */
+               return -ENOMEM;
+       }
+   
        copy_to_user_ret((drm_ctx_t *)arg, &ctx, sizeof(ctx), -EFAULT);
        return 0;
 }
@@ -193,13 +199,13 @@ int tdfx_newctx(struct inode *inode, struct file *filp, unsigned int cmd,
 int tdfx_rmctx(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_ctx_t       ctx;
 
        copy_from_user_ret(&ctx, (drm_ctx_t *)arg, sizeof(ctx), -EFAULT);
        DRM_DEBUG("%d\n", ctx.handle);
-                               /* This is currently a noop because we
-                                  don't reuse context values.  Perhaps we
-                                  should? */
-       
+       drm_ctxbitmap_free(dev, ctx.handle);
+
        return 0;
 }
index b0c41c93c4a30deb38545214007e347618f5b0bb..97bd4180bb3ac903aeb87c4ae3792cf80a71862c 100644 (file)
@@ -1,7 +1,8 @@
 /* tdfx.c -- tdfx driver -*- linux-c -*-
  * Created: Thu Oct  7 10:38:32 1999 by faith@precisioninsight.com
  *
- * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
- *
+ * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
- *    Daryll Strauss <daryll@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
+ *    Daryll Strauss <daryll@valinux.com>
  *
  */
 
 #include <linux/config.h>
-#include <linux/sched.h>
-#include <linux/smp_lock.h>
+#ifndef EXPORT_SYMTAB
+#define EXPORT_SYMTAB
+#endif
 #include "drmP.h"
 #include "tdfx_drv.h"
+EXPORT_SYMBOL(tdfx_init);
+EXPORT_SYMBOL(tdfx_cleanup);
 
 #define TDFX_NAME       "tdfx"
-#define TDFX_DESC       "tdfx"
-#define TDFX_DATE       "19991009"
-#define TDFX_MAJOR      0
+#define TDFX_DESC       "3dfx Banshee/Voodoo3+"
+#define TDFX_DATE       "20000719"
+#define TDFX_MAJOR      1
 #define TDFX_MINOR      0
-#define TDFX_PATCHLEVEL  1
+#define TDFX_PATCHLEVEL  0
 
 static drm_device_t          tdfx_device;
 drm_ctx_t                    tdfx_res_ctx;
 
 static struct file_operations tdfx_fops = {
-       owner:  THIS_MODULE,
+#if LINUX_VERSION_CODE >= 0x020322
+                               /* This started being used approx. 2.3.34 */
+       owner:   THIS_MODULE,
+#endif
        open:    tdfx_open,
        flush:   drm_flush,
        release: tdfx_release,
@@ -87,6 +94,16 @@ static drm_ioctl_desc_t            tdfx_ioctls[] = {
        [DRM_IOCTL_NR(DRM_IOCTL_LOCK)]       = { tdfx_lock,       1, 0 },
        [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)]     = { tdfx_unlock,     1, 0 },
        [DRM_IOCTL_NR(DRM_IOCTL_FINISH)]     = { drm_finish,      1, 0 },
+#ifdef DRM_AGP
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)]   = {drm_agp_acquire, 1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)]   = {drm_agp_release, 1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)]    = {drm_agp_enable,  1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)]      = {drm_agp_info,    1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)]     = {drm_agp_alloc,   1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)]      = {drm_agp_free,    1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)]      = {drm_agp_unbind,  1, 1},
+       [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)]    = {drm_agp_bind,    1, 1},
+#endif
 };
 #define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls)
 
@@ -94,10 +111,28 @@ static drm_ioctl_desc_t          tdfx_ioctls[] = {
 static char                  *tdfx = NULL;
 #endif
 
-MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas.");
+MODULE_AUTHOR("VA Linux Systems, Inc.");
 MODULE_DESCRIPTION("tdfx");
 MODULE_PARM(tdfx, "s");
 
+module_init(tdfx_init);
+module_exit(tdfx_cleanup);
+
+#ifndef MODULE
+/* tdfx_options is called by the kernel to parse command-line options
+ * passed via the boot-loader (e.g., LILO).  It calls the insmod option
+ * routine, drm_parse_drm.
+ */
+
+static int __init tdfx_options(char *str)
+{
+       drm_parse_options(str);
+       return 1;
+}
+
+__setup("tdfx=", tdfx_options);
+#endif
+
 static int tdfx_setup(drm_device_t *dev)
 {
        int i;
@@ -195,7 +230,22 @@ static int tdfx_takedown(drm_device_t *dev)
                }
                dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
        }
-       
+#ifdef DRM_AGP
+                               /* Clear AGP information */
+       if (dev->agp) {
+               drm_agp_mem_t *temp;
+               drm_agp_mem_t *temp_next;
+          
+               temp = dev->agp->memory;
+               while(temp != NULL) {
+                       temp_next = temp->next;
+                       drm_free_agp(temp->memory, temp->pages);
+                       drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
+                       temp = temp_next;
+               }
+               if (dev->agp->acquired) (*drm_agp.release)();
+       }
+#endif
                                /* Clear vma list (only built for debugging) */
        if (dev->vmalist) {
                for (vma = dev->vmalist; vma; vma = vma_next) {
@@ -229,6 +279,10 @@ static int tdfx_takedown(drm_device_t *dev)
                                               - PAGE_SHIFT,
                                               DRM_MEM_SAREA);
                                break;
+                       case _DRM_AGP:
+                               /* Do nothing here, because this is all
+                                   handled in the AGP/GART driver. */
+                               break;
                        }
                        drm_free(map, sizeof(*map), DRM_MEM_MAPS);
                }
@@ -276,6 +330,16 @@ int tdfx_init(void)
 
        drm_mem_init();
        drm_proc_init(dev);
+#ifdef DRM_AGP
+       dev->agp    = drm_agp_init();
+#endif
+       if((retcode = drm_ctxbitmap_init(dev))) {
+               DRM_ERROR("Cannot allocate memory for context bitmap.\n");
+               drm_proc_cleanup();
+               misc_deregister(&tdfx_misc);
+               tdfx_takedown(dev);
+               return retcode;
+       }
 
        DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
                 TDFX_NAME,
@@ -302,7 +366,15 @@ void tdfx_cleanup(void)
        } else {
                DRM_INFO("Module unloaded\n");
        }
+       drm_ctxbitmap_cleanup(dev);
        tdfx_takedown(dev);
+#ifdef DRM_AGP
+       if (dev->agp) {
+               drm_agp_uninit();
+               drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS);
+               dev->agp = NULL;
+       }
+#endif
 }
 
 int tdfx_version(struct inode *inode, struct file *filp, unsigned int cmd,
@@ -346,6 +418,7 @@ int tdfx_open(struct inode *inode, struct file *filp)
        
        DRM_DEBUG("open_count = %d\n", dev->open_count);
        if (!(retcode = drm_open_helper(inode, filp, dev))) {
+               MOD_INC_USE_COUNT;
                atomic_inc(&dev->total_open);
                spin_lock(&dev->count_lock);
                if (!dev->open_count++) {
@@ -360,13 +433,12 @@ int tdfx_open(struct inode *inode, struct file *filp)
 int tdfx_release(struct inode *inode, struct file *filp)
 {
        drm_file_t    *priv   = filp->private_data;
-       drm_device_t  *dev;
+       drm_device_t  *dev    = priv->dev;
        int           retcode = 0;
 
-       lock_kernel();
-       dev    = priv->dev;
        DRM_DEBUG("open_count = %d\n", dev->open_count);
        if (!(retcode = drm_release(inode, filp))) {
+               MOD_DEC_USE_COUNT;
                atomic_inc(&dev->total_close);
                spin_lock(&dev->count_lock);
                if (!--dev->open_count) {
@@ -375,17 +447,13 @@ int tdfx_release(struct inode *inode, struct file *filp)
                                          atomic_read(&dev->ioctl_count),
                                          dev->blocked);
                                spin_unlock(&dev->count_lock);
-                               unlock_kernel();
                                return -EBUSY;
                        }
                        spin_unlock(&dev->count_lock);
-                       retcode = tdfx_takedown(dev);
-                       unlock_kernel();
-                       return retcode;
+                       return tdfx_takedown(dev);
                }
                spin_unlock(&dev->count_lock);
        }
-       unlock_kernel();
        return retcode;
 }
 
@@ -500,7 +568,9 @@ int tdfx_lock(struct inode *inode, struct file *filp, unsigned int cmd,
                                 /* Contention */
                         atomic_inc(&dev->total_sleeps);
                         current->state = TASK_INTERRUPTIBLE;
+#if 1
                        current->policy |= SCHED_YIELD;
+#endif
                         schedule();
                         if (signal_pending(current)) {
                                 ret = -ERESTARTSYS;
@@ -549,11 +619,12 @@ int tdfx_lock(struct inode *inode, struct file *filp, unsigned int cmd,
                }
         }
 
+#if LINUX_VERSION_CODE < 0x020400
        if (lock.context != tdfx_res_ctx.handle) {
                current->counter = 5;
-               current->nice = 0;
+               current->priority = DEF_PRIORITY/4;
        }
-
+#endif
         DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
 
 #if DRM_DMA_HISTOGRAM
@@ -593,29 +664,13 @@ int tdfx_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
                        DRM_ERROR("\n");
                }
        }
-       
+
+#if LINUX_VERSION_CODE < 0x020400
        if (lock.context != tdfx_res_ctx.handle) {
                current->counter = 5;
-               current->nice = 0;
+               current->priority = DEF_PRIORITY;
        }
-
+#endif
+       
        return 0;
 }
-
-module_init(tdfx_init);
-module_exit(tdfx_cleanup);
-
-#ifndef MODULE
-/*
- * tdfx_setup is called by the kernel to parse command-line options passed
- * via the boot-loader (e.g., LILO).  It calls the insmod option routine,
- * drm_parse_options.
- */
-static int __init tdfx_options(char *str)
-{
-       drm_parse_options(str);
-       return 1;
-}
-
-__setup("tdfx=", tdfx_options);
-#endif
index 4c0c3282b24d863373d3452ba389da71a8e5a272..6bfcef1d0b0682941a2e707c911c380a558585c2 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Thu Oct  7 10:40:04 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,8 +25,8 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
- *    Daryll Strauss <daryll@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
+ *    Daryll Strauss <daryll@valinux.com>
  * 
  */
 
index b6595c88c20a642d3d8800cdd1ce9b5c8cda54c6..9dfd0d2b0149f7ea134ac71060cb08ade2fa1389 100644 (file)
@@ -2,6 +2,7 @@
  * Created: Mon Jan  4 08:58:31 1999 by faith@precisioninsight.com
  *
  * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +25,7 @@
  * DEALINGS IN THE SOFTWARE.
  * 
  * Authors:
- *    Rickard E. (Rik) Faith <faith@precisioninsight.com>
+ *    Rickard E. (Rik) Faith <faith@valinux.com>
  *
  */
 
@@ -87,7 +88,7 @@ struct page *drm_vm_shm_nopage(struct vm_area_struct *vma,
 
        offset   = address - vma->vm_start;
        page     = offset >> PAGE_SHIFT;
-       physical = (unsigned long)dev->lock.hw_lock + (offset & (~PAGE_MASK));
+       physical = (unsigned long)dev->lock.hw_lock + offset;
        atomic_inc(&mem_map[MAP_NR(physical)].count); /* Dec. by kernel */
 
        DRM_DEBUG("0x%08lx (page %lu) => 0x%08lx\n", address, page, physical);
@@ -144,6 +145,7 @@ void drm_vm_open(struct vm_area_struct *vma)
        DRM_DEBUG("0x%08lx,0x%08lx\n",
                  vma->vm_start, vma->vm_end - vma->vm_start);
        atomic_inc(&dev->vma_count);
+       MOD_INC_USE_COUNT;
 
 #if DRM_DEBUG_CODE
        vma_entry = drm_alloc(sizeof(*vma_entry), DRM_MEM_VMAS);
@@ -168,6 +170,7 @@ void drm_vm_close(struct vm_area_struct *vma)
 
        DRM_DEBUG("0x%08lx,0x%08lx\n",
                  vma->vm_start, vma->vm_end - vma->vm_start);
+       MOD_DEC_USE_COUNT;
        atomic_dec(&dev->vma_count);
 
 #if DRM_DEBUG_CODE
@@ -244,13 +247,26 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
                                /* Check for valid size. */
        if (map->size != vma->vm_end - vma->vm_start) return -EINVAL;
        
+       if (!capable(CAP_SYS_ADMIN) && (map->flags & _DRM_READ_ONLY)) {
+               vma->vm_flags &= VM_MAYWRITE;
+#if defined(__i386__)
+               pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
+#else
+                               /* Ye gads this is ugly.  With more thought
+                                   we could move this up higher and use
+                                   `protection_map' instead.  */
+               vma->vm_page_prot = __pgprot(pte_val(pte_wrprotect(
+                       __pte(pgprot_val(vma->vm_page_prot)))));
+#endif
+       }
 
        switch (map->type) {
        case _DRM_FRAME_BUFFER:
        case _DRM_REGISTERS:
+       case _DRM_AGP:
                if (VM_OFFSET(vma) >= __pa(high_memory)) {
 #if defined(__i386__)
-                       if (boot_cpu_data.x86 > 3) {
+                       if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
                                pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
                                pgprot_val(vma->vm_page_prot) &= ~_PAGE_PWT;
                        }
@@ -262,6 +278,10 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
                                     vma->vm_end - vma->vm_start,
                                     vma->vm_page_prot))
                                return -EAGAIN;
+               DRM_DEBUG("   Type = %d; start = 0x%lx, end = 0x%lx,"
+                         " offset = 0x%lx\n",
+                         map->type,
+                         vma->vm_start, vma->vm_end, VM_OFFSET(vma));
                vma->vm_ops = &drm_vm_ops;
                break;
        case _DRM_SHM:
@@ -274,19 +294,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
                return -EINVAL; /* This should never happen. */
        }
        vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
-       if (map->flags & _DRM_READ_ONLY) {
-#if defined(__i386__)
-               pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
-#else
-                               /* Ye gads this is ugly.  With more thought
-                                   we could move this up higher and use
-                                   `protection_map' instead.  */
-               vma->vm_page_prot = __pgprot(pte_val(pte_wrprotect(
-                       __pte(pgprot_val(vma->vm_page_prot)))));
-#endif
-       }
 
-       
 #if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
                                /* In Linux 2.2.3 and above, this is
                                   handled in do_mmap() in mm/mmap.c. */
index 52f66ba5fbf54ccc6b417e524c92f9632ce9143e..7e48ad82149b6f4d0a8c45a64303e9ed59b656a0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: hp600_keyb.c,v 1.1 2000/06/10 21:45:30 yaegashi Exp $ 
+ *     $Id: hp600_keyb.c,v 1.1 2000/06/10 21:45:30 yaegashi Exp $
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     HP600 keyboard scan routine and translate table
  */
index a49e1c48e7ba202c4f168ad47c4a2c19d1bbe013..42be56d7a469d2d415161b232a10f15b7308f1de 100644 (file)
@@ -53,6 +53,7 @@
  *     this driver.)
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index 5bc1bdff9b942a95163d20e8958afa3515321ef7..7ec7034e0ff7f8959ff8d64505e59a0394fc9609 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: scan_keyb.c,v 1.1 2000/06/10 21:45:30 yaegashi Exp $ 
+ *     $Id: scan_keyb.c,v 1.2 2000/07/04 06:24:42 yaegashi Exp $ 
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     Generic scan keyboard driver
  */
index 849b508706f10952ef37cb0e70c05dcd8ac79cf3..257024086a93b40edf0381d0733568db3edd7466 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef        __DRIVER_CHAR_SCAN_KEYB_H
 #define        __DRIVER_CHAR_SCAN_KEYB_H
 /*
- *     $Id: scan_keyb.h,v 1.1 2000/06/10 21:45:30 yaegashi Exp $ 
+ *     $Id: scan_keyb.h,v 1.1 2000/06/10 21:45:30 yaegashi Exp $
  *     Copyright (C) 2000 YAEGASHI Takeshi
  *     Generic scan keyboard driver
  */
index 1fc7a38b544d4e726e7c75f15c281d3dbd49e444..d116e2a9103f91fb1bafd0fc4e6815185051f81e 100644 (file)
@@ -49,6 +49,8 @@
  *  6/00: Remove old-style timer, use timer_list
  *        Andrew Morton <andrewm@uow.edu.au>
  *
+ *  7/00: Support Timedia/Sunix/Exsys PCI cards
+ *
  * This module exports the following rs232 io functions:
  *
  *     int rs_init(void);
@@ -3791,6 +3793,7 @@ static _INLINE_ int get_pci_port(struct pci_dev *dev,
        unsigned long port;
        int base_idx;
        int max_port;
+       int offset;
 
        base_idx = SPCI_FL_GET_BASE(board->flags);
        if (board->flags & SPCI_FL_BASE_TABLE)
@@ -3801,8 +3804,27 @@ static _INLINE_ int get_pci_port(struct pci_dev *dev,
                if (idx >= max_port)
                        return 1;
        }
-                       
-       port = pci_resource_start(dev, base_idx) + board->first_uart_offset;
+
+       offset = board->first_uart_offset;
+
+       /* Timedia/SUNIX uses a mixture of BARs and offsets */
+       if(dev->vendor == PCI_VENDOR_ID_TIMEDIA )  /* 0x1409 */
+               switch(idx) {
+                       case 0: base_idx=0;
+                               break;
+                       case 1: base_idx=0; offset=8;
+                               break;
+                       case 2: base_idx=1; 
+                               break;
+                       case 3: base_idx=1; offset=8;
+                               break;
+                       case 4: /* BAR 2*/
+                       case 5: /* BAR 3 */
+                       case 6: /* BAR 4*/
+                       case 7: base_idx=idx-2; /* BAR 5*/
+               }
+  
+       port =  pci_resource_start(dev, base_idx) + offset;
 
        if ((board->flags & SPCI_FL_BASE_TABLE) == 0)
                port += idx * (board->uart_offset ? board->uart_offset : 8);
@@ -4243,9 +4265,75 @@ static struct pci_board pci_boards[] __initdata = {
        {       PCI_VENDOR_ID_OXSEMI, PCI_DEVICE_ID_OXSEMI_16PCI95N,
                PCI_ANY_ID, PCI_ANY_ID,
                SPCI_FL_BASE0 | SPCI_FL_REGION_SZ_CAP, 32, 115200 },
-       {       PCI_VENDOR_ID_TIMEDIA, PCI_DEVICE_ID_TIMEDIA_1889,
-               PCI_ANY_ID, PCI_ANY_ID,
-               SPCI_FL_BASE0 , 2, 921600 },
+       /*      PCI_VENDOR_ID_TIMEDIA/Sunix, PCI_DEVICE_ID_TIMEDIA_1889, */
+       {       0x1409, 0x7168, 0x1409, 0x0002, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4036A*/
+       {       0x1409, 0x7168, 0x1409, 0x4025, SPCI_FL_BASE_TABLE, 1, 921600 }, /*4025A*/
+       {       0x1409, 0x7168, 0x1409, 0x4027, SPCI_FL_BASE_TABLE, 1, 921600 }, /*4027A*/
+       {       0x1409, 0x7168, 0x1409, 0x4028, SPCI_FL_BASE_TABLE, 1, 921600 }, /*4028D*/
+       {       0x1409, 0x7168, 0x1409, 0x4036, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4036D*/
+       {       0x1409, 0x7168, 0x1409, 0x4037, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4037A*/
+       {       0x1409, 0x7168, 0x1409, 0x4038, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4038D*/
+       {       0x1409, 0x7168, 0x1409, 0x4055, SPCI_FL_BASE_TABLE, 4, 921600 }, /*4055A*/
+       {       0x1409, 0x7168, 0x1409, 0x4056, SPCI_FL_BASE_TABLE, 4, 921600 }, /*4056A*/
+       {       0x1409, 0x7168, 0x1409, 0x4065, SPCI_FL_BASE_TABLE, 8, 921600 }, /*4065A*/
+       {       0x1409, 0x7168, 0x1409, 0x4066, SPCI_FL_BASE_TABLE, 8, 921600 }, /*4066A*/
+       {       0x1409, 0x7168, 0x1409, 0x4078, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4078A*/
+       {       0x1409, 0x7168, 0x1409, 0x4079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079H*/
+       {       0x1409, 0x7168, 0x1409, 0x4085, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4085H*/
+       {       0x1409, 0x7168, 0x1409, 0x4088, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4088A*/
+       {       0x1409, 0x7168, 0x1409, 0x4089, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4089A*/
+       {       0x1409, 0x7168, 0x1409, 0x4095, SPCI_FL_BASE_TABLE, 4, 921600 }, /*4095A*/
+       {       0x1409, 0x7168, 0x1409, 0x4096, SPCI_FL_BASE_TABLE, 4, 921600 }, /*4096A*/
+       {       0x1409, 0x7168, 0x1409, 0x5025, SPCI_FL_BASE_TABLE, 1, 921600 }, /*4025D*/
+       {       0x1409, 0x7168, 0x1409, 0x5027, SPCI_FL_BASE_TABLE, 1, 921600 }, /*4027D*/
+       {       0x1409, 0x7168, 0x1409, 0x5037, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4037D*/
+       {       0x1409, 0x7168, 0x1409, 0x5056, SPCI_FL_BASE_TABLE, 4, 921600 }, /*4056R*/
+       {       0x1409, 0x7168, 0x1409, 0x5065, SPCI_FL_BASE_TABLE, 8, 921600 }, /*4065R*/
+       {       0x1409, 0x7168, 0x1409, 0x5066, SPCI_FL_BASE_TABLE, 8, 921600 }, /*4066R*/
+       {       0x1409, 0x7168, 0x1409, 0x5078, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4078U*/
+       {       0x1409, 0x7168, 0x1409, 0x5079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079A*/
+       {       0x1409, 0x7168, 0x1409, 0x5085, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4085U*/
+       {       0x1409, 0x7168, 0x1409, 0x6079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079R*/
+       {       0x1409, 0x7168, 0x1409, 0x7079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079S*/
+       {       0x1409, 0x7168, 0x1409, 0x8079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079D*/
+       {       0x1409, 0x7168, 0x1409, 0x8137, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8137*/
+       {       0x1409, 0x7168, 0x1409, 0x8138, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8138*/
+       {       0x1409, 0x7168, 0x1409, 0x8156, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8156*/
+       {       0x1409, 0x7168, 0x1409, 0x8157, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8157*/
+       {       0x1409, 0x7168, 0x1409, 0x8166, SPCI_FL_BASE_TABLE, 8, 921600 }, /*8166*/
+       {       0x1409, 0x7168, 0x1409, 0x8237, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8237*/
+       {       0x1409, 0x7168, 0x1409, 0x8238, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8238*/
+       {       0x1409, 0x7168, 0x1409, 0x8256, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8256*/
+       {       0x1409, 0x7168, 0x1409, 0x8257, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8257*/
+       {       0x1409, 0x7168, 0x1409, 0x9056, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9056A*/
+       {       0x1409, 0x7168, 0x1409, 0x9066, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9066A*/
+       {       0x1409, 0x7168, 0x1409, 0x9079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079E*/
+       {       0x1409, 0x7168, 0x1409, 0x9137, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8137S*/
+       {       0x1409, 0x7168, 0x1409, 0x9138, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8138S*/
+       {       0x1409, 0x7168, 0x1409, 0x9156, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8156S*/
+       {       0x1409, 0x7168, 0x1409, 0x9157, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8157S*/
+       {       0x1409, 0x7168, 0x1409, 0x9158, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9158*/
+       {       0x1409, 0x7168, 0x1409, 0x9159, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9159*/
+       {       0x1409, 0x7168, 0x1409, 0x9166, SPCI_FL_BASE_TABLE, 8, 921600 }, /*8166S*/
+       {       0x1409, 0x7168, 0x1409, 0x9167, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9167*/
+       {       0x1409, 0x7168, 0x1409, 0x9168, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9168*/
+       {       0x1409, 0x7168, 0x1409, 0x9237, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8237S*/
+       {       0x1409, 0x7168, 0x1409, 0x9238, SPCI_FL_BASE_TABLE, 2, 921600 }, /*8238S*/
+       {       0x1409, 0x7168, 0x1409, 0x9256, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8256S*/
+       {       0x1409, 0x7168, 0x1409, 0x9257, SPCI_FL_BASE_TABLE, 4, 921600 }, /*8257S*/
+       {       0x1409, 0x7168, 0x1409, 0xA056, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9056B*/
+       {       0x1409, 0x7168, 0x1409, 0xA066, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9066B*/
+       {       0x1409, 0x7168, 0x1409, 0xA079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*4079F*/
+       {       0x1409, 0x7168, 0x1409, 0xA157, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9157*/
+       {       0x1409, 0x7168, 0x1409, 0xA158, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9158S*/
+       {       0x1409, 0x7168, 0x1409, 0xA159, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9159S*/
+       {       0x1409, 0x7168, 0x1409, 0xA167, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9167S*/
+       {       0x1409, 0x7168, 0x1409, 0xA168, SPCI_FL_BASE_TABLE, 8, 921600 }, /*9168S*/
+       {       0x1409, 0x7168, 0x1409, 0xB056, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9056C*/
+       {       0x1409, 0x7168, 0x1409, 0xB079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*9079A*/
+       {       0x1409, 0x7168, 0x1409, 0xB157, SPCI_FL_BASE_TABLE, 4, 921600 }, /*9157S*/
+       {       0x1409, 0x7168, 0x1409, 0xC079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*9079B*/
+       {       0x1409, 0x7168, 0x1409, 0xD079, SPCI_FL_BASE_TABLE, 2, 921600 }, /*9079C*/
        {       PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_DSERIAL,
                PCI_ANY_ID, PCI_ANY_ID,
                SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
index b51e91557a0416aa55e828252d16bf6a7be120e0..12ab34d721f57a7d16e4ebb468f1a99640a540b6 100644 (file)
 #include <linux/generic_serial.h>
 
 #ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-static void gdb_detach(void);
-static int in_gdb = 1;
-#define IN_GDB in_gdb
+#include <asm/sh_bios.h>
 #endif
+
 #include "sh-sci.h"
 
 #ifdef CONFIG_SERIAL_CONSOLE
 static struct console sercons;
-static struct sci_port* sercons_port;
+static struct sci_port* sercons_port=0;
 static int sercons_baud;
 #endif
 
 /* Function prototypes */
 static void sci_init_pins_sci(struct sci_port* port, unsigned int cflag);
+#ifndef SCI_ONLY
 static void sci_init_pins_scif(struct sci_port* port, unsigned int cflag);
+#endif
+static void sci_init_pins_irda(struct sci_port* port, unsigned int cflag);
 static void sci_disable_tx_interrupts(void *ptr);
 static void sci_enable_tx_interrupts(void *ptr);
 static void sci_disable_rx_interrupts(void *ptr);
@@ -86,6 +88,117 @@ int sci_debug = 0;
 MODULE_PARM(sci_debug, "i");
 #endif
 
+static void put_char(struct sci_port *port, char c)
+{
+       unsigned long flags;
+       unsigned short status;
+
+       save_and_cli(flags);
+
+       do
+               status = sci_in(port, SCxSR);
+       while (!(status & SCxSR_TDxE(port)));
+  
+       sci_out(port, SCxTDR, c);
+       sci_in(port, SCxSR);            /* Dummy read */
+       sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
+
+       restore_flags(flags);
+}
+
+static void handle_error(struct sci_port *port)
+{                              /* Clear error flags */
+       sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));
+}
+
+static int get_char(struct sci_port *port)
+{
+       unsigned long flags;
+       unsigned short status;
+       int c;
+
+       save_and_cli(flags);
+        do {
+               status = sci_in(port, SCxSR);
+               if (status & SCxSR_ERRORS(port)) {
+                       handle_error(port);
+                       continue;
+               }
+       } while (!(status & SCxSR_RDxF(port)));
+       c = sci_in(port, SCxRDR);
+       sci_in(port, SCxSR);            /* Dummy read */
+       sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
+       restore_flags(flags);
+
+       return c;
+}
+
+#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+
+/* Taken from sh-stub.c of GDB 4.18 */
+static const char hexchars[] = "0123456789abcdef";
+
+static __inline__ char highhex(int  x)
+{
+       return hexchars[(x >> 4) & 0xf];
+}
+
+static __inline__ char lowhex(int  x)
+{
+       return hexchars[x & 0xf];
+}
+
+#endif
+
+/*
+ * Send the packet in buffer.  The host gets one chance to read it.
+ * This routine does not wait for a positive acknowledge.
+ */
+
+static void put_string(struct sci_port *port,
+                                 const char *buffer, int count)
+{
+       int i;
+       const unsigned char *p = buffer;
+#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
+       int checksum;
+
+       /* This call only does a trap the first time it is
+        * called, and so is safe to do here unconditionally
+        */
+       if (sh_bios_in_gdb_mode()) {
+           /*  $<packet info>#<checksum>. */
+           do {
+               unsigned char c;
+               put_char(port, '$');
+               put_char(port, 'O'); /* 'O'utput to console */
+               checksum = 'O';
+
+               for (i=0; i<count; i++) { /* Don't use run length encoding */
+                       int h, l;
+
+                       c = *p++;
+                       h = highhex(c);
+                       l = lowhex(c);
+                       put_char(port, h);
+                       put_char(port, l);
+                       checksum += h + l;
+               }
+               put_char(port, '#');
+               put_char(port, highhex(checksum));
+               put_char(port, lowhex(checksum));
+           } while  (get_char(port) != '+');
+       } else
+#endif
+       for (i=0; i<count; i++) {
+               if (*p == 10)
+                       put_char(port, '\r');
+               put_char(port, *p++);
+       }
+}
+
+
+
 static struct real_driver sci_real_driver = {
        sci_disable_tx_interrupts,
        sci_enable_tx_interrupts,
@@ -139,6 +252,16 @@ static void sci_init_pins_scif(struct sci_port* port, unsigned int cflag)
        sci_out(port, SCFCR, fcr_val);
 }
 
+static void sci_init_pins_irda(struct sci_port* port, unsigned int cflag)
+{
+       unsigned int fcr_val = 0;
+
+       if (cflag & CRTSCTS)
+               fcr_val |= SCFCR_MCE;
+
+       sci_out(port, SCFCR, fcr_val);
+}
+
 #else
 
 /* For SH7750 */
@@ -359,7 +482,7 @@ static void sci_transmit_chars(struct sci_port *port)
        } else {
                if (port->type == PORT_SCIF) {
                        sci_in(port, SCxSR); /* Dummy read */
-                       sci_out(port, SCxSR, SCIF_TDFE);
+                       sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
                }
                ctrl |= SCI_CTRL_FLAGS_TIE;
        }
@@ -715,7 +838,7 @@ static int sci_read_proc(char *page, char **start, off_t off, int count,
        struct sci_port *port;
        int len = 0;
        
-        len += sprintf(page, "serinfo:1.0\n");
+        len += sprintf(page, "sciinfo:0.1\n");
        for (i = 0; i < SCI_NPORTS && len < 4000; i++) {
                port = &sci_ports[i];
                len += sprintf(page+len, "%d: uart:%s address: %08x\n", i,
@@ -737,8 +860,8 @@ static int sci_init_drivers(void)
 
        memset(&sci_driver, 0, sizeof(sci_driver));
        sci_driver.magic = TTY_DRIVER_MAGIC;
-       sci_driver.driver_name = "serial";
-       sci_driver.name = "ttyS";
+       sci_driver.driver_name = "sci";
+       sci_driver.name = "ttySC";
        sci_driver.major = SCI_MAJOR;
        sci_driver.minor_start = SCI_MINOR_START;
        sci_driver.num = SCI_NPORTS;
@@ -774,7 +897,7 @@ static int sci_init_drivers(void)
 
        sci_callout_driver = sci_driver;
        sci_callout_driver.name = "cusc";
-       sci_callout_driver.major = SCI_MAJOR + 1;
+       sci_callout_driver.major = SCI_MAJOR+1;
        sci_callout_driver.subtype = SERIAL_TYPE_CALLOUT;
        sci_callout_driver.read_proc = NULL;
 
@@ -808,17 +931,22 @@ static int sci_init_drivers(void)
 int __init sci_init(void)
 {
        struct sci_port *port;
-       int i;
+       int i, j;
        void (*handlers[3])(int irq, void *ptr, struct pt_regs *regs) = {
                sci_er_interrupt, sci_rx_interrupt, sci_tx_interrupt
        };
 
-       for (port = &sci_ports[0]; port < &sci_ports[SCI_NPORTS]; port++) {
+       printk("SuperH SCI(F) driver initialized\n");
+
+       for (j=0; j<SCI_NPORTS; j++) {
+               port = &sci_ports[j];
+               printk("ttySC%d at 0x%08x is a %s\n", j, port->base,
+                      (port->type == PORT_SCI) ? "SCI" : "SCIF");
                for (i=0; i<3; i++) {
                        set_ipr_data(port->irqs[i], port->intc_addr, port->intc_pos, SCI_PRIORITY);
 
                        if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT,
-                                       "serial", port)) {
+                                       "sci", port)) {
                                printk(KERN_ERR "sci: Cannot allocate irq.\n");
                                return -ENODEV;
                        }
@@ -829,7 +957,7 @@ int __init sci_init(void)
        sci_init_drivers();
 
 #ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-       gdb_detach();
+       sh_bios_gdb_detach();
 #endif
        return 0;               /* Return -EIO when not detected */
 }
@@ -855,27 +983,6 @@ void cleanup_module(void)
 #endif
 
 #ifdef CONFIG_SERIAL_CONSOLE
-/*
- * ------------------------------------------------------------
- * Serial console driver for SH-3/SH-4 SCI (with no FIFO)
- * ------------------------------------------------------------
- */
-
-#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-
-static void __init gdb_detach(void)
-{
-       asm volatile("trapa     #0xff");
-
-       if (in_gdb == 1) {
-               in_gdb = 0;
-               get_char(sercons_port);
-               put_char(sercons_port, '\r');
-               put_char(sercons_port, '\n');
-       }
-}
-#endif
-
 /*
  *     Print a string to the serial port trying not to disturb
  *     any possible real use of the port...
@@ -992,8 +1099,18 @@ static struct console sercons = {
  *     Register console.
  */
 
-void __init serial_console_init(void)
+#ifdef CONFIG_SH_EARLY_PRINTK
+extern void sh_console_unregister (void);
+#endif
+
+void __init sci_console_init(void)
 {
        register_console(&sercons);
+#ifdef CONFIG_SH_EARLY_PRINTK
+       /* Now that the real console is available, unregister the one we
+        * used while first booting.
+        */
+       sh_console_unregister();
+#endif
 }
 #endif /* CONFIG_SERIAL_CONSOLE */
index ddf5712a5ddee7acd2cda24e6f00d2f18ce37f5c..b9ecad78b8bd52f0d69183a4e2531033b9b18ea1 100644 (file)
@@ -13,6 +13,7 @@
 /* Values for sci_port->type */
 #define PORT_SCI  0
 #define PORT_SCIF 1
+#define PORT_IRDA 1            /* XXX: temporary assignment */
 
 /* Offsets into the sci_port->irqs array */
 #define SCIx_ERI_IRQ 0
@@ -22,6 +23,7 @@
 /*                     ERI, RXI, TXI,   INTC reg, INTC pos */
 #define SCI_IRQS      { 23,  24,  25 }, INTC_IPRB, 1
 #define SH3_SCIF_IRQS { 56,  57,  59 }, INTC_IPRE, 1
+#define SH3_IRDA_IRQS { 52,  53,  55 }, INTC_IPRE, 2
 #define SH4_SCIF_IRQS { 40,  41,  43 }, INTC_IPRC, 1
 
 #if defined(CONFIG_CPU_SUBTYPE_SH7708)
 # define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
 # define SCI_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH7709)
-# define SCI_NPORTS 2
+# define SCI_NPORTS 3
 # define SCI_INIT { \
-  { {}, PORT_SCI,  0xfffffe80, SCI_IRQS,      sci_init_pins_sci  }, \
-  { {}, PORT_SCIF, 0xA4000150, SH3_SCIF_IRQS, sci_init_pins_scif }  \
+  { {}, PORT_SCI,  0xfffffe80, SCI_IRQS,        sci_init_pins_sci  }, \
+  { {}, PORT_SCIF, 0xA4000150, SH3_SCIF_IRQS, sci_init_pins_scif },   \
+  { {}, PORT_SCIF, 0xA4000140, SH3_IRDA_IRQS, sci_init_pins_irda }    \
 }
 # define SCPCR  0xA4000116 /* 16 bit SCI and SCIF */
 # define SCPDR  0xA4000136 /* 8  bit SCI and SCIF */
 
 #define SCI_PRIORITY   3
 
-#define SCI_MAJOR            204
+#define SCI_MAJOR              204
 #define SCI_MINOR_START                8
 
 /* Generic serial flags */
@@ -261,11 +264,20 @@ SCIF_FNS(SCFDR,                      0x0e, 16, 0x1C, 16)
  * scaling the value which is needed in SCBRR.
  *
  * -- Stuart Menefy - 23 May 2000
+ *
+ * I meant, why would anyone bother with bitrates below 2400.
+ *
+ * -- Greg Banks - 7Jul2000
+ *
+ * You "speedist"!  How will I use my 110bps ASR-33 teletype with paper
+ * tape reader as a console!
+ *
+ * -- Mitch Davis - 15 Jul 2000
  */
 
 #define PCLK           (current_cpu_data.module_clock)
 
-#define SCBRR_VALUE(bps) (PCLK/(32*bps)-1)
+#define SCBRR_VALUE(bps) ((PCLK+16*bps)/(32*bps)-1)
 #define BPS_2400       SCBRR_VALUE(2400)
 #define BPS_4800       SCBRR_VALUE(4800)
 #define BPS_9600       SCBRR_VALUE(9600)
@@ -273,106 +285,3 @@ SCIF_FNS(SCFDR,                      0x0e, 16, 0x1C, 16)
 #define BPS_38400      SCBRR_VALUE(38400)
 #define BPS_115200     SCBRR_VALUE(115200)
 
-#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-/* Taken from sh-stub.c of GDB 4.18 */
-static const char hexchars[] = "0123456789abcdef";
-
-static __inline__ char highhex(int  x)
-{
-       return hexchars[(x >> 4) & 0xf];
-}
-
-static __inline__ char lowhex(int  x)
-{
-       return hexchars[x & 0xf];
-}
-#endif
-
-static __inline__ void put_char(struct sci_port *port, char c)
-{
-       unsigned long flags;
-       unsigned short status;
-
-       save_and_cli(flags);
-
-       do
-               status = sci_in(port, SCxSR);
-       while (!(status & SCxSR_TDxE(port)));
-
-       sci_out(port, SCxTDR, c);
-       sci_in(port, SCxSR);            /* Dummy read */
-       sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
-
-       restore_flags(flags);
-}
-
-static __inline__ void handle_error(struct sci_port *port)
-{                              /* Clear error flags */
-       sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));
-}
-
-static __inline__ int get_char(struct sci_port *port)
-{
-       unsigned long flags;
-       unsigned short status;
-       int c;
-
-       save_and_cli(flags);
-        do {
-               status = sci_in(port, SCxSR);
-               if (status & SCxSR_ERRORS(port)) {
-                       handle_error(port);
-                       continue;
-               }
-       } while (!(status & SCxSR_RDxF(port)));
-       c = sci_in(port, SCxRDR);
-       sci_in(port, SCxSR);            /* Dummy read */
-       sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
-       restore_flags(flags);
-
-       return c;
-}
-
-/*
- * Send the packet in buffer.  The host get's one chance to read it.
- * This routine does not wait for a positive acknowledge.
- */
-
-static __inline__ void put_string(struct sci_port *port,
-                                 const char *buffer, int count)
-{
-       int i;
-       const unsigned char *p = buffer;
-#ifdef CONFIG_DEBUG_KERNEL_WITH_GDB_STUB
-       int checksum;
-
-if (IN_GDB) {
-       /*  $<packet info>#<checksum>. */
-       do {
-               unsigned char c;
-               put_char(port, '$');
-               put_char(port, 'O'); /* 'O'utput to console */
-               checksum = 'O';
-
-               for (i=0; i<count; i++) { /* Don't use run length encoding */
-                       int h, l;
-
-                       c = *p++;
-                       h = highhex(c);
-                       l = lowhex(c);
-                       put_char(port, h);
-                       put_char(port, l);
-                       checksum += h + l;
-               }
-               put_char(port, '#');
-               put_char(port, highhex(checksum));
-               put_char(port, lowhex(checksum));
-       } while  (get_char(port) != '+');
-} else
-#endif
-       for (i=0; i<count; i++) {
-               if (*p == 10)
-                       put_char(port, '\r');
-               put_char(port, *p++);
-       }
-}
index 7b42d645fb76eaf865475985afb32059c37eb26e..4e8d4db7321d657f94fa667f683af834bfa4dde6 100644 (file)
@@ -151,6 +151,7 @@ extern void con3215_init(void);
 extern void rs285_console_init(void);
 extern void sa1100_rs_console_init(void);
 extern void sgi_serial_console_init(void);
+extern void sci_console_init(void);
 
 #ifndef MIN
 #define MIN(a,b)       ((a) < (b) ? (a) : (b))
@@ -2181,6 +2182,9 @@ void __init console_init(void)
 #if defined(CONFIG_SERIAL167)
        serial167_console_init();
 #endif
+#if defined(CONFIG_SH_SCI)
+       sci_console_init();
+#endif
 #endif
 #ifdef CONFIG_3215
         con3215_init();
index bd89fcc616dd7253cffe07a19bb1f400c94e6511..29860339439e1ba6d273860e27191ab47fb0b4e1 100644 (file)
@@ -1539,7 +1539,7 @@ static idetape_pc_t *idetape_next_pc_storage (ide_drive_t *drive)
  
 /**************************************************************
  *                                                            *
- *  This should get fixed to use kmalloc(GFP_ATOMIC, ..)      *
+ *  This should get fixed to use kmalloc(.., GFP_ATOMIC)      *
  *  followed later on by kfree().   -ml                       *
  *                                                            *
  **************************************************************/
index 065bcf8df0fd02c8af57a3e92888380eeb9decf9..573c5ef200a567fcc69d0a53d5ce530cccdc7322 100644 (file)
  * 13-03-1999: Get DeviceID from non-IEEE 1284.3 devices too.
  * 22-02-2000: Count devices that are actually detected.
  *
- * The block comments above the functions in this file are
- * licensed as part of the generated file
- * Documentation/DocBook/parportbook.sgml under the GNU Free
- * Documentation License.
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
  */
 
 #include <linux/parport.h>
@@ -51,7 +50,7 @@ static int assign_addrs (struct parport *port);
 static void add_dev (int devnum, struct parport *port, int daisy)
 {
        struct daisydev *newdev;
-       newdev = kmalloc (GFP_KERNEL, sizeof (struct daisydev));
+       newdev = kmalloc (sizeof (struct daisydev), GFP_KERNEL);
        if (newdev) {
                newdev->port = port;
                newdev->daisy = daisy;
index c148a5b0c9e7ea19a4da342461543854944a87c8..0d84fd1a10e82ba1bfd83d1a65bdf583c3848d5d 100644 (file)
@@ -9,10 +9,9 @@
  * This file is responsible for IEEE 1284 negotiation, and for handing
  * read/write requests to low-level drivers.
  *
- * The block comments above the functions in this file are
- * licensed as part of the generated file
- * Documentation/DocBook/parportbook.sgml under the GNU Free
- * Documentation License.
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
  */
 
 #include <linux/config.h>
index 92618e7b4680efa41e186920c08b23490a8f880d..c4c6a44b3dc07dc6952a38bd78f8098b3ef3a12e 100644 (file)
  * based on work by Grant Guenther <grant@torque.net>
  *          and Philip Blundell
  *
- * The block comments above the functions in this file are
- * licensed as part of the generated file
- * Documentation/DocBook/parportbook.sgml under the GNU Free
- * Documentation License.
+ * Any part of this program may be used in documents licensed under
+ * the GNU Free Documentation License, Version 1.1 or any later version
+ * published by the Free Software Foundation.
  */
 
 #undef PARPORT_DEBUG_SHARING           /* undef for production */
index 4345f1211fba90a676b7254e24eec0cf806c2559..f2b842e1652390b4e75adf3fbd25ca4983b7e9b2 100644 (file)
@@ -31,7 +31,7 @@ static int chandev_conf_read=FALSE;
 
 static void *chandev_alloc_listmember(list **listhead,size_t size)
 {
-       void *newmember=kmalloc(GFP_KERNEL,size);
+       void *newmember=kmalloc(size, GFP_KERNEL);
        if(newmember)
                add_to_list(listhead,newmember);
        return(newmember);
index b3b8d17fb94e2c63cc7787beaa0985415dac4848..ebe4e33bae528f8c4df44cd58d85f87a6bb68a31 100644 (file)
@@ -2,6 +2,8 @@
    3w-xxxx.c -- 3ware Storage Controller device driver for Linux.
 
    Written By: Adam Radford <linux@3ware.com>
+   Modifications By: Joel Jacobson <linux@3ware.com>
+
    Copyright (C) 1999-2000 3ware Inc.
 
    Kernel compatablity By:     Andre Hedrick <andre@suse.com>
 
    For more information, goto:
    http://www.3ware.com
+
+   History
+   -------
+   0.1.000 -     Initial release.
+   0.4.000 -     Added support for Asynchronous Event Notification through
+                 ioctls for 3DM.
+   1.0.000 -     Added DPO & FUA bit support for WRITE_10 & WRITE_6 cdb
+                 to disable drive write-cache before writes.
+   1.1.000 -     Fixed performance bug with DPO & FUA not existing for WRITE_6.
+   1.2.000 -     Added support for clean shutdown notification/feature table.
+   1.02.00.001 - Added support for full command packet posts through ioctls
+                 for 3DM.
+                 Bug fix so hot spare drives don't show up.
 */
 
 #include <linux/module.h>
@@ -65,6 +80,7 @@ MODULE_DESCRIPTION ("3ware Storage Controller Linux Driver");
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/smp.h>
+#include <linux/reboot.h>
 #include <linux/spinlock.h>
 
 #include <asm/errno.h>
@@ -83,9 +99,15 @@ MODULE_DESCRIPTION ("3ware Storage Controller Linux Driver");
 static int tw_copy_info(TW_Info *info, char *fmt, ...);
 static void tw_copy_mem_info(TW_Info *info, char *data, int len);
 static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static int tw_halt(struct notifier_block *nb, ulong event, void *buf);
+
+/* Notifier block to get a notify on system shutdown/halt/reboot */
+static struct notifier_block tw_notifier = {
+  tw_halt, NULL, 0
+};
 
 /* Globals */
-char *tw_driver_version="1.1.000";
+char *tw_driver_version="1.02.00.001";
 TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];
 int tw_device_extension_count = 0;
 
@@ -224,7 +246,7 @@ int tw_aen_drain_queue(TW_Device_Extension *tw_dev)
                                if (command_packet->status != 0) {
                                        if (command_packet->flags != TW_AEN_TABLE_UNDEFINED) {
                                                /* Bad response */
-                                               printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Bad response, flags = 0x%x.\n", command_packet->flags);
+                                               printk(KERN_WARNING "3w-xxxx: tw_aen_drain_queue(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
                                                return 1;
                                        } else {
                                                /* We know this is a 3w-1x00, and doesn't support aen's */
@@ -562,6 +584,7 @@ int tw_findcards(Scsi_Host_Template *tw_host)
        TW_Device_Extension *tw_dev2;
        struct pci_dev *tw_pci_dev = NULL;
        u32 status_reg_value;
+       unsigned char c = 1;
 
        dprintk(KERN_NOTICE "3w-xxxx: tw_findcards()\n");
        while ((tw_pci_dev = pci_find_device(TW_VENDOR_ID, TW_DEVICE_ID, tw_pci_dev))) {
@@ -662,7 +685,7 @@ int tw_findcards(Scsi_Host_Template *tw_host)
                        continue;
                }
 
-               error = tw_initconnection(tw_dev);
+               error = tw_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS);
                if (error) {
                        printk(KERN_WARNING "3w-xxxx: tw_findcards(): Couldn't initconnection for card %d.\n", numcards);
                        release_region((tw_dev->tw_pci_dev->resource[0].start), TW_IO_ADDRESS_RANGE);
@@ -722,10 +745,15 @@ int tw_findcards(Scsi_Host_Template *tw_host)
                /* Free the temporary device extension */
                if (tw_dev)
                        kfree(tw_dev);
+
+               /* Tell the firmware we support shutdown notification*/
+               tw_setfeature(tw_dev, 2, 1, &c);
        }
 
        if (numcards == 0) 
                printk(KERN_WARNING "3w-xxxx: tw_findcards(): No cards found.\n");
+       else
+         register_reboot_notifier(&tw_notifier);
 
        return numcards;
 } /* End tw_findcards() */
@@ -747,8 +775,22 @@ void tw_free_device_extension(TW_Device_Extension *tw_dev)
        }
 } /* End tw_free_device_extension() */
 
+/* Clean shutdown routine */
+static int tw_halt(struct notifier_block *nb, ulong event, void *buf)
+{
+       int i;
+
+       for (i=0;i<tw_device_extension_count;i++) {
+               printk(KERN_NOTICE "3w-xxxx: Notifying card #%d\n", i);
+               tw_shutdown_device(tw_device_extension_list[i]);
+       }
+       unregister_reboot_notifier(&tw_notifier);
+
+       return NOTIFY_OK;
+} /* End tw_halt() */
+
 /* This function will send an initconnection command to controller */
-int tw_initconnection(TW_Device_Extension *tw_dev) 
+int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits
 {
        u32 command_que_addr, command_que_value;
        u32 status_reg_addr, status_reg_value;
@@ -780,7 +822,7 @@ int tw_initconnection(TW_Device_Extension *tw_dev)
        command_packet->byte3.host_id = 0x0;
        command_packet->status = 0x0;
        command_packet->flags = 0x0;
-       command_packet->byte6.message_credits = TW_INIT_MESSAGE_CREDITS
+       command_packet->byte6.message_credits = message_credits
        command_packet->byte8.init_connection.response_queue_pointer = 0x0;
        command_que_value = tw_dev->command_packet_physical_address[request_id];
 
@@ -811,7 +853,7 @@ int tw_initconnection(TW_Device_Extension *tw_dev)
                        }
                        if (command_packet->status != 0) {
                                /* bad response */
-                               printk(KERN_WARNING "3w-xxxx: tw_initconnection(): Bad response, flags = 0x%x.\n", command_packet->flags);
+                               printk(KERN_WARNING "3w-xxxx: tw_initconnection(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
                                return 1;
                        }
                        break;  /* Response was okay, so we exit */
@@ -959,7 +1001,7 @@ int tw_initialize_units(TW_Device_Extension *tw_dev)
                        }
                        if (command_packet->status != 0) {
                                /* bad response */
-                               printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, flags = 0x%x.\n", command_packet->flags);
+                               printk(KERN_WARNING "3w-xxxx: tw_initialize_units(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
                                return 1;
                        }
                        found = 1;
@@ -981,9 +1023,11 @@ int tw_initialize_units(TW_Device_Extension *tw_dev)
                if (is_unit_present[i] == 0) {
                        tw_dev->is_unit_present[i] = FALSE;
                } else {
+                 if (is_unit_present[i] & TW_UNIT_ONLINE) {
                        dprintk(KERN_NOTICE "3w-xxxx: tw_initialize_units(): Unit %d found.\n", i);
                        tw_dev->is_unit_present[i] = TRUE;
                        num_units++;
+                 }
                }
        }
        tw_dev->num_units = num_units;
@@ -1089,7 +1133,7 @@ static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
                                request_id = response_que.u.response_id;
                                command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
                                if (command_packet->status != 0) {
-                                       printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Bad response, flags = 0x%x.\n", command_packet->flags);
+                                       printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
                                }
                                if (tw_dev->state[request_id] != TW_S_POSTED) {
                                        printk(KERN_WARNING "3w-xxxx: tw_interrupt(): Received a request id (%d) (opcode = 0x%x) that wasn't posted.\n", request_id, command_packet->byte0.opcode);
@@ -1186,7 +1230,7 @@ int tw_ioctl(TW_Device_Extension *tw_dev, int request_id)
        /* Initialize command packet */
        command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
        if (command_packet == NULL) {
-               printk(KERN_WARNING "3w-xxxx: twioctl(): Bad command packet virtual address.\n");
+               printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Bad command packet virtual address.\n");
                tw_dev->state[request_id] = TW_S_COMPLETED;
                tw_state_request_finish(tw_dev, request_id);
                tw_dev->srb[request_id]->result = (DID_OK << 16);
@@ -1256,6 +1300,12 @@ int tw_ioctl(TW_Device_Extension *tw_dev, int request_id)
                        tw_dev->srb[request_id]->result = (DID_OK << 16);
                        tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
                        return 0;
+               case TW_CMD_PACKET:
+                 memcpy(command_packet, ioctl->data, sizeof(TW_Command));
+                 command_packet->request_id = request_id;
+                 tw_post_command_packet(tw_dev, request_id);
+
+                 return 0;
                default:
                        printk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
                        tw_dev->state[request_id] = TW_S_COMPLETED;
@@ -1480,7 +1530,7 @@ int tw_reset_sequence(TW_Device_Extension *tw_dev)
                return 1;
        }
 
-       error = tw_initconnection(tw_dev);
+       error = tw_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS);
        if (error) {
                printk(KERN_WARNING "3w-xxxx: tw_reset_sequence(): Couldn't initconnection for card %d.\n", tw_dev->host->host_no);
                return 1;
@@ -1598,7 +1648,6 @@ int tw_scsi_eh_abort(Scsi_Cmnd *SCpnt)
 int tw_scsi_eh_reset(Scsi_Cmnd *SCpnt) 
 {
        TW_Device_Extension *tw_dev=NULL;
-       int flags = 0;
 
        dprintk(KERN_NOTICE "3w-xxxx: tw_scsi_eh_reset()\n");
 
@@ -1613,17 +1662,17 @@ int tw_scsi_eh_reset(Scsi_Cmnd *SCpnt)
                return (FAILED);
        }
 
-       spin_lock_irqsave(&tw_dev->tw_lock, flags);
+       spin_lock(&tw_dev->tw_lock);
        tw_dev->num_resets++;
 
        /* Now reset the card and some of the device extension data */
        if (tw_reset_device_extension(tw_dev)) {
                printk(KERN_WARNING "3w-xxxx: tw_scsi_eh_reset(): Reset failed for card %d.\n", tw_dev->host->host_no);
-               spin_unlock_irqrestore(&tw_dev->tw_lock, flags);
+               spin_unlock(&tw_dev->tw_lock);
                return (FAILED);
        }
        printk(KERN_WARNING "3w-xxxx: tw_scsi_eh_reset(): Reset succeeded for card %d.\n", tw_dev->host->host_no);
-       spin_unlock_irqrestore(&tw_dev->tw_lock, flags);
+       spin_unlock(&tw_dev->tw_lock);
 
        return (SUCCESS);
 } /* End tw_scsi_eh_reset() */
@@ -1803,6 +1852,11 @@ int tw_scsi_release(struct Scsi_Host *tw_host)
 
        /* Tell kernel scsi-layer we are gone */
        scsi_unregister(tw_host);
+       
+       /* Fake like we just shut down, so notify the card that
+        * we "shut down cleanly".
+        */
+       tw_halt(0, 0, 0);  // parameters aren't actually used
 
        return 0;
 } /* End tw_scsi_release() */
@@ -1901,8 +1955,10 @@ int tw_scsiop_inquiry_complete(TW_Device_Extension *tw_dev, int request_id)
                if (is_unit_present[i] == 0) {
                        tw_dev->is_unit_present[i] = FALSE;
                } else {
+                 if (is_unit_present[i] & TW_UNIT_ONLINE) {
                        tw_dev->is_unit_present[i] = TRUE;
                        dprintk(KERN_NOTICE "3w-xxxx: tw_scsiop_inquiry_complete: Unit %d found.\n", i);
+                 }
                }
        }
 
@@ -2124,6 +2180,92 @@ int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id)
        return 0;
 } /* End tw_scsiop_test_unit_ready() */
 
+/* Set a value in the features table */
+int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size,
+                  unsigned char *val)
+{
+       TW_Param *param;
+       TW_Command  *command_packet;
+       TW_Response_Queue response_queue;
+       int request_id = 0;
+       u32 command_que_value, command_que_addr;
+       u32 status_reg_addr, status_reg_value;
+       u32 response_que_addr;
+       u32 param_value;
+       int imax, i;
+
+       /* Initialize SetParam command packet */
+       if (tw_dev->command_packet_virtual_address[request_id] == NULL) {
+               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad command packet virtual address.\n");
+               return 1;
+       }
+       command_packet = (TW_Command *)tw_dev->command_packet_virtual_address[request_id];
+       memset(command_packet, 0, sizeof(TW_Sector));
+       param = (TW_Param *)tw_dev->alignment_virtual_address[request_id];
+
+       command_packet->byte0.opcode = TW_OP_SET_PARAM;
+       command_packet->byte0.sgl_offset  = 2;
+       param->table_id = 0x404;  /* Features table */
+       param->parameter_id = parm;
+       param->parameter_size_bytes = param_size;
+       memcpy(param->data, val, param_size);
+
+       param_value = tw_dev->alignment_physical_address[request_id];
+       if (param_value == 0) {
+               printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Bad alignment physical address.\n");
+               tw_dev->state[request_id] = TW_S_COMPLETED;
+               tw_state_request_finish(tw_dev, request_id);
+               tw_dev->srb[request_id]->result = (DID_OK << 16);
+               tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
+       }
+       command_packet->byte8.param.sgl[0].address = param_value;
+       command_packet->byte8.param.sgl[0].length = sizeof(TW_Sector);
+
+       command_packet->size = 4;
+       command_packet->request_id = request_id;
+       command_packet->byte6.parameter_count = 1;
+
+       command_que_value = tw_dev->command_packet_physical_address[request_id];
+       if (command_que_value == 0) {
+               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad command packet physical address.\n");
+       return 1;
+       }
+       command_que_addr = tw_dev->registers.command_que_addr;
+       status_reg_addr = tw_dev->registers.status_reg_addr;
+       response_que_addr = tw_dev->registers.response_que_addr;
+
+       /* Send command packet to the board */
+       outl(command_que_value, command_que_addr);
+
+       /* Poll for completion */
+       imax = TW_POLL_MAX_RETRIES;
+       for (i=0;i<imax;i++) {
+               mdelay(10);
+               status_reg_value = inl(status_reg_addr);
+               if (tw_check_bits(status_reg_value)) {
+                       printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Unexpected bits.\n");
+                       return 1;
+               }
+               if ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
+                       response_queue.value = inl(response_que_addr);
+                       request_id = (unsigned char)response_queue.u.response_id;
+                       if (request_id != 0) {
+                               /* unexpected request id */
+                               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Unexpected request id.\n");
+                               return 1;
+                       }
+                       if (command_packet->status != 0) {
+                               /* bad response */
+                               printk(KERN_WARNING "3w-xxxx: tw_setfeature(): Bad response, status = 0x%x, flags = 0x%x.\n", command_packet->status, command_packet->flags);
+                               return 1;
+                       }
+                       break; /* Response was okay, so we exit */
+               }
+       }
+
+  return 0;
+} /* End tw_setfeature() */
+
 /* This function will setup the interrupt handler */
 int tw_setup_irq(TW_Device_Extension *tw_dev)
 {
@@ -2140,6 +2282,29 @@ int tw_setup_irq(TW_Device_Extension *tw_dev)
        return 0;
 } /* End tw_setup_irq() */
 
+/* This function will tell the controller we're shutting down by sending
+   initconnection with a 1 */
+int tw_shutdown_device(TW_Device_Extension *tw_dev)
+{
+       int error;
+
+       /* Disable interrupts */
+       tw_disable_interrupts(tw_dev);
+
+       /* poke the board */
+       error = tw_initconnection(tw_dev, 1);
+       if (error) {
+               printk(KERN_WARNING "3w-xxxx: tw_shutdown_device(): Couldn't initconnection for card %d.\n", tw_dev->host->host_no);
+       } else {
+               printk(KERN_NOTICE "3w-xxxx shutdown succeeded\n");
+       }
+
+       /* Re-enable interrupts */
+       tw_enable_interrupts(tw_dev);
+
+       return 0;
+} /* End tw_shutdown_device() */
+
 /* This function will soft reset the controller */
 void tw_soft_reset(TW_Device_Extension *tw_dev) 
 {
index f07ad658db6823525594637503aa3c93da71cb44..68d29fae7f32828c8bb68d153bfe136be5b0cdd0 100644 (file)
@@ -2,6 +2,8 @@
    3w-xxxx.h -- 3ware Storage Controller device driver for Linux.
    
    Written By: Adam Radford <linux@3ware.com>
+   Modifications By: Joel Jacobson <linux@3ware.com>
+
    Copyright (C) 1999 3ware Inc.
 
    Kernel compatablity By:     Andre Hedrick <andre@suse.com>
 #define TW_OP_SET_PARAM              0x13
 #define TW_OP_SECTOR_INFO     0x1a
 #define TW_OP_AEN_LISTEN      0x1c
+#define TW_CMD_PACKET         0x1d
 
 /* Asynchronous Event Notification (AEN) Codes */
 #define TW_AEN_QUEUE_EMPTY       0x0000
 #define TW_BLOCK_SIZE                        0x200 /* 512-byte blocks */
 #define TW_IOCTL                              0x80
 #define TW_MAX_AEN_TRIES                      100
-
+#define TW_UNIT_ONLINE                        1
 #define TW_IN_INTR                            1
 
 /* Macros */
@@ -303,7 +306,7 @@ int tw_empty_response_que(TW_Device_Extension *tw_dev);
 void tw_enable_interrupts(TW_Device_Extension *tw_dev);
 int tw_findcards(Scsi_Host_Template *tw_host);
 void tw_free_device_extension(TW_Device_Extension *tw_dev);
-int tw_initconnection(TW_Device_Extension *tw_dev);
+int tw_initconnection(TW_Device_Extension *tw_dev, int message_credits);
 int tw_initialize_device_extension(TW_Device_Extension *tw_dev);
 int tw_initialize_units(TW_Device_Extension *tw_dev);
 int tw_ioctl(TW_Device_Extension *tw_dev, int request_id);
@@ -326,7 +329,10 @@ int tw_scsiop_read_capacity(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_read_capacity_complete(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_read_write(TW_Device_Extension *tw_dev, int request_id);
 int tw_scsiop_test_unit_ready(TW_Device_Extension *tw_dev, int request_id);
+int tw_setfeature(TW_Device_Extension *tw_dev, int parm, int param_size, 
+                 unsigned char *val);
 int tw_setup_irq(TW_Device_Extension *tw_dev);
+int tw_shutdown_device(TW_Device_Extension *tw_dev);
 void tw_soft_reset(TW_Device_Extension *tw_dev);
 int tw_state_request_finish(TW_Device_Extension *tw_dev,int request_id);
 int tw_state_request_start(TW_Device_Extension *tw_dev, int *request_id);
index a82cbd4dd06de19118f2f81fb270d3e3a5ee5fde..3494e793e137079fccbe0b6530ef78fdb19317e7 100644 (file)
@@ -1361,7 +1361,7 @@ void scsi_finish_command(Scsi_Cmnd * SCpnt)
        SCpnt->done(SCpnt);
 }
 
-#ifdef CONFIG_MODULES
+#if defined(CONFIG_MODULES) || defined(CONFIG_BLK_DEV_IDESCSI) || defined(CONFIG_USB_STORAGE)
 static int scsi_register_host(Scsi_Host_Template *);
 static void scsi_unregister_host(Scsi_Host_Template *);
 #endif
index 51229c0c0288c2c487397a68068873a5e6bb5dd6..1edbfcb446319f63e4a4574f8c11a28540f88ed5 100644 (file)
@@ -36,12 +36,12 @@ comment 'USB Devices'
    dep_tristate '  USB Serial Converter support' CONFIG_USB_SERIAL $CONFIG_USB
    if [ "$CONFIG_USB_SERIAL" != "n" ]; then
       bool '    USB Generic Serial Driver' CONFIG_USB_SERIAL_GENERIC
-      bool '    USB Handspring Visor Driver' CONFIG_USB_SERIAL_VISOR
+      dep_tristate '    USB Handspring Visor Driver' CONFIG_USB_SERIAL_VISOR $CONFIG_USB_SERIAL
       if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
-         bool '    USB ConnectTech WhiteHEAT Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_WHITEHEAT
-         bool '    USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO
-         bool '    USB Keyspan PDA Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN_PDA
-         bool '    USB Keyspan USA-xxx Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN
+         dep_tristate '    USB ConnectTech WhiteHEAT Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_WHITEHEAT $CONFIG_USB_SERIAL
+         dep_tristate '    USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO $CONFIG_USB_SERIAL
+         dep_tristate '    USB Keyspan PDA Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN_PDA $CONFIG_USB_SERIAL
+         dep_tristate '    USB Keyspan USA-xxx Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN $CONFIG_USB_SERIAL
          if [ "$CONFIG_USB_SERIAL_KEYSPAN" != "n" ]; then
             bool '      USB Keyspan USA-28 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28
             bool '      USB Keyspan USA-28X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28X
@@ -49,8 +49,8 @@ comment 'USB Devices'
             bool '      USB Keyspan USA-18X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA18X
             bool '      USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W
          fi
-         bool '    USB Digi International AccelePort USB Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_DIGI_ACCELEPORT
-         bool '    USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_OMNINET
+         dep_tristate '    USB Digi International AccelePort USB Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_DIGI_ACCELEPORT $CONFIG_USB_SERIAL
+         dep_tristate '    USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_OMNINET $CONFIG_USB_SERIAL
       fi
       bool '    USB Serial Converter verbose debug' CONFIG_USB_SERIAL_DEBUG
    fi
index df02bcf2a80769d25d88508cd0f73e7720e18137..86b208d84cc9c0dc0f1583bbb14241e61d7c50b5 100644 (file)
@@ -136,9 +136,11 @@ static const struct class_info clas_info[] =
        {USB_CLASS_COMM,                "comm."},
        {USB_CLASS_HID,                 "HID"},
        {USB_CLASS_HUB,                 "hub"},
+       {USB_CLASS_PHYSICAL,            "phys."},
        {USB_CLASS_PRINTER,             "print"},
        {USB_CLASS_MASS_STORAGE,        "stor."},
        {USB_CLASS_DATA,                "data"},
+       {USB_CLASS_APP_SPEC,            "app."},
        {USB_CLASS_VENDOR_SPEC,         "vend."},
        {-1,                            "unk."}         /* leave as last */
 };
index 28001ce2f9c9dc4ff5193a3e74599f19d43e2da2..146090ab2ba7d15a06c7e1deee556bf64ef88e01 100644 (file)
@@ -3,30 +3,41 @@
 #
 
 O_TARGET       := usb-serial.o
-M_OBJS         := usb-serial.o
-O_OBJS         := usbserial.o
+M_OBJS         :=
+O_OBJS         :=
 MOD_LIST_NAME  := USB_SERIAL_MODULES
 
-ifeq ($(CONFIG_USB_SERIAL_VISOR),y)
-       O_OBJS += visor.o
-endif
-ifeq ($(CONFIG_USB_SERIAL_WHITEHEAT),y)
-       O_OBJS += whiteheat.o
-endif
-ifeq ($(CONFIG_USB_SERIAL_FTDI_SIO),y)
-       O_OBJS += ftdi_sio.o
-endif
-ifeq ($(CONFIG_USB_SERIAL_KEYSPAN_PDA),y)
-       O_OBJS += keyspan_pda.o
-endif
-ifeq ($(CONFIG_USB_SERIAL_KEYSPAN),y)
-       O_OBJS += keyspan.o
-endif
-ifeq ($(CONFIG_USB_SERIAL_OMNINET),y)
-       O_OBJS += omninet.o
+# Object file lists.
+
+obj-y  :=
+obj-m  :=
+obj-n  :=
+obj-   :=
+
+ifeq ($(CONFIG_USB_SERIAL),y)
+       obj-y += usbserial.o
 endif
-ifeq ($(CONFIG_USB_SERIAL_DIGI_ACCELEPORT),y)
-       O_OBJS += digi_acceleport.o
+ifeq ($(CONFIG_USB_SERIAL),m)
+       obj-m += usbserial.o
 endif
+
+obj-$(CONFIG_USB_SERIAL_VISOR)                 += visor.o
+obj-$(CONFIG_USB_SERIAL_WHITEHEAT)             += whiteheat.o
+obj-$(CONFIG_USB_SERIAL_FTDI_SIO)              += ftdi_sio.o
+obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA)           += keyspan_pda.o
+obj-$(CONFIG_USB_SERIAL_KEYSPAN)               += keyspan.o
+obj-$(CONFIG_USB_SERIAL_OMNINET)               += omninet.o
+obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT)       += digi_acceleport.o
  
+# Objects that export symbols.
+export-objs    := usbserial.o
+
+# Translate to Rules.make lists.
+
+O_OBJS         := $(sort $(filter-out $(export-objs), $(obj-y)))
+OX_OBJS                := $(sort $(filter     $(export-objs), $(obj-y)))
+M_OBJS         := $(sort $(filter-out $(export-objs), $(obj-m)))
+MX_OBJS                := $(sort $(filter     $(export-objs), $(obj-m)))
+
 include $(TOPDIR)/Rules.make
+
index 4355f3773fbf63d84301501abd43e9ffeaa713a9..9ecd1370b2230be82089368581deef7c0d6d4a22 100644 (file)
 *  Peter Berger (pberger@brimson.com)
 *  Al Borchers (borchers@steinerpoint.com)
 *
+*  (7/15/2000) borchers
+*    -- Fixed race in open when a close is in progress.
+*    -- Keep count of opens and dec the module use count for each
+*       outstanding open when shutdown is called (on disconnect).
+*    -- Fixed sanity checks in read_bulk_callback and write_bulk_callback
+*       so pointers are checked before use.
+*    -- Split read bulk callback into in band and out of band
+*       callbacks, and no longer restart read chains if there is
+*       a status error or a sanity error.  This fixed the seg
+*       faults and other errors we used to get on disconnect.
+*    -- Port->active is once again a flag, not a count, as it was
+*       intended by usb-serial.  Since it was only a char it would
+*       have been limited to 256 simultaneous opens.  Now the open
+*       count is kept in the port private structure in dp_open_count.
+*    -- Added code for modularization of the digi_acceleport driver.
+*
 *  (6/27/2000) pberger and borchers
 *    -- Zeroed out sync field in the wakeup_task before first use;
 *       otherwise the uninitialized value might prevent the task from
 *  - Following Documentation/DocBook/kernel-locking.pdf no spin locks
 *    are held when calling copy_to/from_user or printk.
 *    
-*  $Id: digi_acceleport.c,v 1.63 2000/06/28 18:28:31 root Exp root $
+*  $Id: digi_acceleport.c,v 1.5 2000/07/18 04:52:43 root Exp $
 */
 
 #include <linux/config.h>
@@ -325,8 +341,9 @@ typedef struct digi_private {
        int dp_buf_len;
        unsigned char dp_buf[DIGI_PORT_BUF_LEN];
        unsigned int dp_modem_signals;
+       int dp_open_count;                      /* inc on open, dec on close */
        int dp_transmit_idle;
-       int dp_in_close;
+       int dp_in_close;                        /* close in progress */
        wait_queue_head_t dp_close_wait;        /* wait queue for close */
        struct tq_struct dp_wakeup_task;
 } digi_private_t;
@@ -361,7 +378,8 @@ static int digi_startup_device( struct usb_serial *serial );
 static int digi_startup( struct usb_serial *serial );
 static void digi_shutdown( struct usb_serial *serial );
 static void digi_read_bulk_callback( struct urb *urb );
-static void digi_read_oob_callback( struct urb *urb );
+static int digi_read_inb_callback( struct urb *urb );
+static int digi_read_oob_callback( struct urb *urb );
 
 
 /* Statics */
@@ -1135,14 +1153,21 @@ static void digi_write_bulk_callback( struct urb *urb )
 {
 
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-       struct usb_serial *serial = port->serial;
-       digi_private_t *priv = (digi_private_t *)(port->private);
+       struct usb_serial *serial;
+       digi_private_t *priv;
        int ret = 0;
 
 
-dbg( "digi_write_bulk_callback: TOP: port=%d", priv->dp_port_num );
+dbg( "digi_write_bulk_callback: TOP" );
+
+       /* port sanity check */
+       if( port == NULL || (priv=(digi_private_t *)(port->private)) == NULL ) {
+               err( __FUNCTION__ ": port or port->private is NULL, status=%d",
+                       urb->status );
+               return;
+       }
 
-       /* handle callback on out-of-band port */
+       /* handle oob callback */
        if( priv->dp_port_num == oob_port_num ) {
                dbg( "digi_write_bulk_callback: oob callback" );
                spin_lock( &priv->dp_port_lock );
@@ -1152,10 +1177,11 @@ dbg( "digi_write_bulk_callback: TOP: port=%d", priv->dp_port_num );
        }
 
        /* sanity checks */
-       if( port_paranoia_check( port, "digi_write_bulk_callback" )
-       || serial_paranoia_check( serial, "digi_write_bulk_callback" ) ) {
+       if( port_paranoia_check( port, "digi_write_bulk_callback" ) )
+               return;
+       serial = port->serial;
+       if( serial_paranoia_check( serial, "digi_write_bulk_callback" ) )
                return;
-       }
 
        /* try to send any buffered data on this port */
        spin_lock( &priv->dp_port_lock );
@@ -1187,8 +1213,8 @@ dbg( "digi_write_bulk_callback: TOP: port=%d", priv->dp_port_num );
        spin_unlock( &priv->dp_port_lock );
 
        if( ret ) {
-               dbg( "digi_write_bulk_callback: usb_submit_urb failed, ret=%d",
-               ret );
+               err( __FUNCTION__ ": usb_submit_urb failed, ret=%d, port=%d",
+                       ret, priv->dp_port_num );
        }
 
 }
@@ -1245,21 +1271,13 @@ static int digi_open( struct usb_serial_port *port, struct file *filp )
        unsigned long flags = 0;
 
 
-dbg( "digi_open: TOP: port %d, active:%d", priv->dp_port_num, port->active );
+dbg( "digi_open: TOP: port=%d, active=%d, open_count=%d", priv->dp_port_num, port->active, priv->dp_open_count );
 
        /* be sure the device is started up */
        if( digi_startup_device( port->serial ) != 0 )
                return( -ENXIO );
 
-       /* if port is already open, just return */
-       /* be sure exactly one open proceeds */
        spin_lock_irqsave( &priv->dp_port_lock, flags );
-       if( port->active >= 1 && !priv->dp_in_close ) {
-               ++port->active;
-               spin_unlock_irqrestore( &priv->dp_port_lock, flags );
-               MOD_INC_USE_COUNT;
-               return( 0 );
-       }
 
        /* don't wait on a close in progress for non-blocking opens */
        if( priv->dp_in_close && (filp->f_flags&(O_NDELAY|O_NONBLOCK)) == 0 ) {
@@ -1267,23 +1285,31 @@ dbg( "digi_open: TOP: port %d, active:%d", priv->dp_port_num, port->active );
                return( -EAGAIN );
        }
 
-       /* prevent other opens from proceeding, before giving up lock */
-       ++port->active;
-
-       /* wait for close to finish */
+       /* wait for a close in progress to finish */
        while( priv->dp_in_close ) {
                cond_wait_interruptible_timeout_irqrestore(
                        &priv->dp_close_wait, DIGI_RETRY_TIMEOUT,
                        &priv->dp_port_lock, flags );
                if( signal_pending(current) ) {
-                       --port->active;
                        return( -EINTR );
                }
                spin_lock_irqsave( &priv->dp_port_lock, flags );
        }
 
-       spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+       /* if port is already open, just return */
+       /* be sure exactly one open proceeds */
+       if( port->active ) {
+               ++priv->dp_open_count;
+               MOD_INC_USE_COUNT;
+               spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+               return( 0 );
+       }
+
+       /* open is certain */
+       port->active = 1;
+       ++priv->dp_open_count;
        MOD_INC_USE_COUNT;
+       spin_unlock_irqrestore( &priv->dp_port_lock, flags );
  
        /* read modem signals automatically whenever they change */
        buf[0] = DIGI_CMD_READ_INPUT_SIGNALS;
@@ -1323,17 +1349,17 @@ static void digi_close( struct usb_serial_port *port, struct file *filp )
        unsigned long flags = 0;
 
 
-dbg( "digi_close: TOP: port %d, active:%d", priv->dp_port_num, port->active );
+dbg( "digi_close: TOP: port=%d, active=%d, open_count=%d", priv->dp_port_num, port->active, priv->dp_open_count );
 
 
        /* do cleanup only after final close on this port */
        spin_lock_irqsave( &priv->dp_port_lock, flags );
-       if( port->active > 1 ) {
-               --port->active;
-               spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+       if( priv->dp_open_count > 1 ) {
+               --priv->dp_open_count;
                MOD_DEC_USE_COUNT;
+               spin_unlock_irqrestore( &priv->dp_port_lock, flags );
                return;
-       } else if( port->active <= 0 ) {
+       } else if( priv->dp_open_count <= 0 ) {
                spin_unlock_irqrestore( &priv->dp_port_lock, flags );
                return;
        }
@@ -1410,13 +1436,13 @@ dbg( "digi_close: TOP: port %d, active:%d", priv->dp_port_num, port->active );
        tty->closing = 0;
 
        spin_lock_irqsave( &priv->dp_port_lock, flags );
-       --port->active;
+       port->active = 0;
        priv->dp_in_close = 0;
+       --priv->dp_open_count;
+       MOD_DEC_USE_COUNT;
        wake_up_interruptible( &priv->dp_close_wait );
        spin_unlock_irqrestore( &priv->dp_port_lock, flags );
 
-       MOD_DEC_USE_COUNT;
-
 dbg( "digi_close: done" );
 }
 
@@ -1489,6 +1515,7 @@ dbg( "digi_startup: TOP" );
                priv->dp_port_num = i;
                priv->dp_buf_len = 0;
                priv->dp_modem_signals = 0;
+               priv->dp_open_count = 0;
                priv->dp_transmit_idle = 0;
                priv->dp_in_close = 0;
                init_waitqueue_head( &priv->dp_close_wait );
@@ -1517,18 +1544,31 @@ static void digi_shutdown( struct usb_serial *serial )
 {
 
        int i;
+       digi_private_t *priv;
+       unsigned long flags;
 
 
-dbg( "digi_shutdown: TOP" );
+dbg( "digi_shutdown: TOP, in_interrupt()=%d", in_interrupt() );
 
        /* stop reads and writes on all ports */
        for( i=0; i<digi_acceleport_device.num_ports+1; i++ ) {
-               usb_unlink_urb (serial->port[i].read_urb);
-               usb_unlink_urb (serial->port[i].write_urb);
+               usb_unlink_urb( serial->port[i].read_urb );
+               usb_unlink_urb( serial->port[i].write_urb );
        }
 
        device_startup = 0;
 
+       /* dec module use count */
+       for( i=0; i<digi_acceleport_device.num_ports; i++ ) {
+               priv = serial->port[i].private;
+               spin_lock_irqsave( &priv->dp_port_lock, flags );
+               while( priv->dp_open_count > 0 ) {
+                       MOD_DEC_USE_COUNT;
+                       --priv->dp_open_count;
+               }
+               spin_unlock_irqrestore( &priv->dp_port_lock, flags );
+       }
+
        /* free the private data structures for all ports */
        /* number of regular ports + 1 for the out-of-band port */
        for( i=0; i<digi_acceleport_device.num_ports+1; i++ )
@@ -1541,40 +1581,76 @@ static void digi_read_bulk_callback( struct urb *urb )
 {
 
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
-       struct usb_serial *serial = port->serial;
-       struct tty_struct *tty = port->tty;
-       digi_private_t *priv = (digi_private_t *)(port->private);
-       int opcode = ((unsigned char *)urb->transfer_buffer)[0];
-       int len = ((unsigned char *)urb->transfer_buffer)[1];
-       int status = ((unsigned char *)urb->transfer_buffer)[2];
-       unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
-       int ret,i;
+       digi_private_t *priv;
+       int ret;
 
 
-dbg( "digi_read_bulk_callback: TOP: port=%d", priv->dp_port_num );
+dbg( "digi_read_bulk_callback: TOP" );
 
-       /* handle oob callback */
-       if( priv->dp_port_num == oob_port_num ) {
-               digi_read_oob_callback( urb );
+       /* port sanity check, do not resubmit if port is not valid */
+       if( port == NULL || (priv=(digi_private_t *)(port->private)) == NULL ) {
+               err( __FUNCTION__ ": port or port->private is NULL, status=%d",
+                       urb->status );
                return;
        }
 
-       /* sanity checks */
-       if( port_paranoia_check( port, "digi_read_bulk_callback" )
-       || serial_paranoia_check( serial, "digi_read_bulk_callback" ) ) {
-               goto resubmit;
+       /* do not resubmit urb if it has any status error */
+       if( urb->status ) {
+               err( __FUNCTION__ ": nonzero read bulk status: status=%d, port=%d", urb->status, priv->dp_port_num );
+               return;
        }
 
-       if( urb->status ) {
-               dbg( "digi_read_bulk_callback: nonzero read bulk status: %d",
-                       urb->status );
-               if( urb->status == -ENOENT )
+       /* handle oob or inb callback, do not resubmit if error */
+       if( priv->dp_port_num == oob_port_num ) {
+               if( digi_read_oob_callback( urb ) != 0 )
                        return;
-               goto resubmit;
+       } else {
+               if( digi_read_inb_callback( urb ) != 0 )
+                       return;
+       }
+
+       /* continue read */
+       if( (ret=usb_submit_urb(urb)) != 0 ) {
+               err( __FUNCTION__ ": failed resubmitting urb, ret=%d, port=%d",
+                       ret, priv->dp_port_num );
        }
 
-       if( urb->actual_length != len + 2 )
-               err( KERN_INFO "digi_read_bulk_callback: INCOMPLETE PACKET, port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", priv->dp_port_num, opcode, len, urb->actual_length, status );
+}
+
+
+/* 
+*  Digi Read INB Callback
+*
+*  Digi Read INB Callback handles reads on the in band ports, sending
+*  the data on to the tty subsystem.  When called we know port and
+*  port->private are not NULL.  It returns 0 if successful, and -1 if
+*  the sanity checks failed.
+*/
+
+static int digi_read_inb_callback( struct urb *urb )
+{
+
+       struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
+       struct usb_serial *serial = port->serial;
+       struct tty_struct *tty = port->tty;
+       digi_private_t *priv = (digi_private_t *)(port->private);
+       int opcode = ((unsigned char *)urb->transfer_buffer)[0];
+       int len = ((unsigned char *)urb->transfer_buffer)[1];
+       int status = ((unsigned char *)urb->transfer_buffer)[2];
+       unsigned char *data = ((unsigned char *)urb->transfer_buffer)+3;
+       int i;
+
+
+       /* sanity checks */
+       if( port_paranoia_check( port, __FUNCTION__ )
+       || serial_paranoia_check( serial, __FUNCTION__ ) )
+               return( -1 );
+
+       /* short packet check */
+       if( urb->actual_length != len + 2 ) {
+               err( __FUNCTION__ ": INCOMPLETE PACKET, urb->status=%d, port=%d, opcode=%d, len=%d, actual_length=%d, status=%d", urb->status, priv->dp_port_num, opcode, len, urb->actual_length, status );
+               return( -1 );
+       }
 
        /* receive data */
        if( opcode == DIGI_CMD_RECEIVE_DATA && urb->actual_length > 3 ) {
@@ -1585,36 +1661,39 @@ dbg( "digi_read_bulk_callback: TOP: port=%d", priv->dp_port_num );
                tty_flip_buffer_push(tty);
        }
 
-       /* continue read */
-resubmit:
-       if( (ret=usb_submit_urb(urb)) != 0 ) {
-               dbg( "digi_read_bulk_callback: failed resubmitting urb, ret=%d",
-                       ret );
-       }
+       return( 0 );
 
 }
 
 
-static void digi_read_oob_callback( struct urb *urb )
+/* 
+*  Digi Read OOB Callback
+*
+*  Digi Read OOB Callback handles reads on the out of band port.
+*  When called we know port and port->private are not NULL.  It
+*  returns 0 if successful, and -1 if the sanity checks failed.
+*/
+
+static int digi_read_oob_callback( struct urb *urb )
 {
 
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        struct usb_serial *serial = port->serial;
-       digi_private_t *priv;
+       digi_private_t *priv = (digi_private_t *)(port->private);
        int opcode, line, status, val;
-       int i,ret;
+       int i;
 
 
 dbg( "digi_read_oob_callback: len=%d", urb->actual_length );
 
-       if( urb->status ) {
-               dbg( "digi_read_oob_callback: nonzero read bulk status on oob: %d",
-                       urb->status );
-               if( urb->status == -ENOENT )
-                       return;
-               goto resubmit;
+       /* sanity check */
+       if( serial == NULL ) {
+               err( __FUNCTION__ ": port->serial is NULL, status=%d, port=%d",
+                       urb->status, priv->dp_port_num );
+               return( -1 );
        }
 
+       /* handle each oob command */
        for( i=0; i<urb->actual_length-3; ) {
 
                opcode = ((unsigned char *)urb->transfer_buffer)[i++];
@@ -1627,7 +1706,10 @@ dbg( "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d", opcode, li
                if( status != 0 )
                        continue;
 
-               priv = serial->port[line].private;
+               if( (priv=serial->port[line].private) == NULL ) {
+                       dbg( __FUNCTION__ ": port[%d].private is NULL!", line );
+                       continue;
+               }
 
                if( opcode == DIGI_CMD_READ_INPUT_SIGNALS ) {
 
@@ -1665,11 +1747,25 @@ dbg( "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d", opcode, li
 
        }
 
+       return( 0 );
+
+}
+
+
+int digi_init (void)
+{
+       usb_serial_register (&digi_acceleport_device);
+       return 0;
+}
 
-resubmit:
-       if( (ret=usb_submit_urb(urb)) != 0 ) {
-               dbg( "digi_read_oob_callback: failed resubmitting oob urb, ret=%d",
-               ret );
-       }
 
+void digi_exit (void)
+{
+       usb_serial_deregister (&digi_acceleport_device);
 }
+
+
+module_init(digi_init);
+module_exit(digi_exit);
+
+
index 8aec735697bc7e93461471c5ebb732ef79a98490..f78ff752b9a06ac3c98f9e3539efa51ccf3fe30a 100644 (file)
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
+ * (07/19/2000) gkh
+ *     Added module_init and module_exit functions to handle the fact that this
+ *     driver is a loadable module now.
+ *
  * (04/04/2000) Bill Ryder 
  *         Fixed bugs in TCGET/TCSET ioctls (by removing them - they are 
  *             handled elsewhere in the serial driver chain).
@@ -720,3 +724,20 @@ static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, uns
        return 0;
 } /* ftdi_sio_ioctl */
 
+
+int ftdi_sio_init (void)
+{
+       usb_serial_register (&ftdi_sio_device);
+       return 0;
+}
+
+
+void ftdi_sio_exit (void)
+{
+       usb_serial_deregister (&ftdi_sio_device);
+}
+
+
+module_init(ftdi_sio_init);
+module_exit(ftdi_sio_exit);
+
index 397e2bf4813ed442775ca237e355cbb8bc2eebc3..2fecdca12591c8015dd73f8b848eb981fb95dabf 100644 (file)
   Tip 'o the hat to Linuxcare for supporting staff in their work on
   open source projects.
 
+  Wed Jul 19 14:00:42 EST 2000 gkh
+       Added module_init and module_exit functions to handle the fact that this
+       driver is a loadable module now.
+
   Tue Jul 18 16:14:52 EST 2000 Hugh
     Basic character input/output for USA-19 now mostly works,
     fixed at 9600 baud for the moment.
@@ -30,9 +34,6 @@
 
 
 #include <linux/config.h>
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN
-
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
@@ -685,5 +686,38 @@ static void keyspan_shutdown (struct usb_serial *serial)
        
 }
 
-#endif /* CONFIG_USB_SERIAL_KEYSPAN */
+
+int keyspan_init (void)
+{
+       usb_serial_register (&keyspan_usa18x_pre_device);
+       usb_serial_register (&keyspan_usa19_pre_device);
+       usb_serial_register (&keyspan_usa19w_pre_device);
+       usb_serial_register (&keyspan_usa28_pre_device);
+       usb_serial_register (&keyspan_usa28x_pre_device);
+       usb_serial_register (&keyspan_usa18x_device);
+       usb_serial_register (&keyspan_usa19_device);
+       usb_serial_register (&keyspan_usa19w_device);
+       usb_serial_register (&keyspan_usa28_device);
+       usb_serial_register (&keyspan_usa28x_device);
+       return 0;
+}
+
+
+void keyspan_exit (void)
+{
+       usb_serial_deregister (&keyspan_usa18x_pre_device);
+       usb_serial_deregister (&keyspan_usa19_pre_device);
+       usb_serial_deregister (&keyspan_usa19w_pre_device);
+       usb_serial_deregister (&keyspan_usa28_pre_device);
+       usb_serial_deregister (&keyspan_usa28x_pre_device);
+       usb_serial_deregister (&keyspan_usa18x_device);
+       usb_serial_deregister (&keyspan_usa19_device);
+       usb_serial_deregister (&keyspan_usa19w_device);
+       usb_serial_deregister (&keyspan_usa28_device);
+       usb_serial_deregister (&keyspan_usa28x_device);
+}
+
+
+module_init(keyspan_init);
+module_exit(keyspan_exit);
 
index ce966dc4f31a1be5f4a9c89d833ec4f8976cf77f..6669461810f42d09156d8db1f09aba42c643843c 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef __LINUX_USB_SERIAL_KEYSPAN_H
 #define __LINUX_USB_SERIAL_KEYSPAN_H
 
+#include <linux/config.h>
 
        /* Function prototypes for Keyspan serial converter */
 static int  keyspan_open               (struct usb_serial_port *port,
index c18137ffa39a798a37d65998ee1ae0ea8f6441c8..aca2a38c533cb1c61a8d67376f806467fae6d682 100644 (file)
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (07/19/2000) gkh
+ *     Added module_init and module_exit functions to handle the fact that this
+ *     driver is a loadable module now.
+ *
  * (03/26/2000) gkh
  *     Split driver up into device specific pieces.
  * 
@@ -697,3 +701,22 @@ struct usb_serial_device_type keyspan_pda_device = {
        shutdown:               keyspan_pda_shutdown,
 };
 
+
+int keyspan_pda_init (void)
+{
+       usb_serial_register (&keyspan_pda_fake_device);
+       usb_serial_register (&keyspan_pda_device);
+       return 0;
+}
+
+
+void keyspan_pda_exit (void)
+{
+       usb_serial_deregister (&keyspan_pda_fake_device);
+       usb_serial_deregister (&keyspan_pda_device);
+}
+
+
+module_init(keyspan_pda_init);
+module_exit(keyspan_pda_exit);
+
index 2e5e50849f14709b9f40de320e48f093cdd016d5..7a68a0072962c401e483f1c3a82bc34acece7556 100644 (file)
  *
  * Please report both successes and troubles to the author at omninet@kroah.com
  *
+ * (07/19/2000) gkh
+ *     Added module_init and module_exit functions to handle the fact that this
+ *     driver is a loadable module now.
+ *
  */
 
 #include <linux/config.h>
@@ -333,3 +337,20 @@ static void omninet_write_bulk_callback (struct urb *urb)
        return;
 }
 
+
+int omninet_init (void)
+{
+       usb_serial_register (&zyxel_omninet_device);
+       return 0;
+}
+
+
+void omninet_exit (void)
+{
+       usb_serial_deregister (&zyxel_omninet_device);
+}
+
+
+module_init(omninet_init);
+module_exit(omninet_exit);
+
index d51fe02a2531b641e10d12b4d60c2f5dbcf199c8..b0a0f2459fc1e0ba02eb1aa84efa3059a3f7c524 100644 (file)
  *     (at your option) any later version.
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
+ *
+ * (07/19/2000) gkh, pberger, and borchers
+ *     Modifications to allow usb-serial drivers to be modules.
+ *
  * 
  */
 
@@ -35,7 +39,6 @@ struct usb_serial_port {
        int                     magic;
        struct usb_serial       *serial;        /* pointer back to the owner of this port */
        struct tty_struct *     tty;            /* the coresponding tty for this port */
-       unsigned char           minor;
        unsigned char           number;
        char                    active;         /* someone has this device open */
 
@@ -60,6 +63,7 @@ struct usb_serial {
        int                             magic;
        struct usb_device *             dev;
        struct usb_serial_device_type * type;                   /* the type of usb serial device this is */
+       struct usb_interface *          interface;              /* the interface for this device */
        struct tty_driver *             tty_driver;             /* the tty_driver for this device */
        unsigned char                   minor;                  /* the starting minor number for this device */
        unsigned char                   num_ports;              /* the number of ports this device has */
@@ -95,6 +99,8 @@ struct usb_serial_device_type {
        char    num_bulk_out;
        char    num_ports;              /* number of serial ports this device has */
 
+       struct list_head        driver_list;
+       
        /* function call to make before accepting driver */
        int (*startup) (struct usb_serial *serial);     /* return 0 to continue initialization, anything else to abort */
        void (*shutdown) (struct usb_serial *serial);
@@ -116,30 +122,11 @@ struct usb_serial_device_type {
        void (*write_bulk_callback)(struct urb *urb);
 };
 
-
-
-extern struct usb_serial_device_type handspring_device;
-extern struct usb_serial_device_type whiteheat_fake_device;
-extern struct usb_serial_device_type whiteheat_device;
-extern struct usb_serial_device_type ftdi_sio_device;
-extern struct usb_serial_device_type keyspan_pda_fake_device;
-extern struct usb_serial_device_type keyspan_pda_device;
-extern struct usb_serial_device_type keyspan_usa18x_pre_device;
-extern struct usb_serial_device_type keyspan_usa19_pre_device;
-extern struct usb_serial_device_type keyspan_usa19w_pre_device;
-extern struct usb_serial_device_type keyspan_usa28_pre_device;
-extern struct usb_serial_device_type keyspan_usa28x_pre_device;
-extern struct usb_serial_device_type keyspan_usa18x_device;
-extern struct usb_serial_device_type keyspan_usa19_device;
-extern struct usb_serial_device_type keyspan_usa19w_device;
-extern struct usb_serial_device_type keyspan_usa28_device;
-extern struct usb_serial_device_type keyspan_usa28x_device;
-extern struct usb_serial_device_type zyxel_omninet_device;
-extern struct usb_serial_device_type digi_acceleport_device;
-
+extern int  usb_serial_register(struct usb_serial_device_type *new_device);
+extern void usb_serial_deregister(struct usb_serial_device_type *device);
 
 /* determine if we should include the EzUSB loader functions */
-#if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_WHITEHEAT) || defined(CONFIG_USB_SERIAL_KEYSPAN)
+#if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_WHITEHEAT) || defined(CONFIG_USB_SERIAL_KEYSPAN) || defined(CONFIG_USB_SERIAL_KEYSPAN_PDA_MODULE) || defined(CONFIG_USB_SERIAL_WHITEHEAT_MODULE) || defined(CONFIG_USB_SERIAL_KEYSPAN_MODULE)
        #define USES_EZUSB_FUNCTIONS
        extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
        extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);
index a02c344564ea4a84c5dd97aa888731baa6732ade..50b85c4f2f172718388d3c118d2a173cd49973d5 100644 (file)
@@ -14,6 +14,9 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (07/19/2000) gkh, pberger, and borchers
+ *     Modifications to allow usb-serial drivers to be modules.
+ *
  * (07/03/2000) gkh
  *     Added more debugging to serial_ioctl call
  * 
@@ -284,49 +287,6 @@ static struct usb_serial_device_type generic_device = {
 #endif
 
 
-/* To add support for another serial converter, create a usb_serial_device_type
-   structure for that device, and add it to this list, making sure that the
-   last  entry is NULL. */
-static struct usb_serial_device_type *usb_serial_devices[] = {
-#ifdef CONFIG_USB_SERIAL_GENERIC
-       &generic_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_WHITEHEAT
-       &whiteheat_fake_device,
-       &whiteheat_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_VISOR
-       &handspring_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_FTDI_SIO
-       &ftdi_sio_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_PDA
-       &keyspan_pda_fake_device,
-       &keyspan_pda_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_OMNINET
-       &zyxel_omninet_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_DIGI_ACCELEPORT
-       &digi_acceleport_device,
-#endif
-#ifdef CONFIG_USB_SERIAL_KEYSPAN
-       &keyspan_usa18x_pre_device,
-       &keyspan_usa19_pre_device,
-       &keyspan_usa19w_pre_device,
-       &keyspan_usa28_pre_device,
-       &keyspan_usa28x_pre_device,
-       &keyspan_usa18x_device,
-       &keyspan_usa19_device,
-       &keyspan_usa19w_device,
-       &keyspan_usa28_device,
-       &keyspan_usa28x_device,
-#endif
-       NULL
-};
-
-
 /* local function prototypes */
 static int  serial_open (struct tty_struct *tty, struct file * filp);
 static void serial_close (struct tty_struct *tty, struct file * filp);
@@ -354,6 +314,8 @@ static struct termios *             serial_termios[SERIAL_TTY_MINORS];
 static struct termios *                serial_termios_locked[SERIAL_TTY_MINORS];
 static struct usb_serial       *serial_table[SERIAL_TTY_MINORS] = {NULL, };
 
+LIST_HEAD(usb_serial_driver_list);
+
 
 static inline struct usb_serial* get_usb_serial (struct usb_serial_port *port, const char *function) 
 { 
@@ -950,13 +912,15 @@ static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum)
 {
        struct usb_serial *serial = NULL;
        struct usb_serial_port *port;
-       struct usb_interface_descriptor *interface;
+       struct usb_interface *interface;
+       struct usb_interface_descriptor *iface_desc;
        struct usb_endpoint_descriptor *endpoint;
        struct usb_endpoint_descriptor *interrupt_in_endpoint[MAX_NUM_PORTS];
        struct usb_endpoint_descriptor *bulk_in_endpoint[MAX_NUM_PORTS];
        struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS];
-       struct usb_serial_device_type *type;
-       int device_num;
+       struct usb_serial_device_type *type = NULL;
+       struct list_head *tmp;
+       int found;
        int minor;
        int buffer_size;
        int i;
@@ -968,34 +932,38 @@ static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum)
        int num_bulk_out = 0;
        int num_ports;
        int max_endpoints;
+
        
        /* loop through our list of known serial converters, and see if this
-           device matches. */
-       for (device_num = 0; usb_serial_devices[device_num]; device_num++) {
-               type = usb_serial_devices[device_num];
+          device matches. */
+       found = 0;
+       list_for_each (tmp, &usb_serial_driver_list) {
+               type = list_entry(tmp, struct usb_serial_device_type, driver_list);
                dbg ("Looking at %s Vendor id=%.4x Product id=%.4x", 
-                    type->name, *(type->idVendor), *(type->idProduct));
+                       type->name, *(type->idVendor), *(type->idProduct));
 
                /* look at the device descriptor */
                if ((dev->descriptor.idVendor == *(type->idVendor)) &&
                    (dev->descriptor.idProduct == *(type->idProduct))) {
                        dbg("descriptor matches");
+                       found = 1;
                        break;
                }
        }
-       if (!usb_serial_devices[device_num]) {
+       if (!found) {
                /* no match */
                dbg("none matched");
                return(NULL);
        }
-
+       
        /* descriptor matches, let's find the endpoints needed */
        interrupt_pipe = bulk_in_pipe = bulk_out_pipe = HAS_NOT;
                        
        /* check out the endpoints */
-       interface = &dev->actconfig->interface[ifnum].altsetting[0];
-       for (i = 0; i < interface->bNumEndpoints; ++i) {
-               endpoint = &interface->endpoint[i];
+       interface = &dev->actconfig->interface[ifnum];
+       iface_desc = &interface->altsetting[0];
+       for (i = 0; i < iface_desc->bNumEndpoints; ++i) {
+               endpoint = &iface_desc->endpoint[i];
                
                if ((endpoint->bEndpointAddress & 0x80) &&
                    ((endpoint->bmAttributes & 3) == 0x02)) {
@@ -1059,6 +1027,7 @@ static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum)
        
        serial->dev = dev;
        serial->type = type;
+       serial->interface = interface;
        serial->minor = minor;
        serial->num_ports = num_ports;
        serial->num_bulk_in = num_bulk_in;
@@ -1205,6 +1174,12 @@ static void usb_serial_disconnect(struct usb_device *dev, void *ptr)
        int i;
 
        if (serial) {
+               /* fail all future close/read/write/ioctl/etc calls */
+               for (i = 0; i < serial->num_ports; ++i) {
+                       if (serial->port[i].tty != NULL)
+                               serial->port[i].tty->driver_data = NULL;
+               }
+
                if (serial->type->shutdown)
                        serial->type->shutdown(serial);
 
@@ -1290,7 +1265,6 @@ static struct tty_driver serial_tty_driver = {
 int usb_serial_init(void)
 {
        int i;
-       int something;
        int result;
 
        /* Initalize our global data */
@@ -1298,17 +1272,6 @@ int usb_serial_init(void)
                serial_table[i] = NULL;
        }
 
-       /* tell the world what devices this driver currently supports */
-       something = 0;
-       for (i = 0; usb_serial_devices[i]; ++i) {
-               if (!strstr (usb_serial_devices[i]->name, "prerenumeration")) {
-                       info ("USB Serial support registered for %s", usb_serial_devices[i]->name);
-                       something = 1;
-               }
-       }
-       if (!something)
-               info ("USB Serial driver is not configured for any devices!");
-
        /* register the tty driver */
        serial_tty_driver.init_termios          = tty_std_termios;
        serial_tty_driver.init_termios.c_cflag  = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
@@ -1317,6 +1280,11 @@ int usb_serial_init(void)
                return -1;
        }
 
+#ifdef CONFIG_USB_SERIAL_GENERIC
+       /* register our generic driver with ourselves */
+       usb_serial_register (&generic_device);
+#endif
+       
        /* register the USB driver */
        result = usb_register(&usb_serial_driver);
        if (result < 0) {
@@ -1325,12 +1293,19 @@ int usb_serial_init(void)
                return -1;
        }
        
+       
        return 0;
 }
 
 
 void usb_serial_exit(void)
 {
+
+#ifdef CONFIG_USB_SERIAL_GENERIC
+       /* remove our generic driver */
+       usb_serial_deregister (&generic_device);
+#endif
+       
        usb_deregister(&usb_serial_driver);
        tty_unregister_driver(&serial_tty_driver);
 }
@@ -1340,3 +1315,46 @@ module_init(usb_serial_init);
 module_exit(usb_serial_exit);
 
 
+int usb_serial_register(struct usb_serial_device_type *new_device)
+{
+       /* Add this device to our list of devices */
+       list_add(&new_device->driver_list, &usb_serial_driver_list);
+
+       info ("USB Serial support registered for %s", new_device->name);
+
+       usb_scan_devices();
+
+       return 0;
+}
+
+
+void usb_serial_deregister(struct usb_serial_device_type *device)
+{
+       struct usb_serial *serial;
+       int i;
+
+       info("USB Serial deregistering driver %s", device->name);
+
+       /* clear out the serial_table if the device is attached to a port */
+       for(i = 0; i < SERIAL_TTY_MINORS; ++i) {
+               serial = serial_table[i];
+               if ((serial != NULL) && (serial->type == device)) {
+                       usb_driver_release_interface (&usb_serial_driver, serial->interface);
+                       usb_serial_disconnect (NULL, serial);
+               }
+       }
+
+       list_del(&device->driver_list);
+}
+
+
+
+/* If the usb-serial core is build into the core, the usb-serial drivers
+   need these symbols to load properly as modules. */
+EXPORT_SYMBOL(usb_serial_register);
+EXPORT_SYMBOL(usb_serial_deregister);
+#ifdef USES_EZUSB_FUNCTIONS
+       EXPORT_SYMBOL(ezusb_writememory);
+       EXPORT_SYMBOL(ezusb_set_reset);
+#endif
+
index a455e8dc8035ea8d07fa79be757b4c088d9baef0..f2502fbf6134ac71e3a626666632a0c778dfe2f1 100644 (file)
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (07/19/2000) gkh
+ *     Added module_init and module_exit functions to handle the fact that this
+ *     driver is a loadable module now.
+ *
  * (07/03/2000) gkh
  *     Added visor_set_ioctl and visor_set_termios functions (they don't do much
  *     of anything, but are good for debugging.)
@@ -293,4 +297,19 @@ static void visor_set_termios (struct usb_serial_port *port, struct termios *old
 }
 
 
+int visor_init (void)
+{
+       usb_serial_register (&handspring_device);
+       return 0;
+}
+
+
+void visor_exit (void)
+{
+       usb_serial_deregister (&handspring_device);
+}
+
+
+module_init(visor_init);
+module_exit(visor_exit);
 
index 91afddd56f220d3b8af716f1af7db9f8ca0a8b88..a6ca6ebcbf2715009fc43d7a112ad6994a1d0f64 100644 (file)
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (07/19/2000) gkh
+ *     Added module_init and module_exit functions to handle the fact that this
+ *     driver is a loadable module now.
+ *     Fixed bug with port->minor that was found by Al Borchers
+ *
  * (07/04/2000) gkh
  *     Added support for port settings. Baud rate can now be changed. Line signals
  *     are not transferred to and from the tty layer yet, but things seem to be 
@@ -258,7 +263,7 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
                dbg(__FUNCTION__ " - usb_submit_urb(read bulk) failed");
 
        /* send an open port command */
-       open_command.port = port->number - port->minor;
+       open_command.port = port->number - port->serial->minor;
        whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command));
 
        /* Need to do device specific setup here (control lines, baud rate, etc.) */
@@ -277,7 +282,7 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
        dbg(__FUNCTION__ " - port %d", port->number);
        
        /* send a close command to the port */
-       close_command.port = port->number - port->minor;
+       close_command.port = port->number - port->serial->minor;
        whiteheat_send_cmd (port->serial, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command));
 
        /* Need to change the control lines here */
@@ -501,7 +506,7 @@ static void set_command (struct usb_serial_port *port, unsigned char state, unsi
        struct whiteheat_rdb_set rdb_command;
        
        /* send a set rts command to the port */
-       rdb_command.port = port->number - port->minor;
+       rdb_command.port = port->number - port->serial->minor;
        rdb_command.state = state;
 
        whiteheat_send_cmd (port->serial, command, (__u8 *)&rdb_command, sizeof(rdb_command));
@@ -525,3 +530,22 @@ static inline void set_break (struct usb_serial_port *port, unsigned char brk)
        set_command (port, brk, WHITEHEAT_SET_BREAK);
 }
 
+
+int whiteheat_init (void)
+{
+       usb_serial_register (&whiteheat_fake_device);
+       usb_serial_register (&whiteheat_device);
+       return 0;
+}
+
+
+void whiteheat_exit (void)
+{
+       usb_serial_deregister (&whiteheat_fake_device);
+       usb_serial_deregister (&whiteheat_device);
+}
+
+
+module_init(whiteheat_init);
+module_exit(whiteheat_exit);
+
index c3dd30dee52a26d1f62a60c508cac3c5478e40dc..7ede92c88c640611f74f81c99fb3548b1b0c7624 100644 (file)
@@ -4,7 +4,7 @@
 
 O_TARGET       := usb-storage.o
 M_OBJS         := usb-storage.o
-O_OBJS         := scsiglue.o protocol.o transport.o debug.o usb.o
+O_OBJS         := scsiglue.o protocol.o transport.o debug.o usb.o 
 MOD_LIST_NAME  := USB_STORAGE_MODULES
 
 CFLAGS_scsiglue.o:= -I../../scsi/
@@ -12,11 +12,16 @@ CFLAGS_protocol.o:= -I../../scsi/
 CFLAGS_transport.o:= -I../../scsi/
 CFLAGS_debug.o:= -I../../scsi/
 CFLAGS_usb.o:= -I../../scsi/
+CFLAGS_scm.o:= -I../../scsi/
 
 ifeq ($(CONFIG_USB_STORAGE_DEBUG),y)
        O_OBJS += debug.o
 endif
 
+ifeq ($(CONFIG_USB_STORAGE_HP8200e),y)
+       O_OBJS += scm.o
+endif
+
 ifeq ($(CONFIG_USB_STORAGE_FREECOM),y)
        O_OBJS += freecom.o
 endif
index d8845d8c2d02d3409f6905ddca01b2024bffbcf3..2a5127bb6ca5ea25b3f0773f722d88424d849ac1 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * Debugging Functions Source Code File
  *
- * $Id: debug.c,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: debug.c,v 1.2 2000/07/19 17:21:39 groovyjava Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -97,22 +97,47 @@ void usb_stor_show_command(Scsi_Cmnd *srb)
        case WRITE_LONG: what = "WRITE_LONG"; break;
        case CHANGE_DEFINITION: what = "CHANGE_DEFINITION"; break;
        case WRITE_SAME: what = "WRITE_SAME"; break;
+       case GPCMD_READ_SUBCHANNEL: what = "READ SUBCHANNEL"; break;
        case READ_TOC: what = "READ_TOC"; break;
+       case GPCMD_READ_HEADER: what = "READ HEADER"; break;
+       case GPCMD_PLAY_AUDIO_10: what = "PLAY AUDIO (10)"; break;
+       case GPCMD_PLAY_AUDIO_MSF: what = "PLAY AUDIO MSF"; break;
+       case GPCMD_GET_EVENT_STATUS_NOTIFICATION:
+               what = "GET EVENT/STATUS NOTIFICATION"; break;
+       case GPCMD_PAUSE_RESUME: what = "PAUSE/RESUME"; break;
        case LOG_SELECT: what = "LOG_SELECT"; break;
        case LOG_SENSE: what = "LOG_SENSE"; break;
+       case GPCMD_STOP_PLAY_SCAN: what = "STOP PLAY/SCAN"; break;
+       case GPCMD_READ_DISC_INFO: what = "READ DISC INFORMATION"; break;
+       case GPCMD_READ_TRACK_RZONE_INFO:
+               what = "READ TRACK INFORMATION"; break;
+       case GPCMD_RESERVE_RZONE_TRACK: what = "RESERVE TRACK"; break;
+       case GPCMD_SEND_OPC: what = "SEND OPC"; break;
        case MODE_SELECT_10: what = "MODE_SELECT_10"; break;
+       case GPCMD_REPAIR_RZONE_TRACK: what = "REPAIR TRACK"; break;
+       case 0x59: what = "READ MASTER CUE"; break;
        case MODE_SENSE_10: what = "MODE_SENSE_10"; break;
-       case MOVE_MEDIUM: what = "MOVE_MEDIUM"; break;
+       case GPCMD_CLOSE_TRACK: what = "CLOSE TRACK/SESSION"; break;
+       case 0x5C: what = "READ BUFFER CAPACITY"; break;
+       case 0x5D: what = "SEND CUE SHEET"; break;
+       case GPCMD_BLANK: what = "BLANK"; break;
+       case MOVE_MEDIUM: what = "MOVE_MEDIUM or PLAY AUDIO (12)"; break;
        case READ_12: what = "READ_12"; break;
        case WRITE_12: what = "WRITE_12"; break;
        case WRITE_VERIFY_12: what = "WRITE_VERIFY_12"; break;
        case SEARCH_HIGH_12: what = "SEARCH_HIGH_12"; break;
        case SEARCH_EQUAL_12: what = "SEARCH_EQUAL_12"; break;
        case SEARCH_LOW_12: what = "SEARCH_LOW_12"; break;
-       case READ_ELEMENT_STATUS: what = "READ_ELEMENT_STATUS"; break;
        case SEND_VOLUME_TAG: what = "SEND_VOLUME_TAG"; break;
+       case READ_ELEMENT_STATUS: what = "READ_ELEMENT_STATUS"; break;
+       case GPCMD_READ_CD_MSF: what = "READ CD MSF"; break;
+       case GPCMD_SCAN: what = "SCAN"; break;
+       case GPCMD_SET_SPEED: what = "SET CD SPEED"; break;
+       case GPCMD_MECHANISM_STATUS: what = "MECHANISM STATUS"; break;
+       case GPCMD_READ_CD: what = "READ CD"; break;
+       case 0xE1: what = "WRITE CONTINUE"; break;
        case WRITE_LONG_2: what = "WRITE_LONG_2"; break;
-       default: break;
+       default: what = "(unknown command)"; break;
        }
        US_DEBUGP("Command %s (%d bytes)\n", what, srb->cmd_len);
        US_DEBUGP("%02x %02x %02x %02x "
index ab5bef0acbb25f6700c97e2940cc57b10d3e35c2..04a08be2efb670f3838f4c9efa12befbe648ec0a 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * Debugging Functions Header File
  *
- * $Id: debug.h,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: debug.h,v 1.3 2000/07/19 19:34:48 groovyjava Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -47,6 +47,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/blk.h>
+#include <linux/cdrom.h>
 #include "scsi.h"
 
 #define USB_STORAGE "usb-storage: "
index d3624dc76a28880d8be8ad2785ce004a953c3596..5e7a5a23be63b3f19058763fd90df58dda94680e 100644 (file)
@@ -1,6 +1,6 @@
 /* Driver for USB Mass Storage compliant devices
  *
- * $Id: protocol.c,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: protocol.c,v 1.2 2000/07/19 17:21:39 groovyjava Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -64,6 +64,11 @@ void usb_stor_ATAPI_command(Scsi_Cmnd *srb, struct us_data *us)
         * a unsigned char cmnd[12], so we know we have storage available
         */
 
+       /* Pad the ATAPI command with zeros */
+
+       for (; srb->cmd_len<12; srb->cmd_len++)
+               srb->cmnd[srb->cmd_len] = 0;
+
        /* set command length to 12 bytes */
        srb->cmd_len = 12;
 
diff --git a/drivers/usb/storage/scm.c b/drivers/usb/storage/scm.c
new file mode 100644 (file)
index 0000000..2d3ca70
--- /dev/null
@@ -0,0 +1,979 @@
+/* Driver for SCM Microsystems USB-ATAPI cable
+ *
+ * SCM driver v0.1
+ *
+ * Current development and maintainance by:
+ *   (c) 2000 Robert Baruch (autophile@dol.net)
+ *
+ * Many originally ATAPI devices were slightly modified to meet the USB
+ * market by using some kind of translation from ATAPI to USB on the host,
+ * and the peripheral would translate from USB back to ATAPI.
+ *
+ * SCM Microsystems (www.scmmicro.com) makes a device, sold to OEM's only, 
+ * which does the USB-to-ATAPI conversion.  By obtaining the data sheet on
+ * their device under nondisclosure agreement, I have been able to write
+ * this driver for Linux.
+ *
+ * The chip used in the device can also be used for EPP and ISA translation
+ * as well. This driver is only guaranteed to work with the ATAPI
+ * translation.
+ *
+ * The only peripherals that I know of (as of 14 Jul 2000) that uses this
+ * device is the Hewlett-Packard 8200e CD-Writer Plus.
+ *
+ * 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, 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "transport.h"
+#include "protocol.h"
+#include "usb.h"
+#include "debug.h"
+#include "scm.h"
+
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/malloc.h>
+
+extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
+       u8 request, u8 requesttype, u16 value, u16 index,
+       void *data, u16 size);
+extern int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe,
+       unsigned int len, unsigned int *act_len);
+
+/*
+ * Send a control message and wait for the response.
+ *
+ * us - the pointer to the us_data structure for the device to use
+ *
+ * request - the URB Setup Packet's first 6 bytes. The first byte always
+ *  corresponds to the request type, and the second byte always corresponds
+ *  to the request.  The other 4 bytes do not correspond to value and index,
+ *  since they are used in a custom way by the SCM protocol.
+ *
+ * xfer_data - a buffer from which to get, or to which to store, any data
+ *  that gets send or received, respectively, with the URB. Even though
+ *  it looks like we allocate a buffer in this code for the data, xfer_data
+ *  must contain enough allocated space.
+ *
+ * xfer_len - the number of bytes to send or receive with the URB.
+ *
+ */
+
+static int scm_send_control(struct us_data *us,
+                    unsigned char command[8],
+                    unsigned char *xfer_data,
+                    unsigned int xfer_len) {
+
+       int result;
+       int pipe;
+       void *buffer = NULL;
+
+       command[6] = xfer_len&0xFF;
+       command[7] = (xfer_len>>8)&0xFF;
+
+       // Get the receive or send control pipe number, based on
+       // the direction indicated by the request type.
+
+       if (command[0] & USB_DIR_IN)
+               pipe = usb_rcvctrlpipe(us->pusb_dev,0);
+       else
+               pipe = usb_sndctrlpipe(us->pusb_dev,0);
+
+
+       // If data is going to be sent or received with the URB,
+       // then allocate a buffer for it. If data is to be sent,
+       // copy the data into the buffer.
+
+       if (xfer_len > 0) {
+               buffer = kmalloc(xfer_len, GFP_KERNEL);
+               if (!(command[0] & USB_DIR_IN))
+                       memcpy(buffer, xfer_data, xfer_len);
+       }
+
+       // Send the URB to the device and wait for a response.
+
+       /* Why are request and request type reversed in this call? */
+
+       result = usb_stor_control_msg(us, pipe,
+                     command[1], command[0],
+                     (((unsigned short)command[3])<<8) | command[2],
+                     (((unsigned short)command[5])<<8) | command[3],
+                     buffer,
+                     xfer_len);
+
+
+       // If data was sent or received with the URB, free the buffer we
+       // allocated earlier, but not before reading the data out of the
+       // buffer if we wanted to receive data.
+
+       if (xfer_len > 0) {
+               if (command[0] & USB_DIR_IN)
+                       memcpy(xfer_data, buffer, xfer_len);
+               kfree(buffer);
+       }
+
+       // Check the return code for the command.
+
+       if (result < 0) {
+               /* a stall is a fatal condition from the device */
+               if (result == -EPIPE) {
+                       US_DEBUGP("-- Stall on control pipe. Clearing\n");
+                       result = usb_clear_halt(us->pusb_dev, pipe);
+                       US_DEBUGP("-- usb_clear_halt() returns %d\n", result);
+                       return USB_STOR_TRANSPORT_FAILED;
+               }
+
+               /* Uh oh... serious problem here */
+               return USB_STOR_TRANSPORT_ERROR;
+       }
+
+       return USB_STOR_TRANSPORT_GOOD;
+}
+
+static int scm_raw_bulk(struct us_data *us, 
+               int pipe, int maxlen,
+               unsigned char *data,
+               unsigned short len) {
+
+       int transferred = 0;
+       int result;
+       int act_len;
+       int partial_len;
+       unsigned char status;
+
+       maxlen = len;
+
+       // while (transferred < len) {
+
+               // We want to transfer up to maxlen bytes
+
+               partial_len = len-transferred > maxlen ?
+                       maxlen :
+                       len-transferred;
+
+               result = usb_stor_bulk_msg(us,
+                 data+transferred,
+                 pipe,
+                 partial_len,
+                 &act_len);
+
+               /* if we stall, we need to clear it before we go on */
+               if (result == -EPIPE) {
+                       US_DEBUGP("EPIPE: clearing endpoint halt for"
+                               " pipe 0x%x, stalled at %d bytes\n",
+                               pipe, act_len);
+                       usb_clear_halt(us->pusb_dev, pipe);
+
+                       // What the hey is goin' on?
+
+                       /* US_DEBUGP("EPIPE: Trying to retransmit bulk data...\n");
+
+                       wait_ms(10);
+       
+                       result = usb_stor_bulk_msg(us, data+act_len,
+                               pipe, len-act_len, &act_len);
+
+                       if (result==0)
+                               US_DEBUGP("EPIPE: Retransmit successful\n"); */
+
+                       wait_ms(1000);
+                       US_DEBUGP("Trying to get status\n");
+                       result = scm_read(us, SCM_ATA, 0x17, &status);
+                       US_DEBUGP("SCM: Write ATA data status is %02X\n",
+                               status);
+
+                       result = -EPIPE;
+               }
+
+               if (result) {
+
+                       /* NAK - that means we've retried a few times already */
+                       if (result == -ETIMEDOUT) {
+                               US_DEBUGP("scm_raw_bulk():"
+                                       " device NAKed\n");
+                               return US_BULK_TRANSFER_FAILED;
+                       }
+
+                       /* -ENOENT -- we canceled this transfer */
+                       if (result == -ENOENT) {
+                               US_DEBUGP("scm_raw_bulk():"
+                                       " transfer aborted\n");
+                               return US_BULK_TRANSFER_ABORTED;
+                       }
+
+                       if (result == -EPIPE) {
+                               US_DEBUGP("scm_raw_bulk():"
+                                       " output pipe stalled\n");
+                               return USB_STOR_TRANSPORT_FAILED;
+                       }
+
+                       /* the catch-all case */
+                       US_DEBUGP("us_transfer_partial(): unknown error\n");
+                       return US_BULK_TRANSFER_FAILED;
+               }
+       
+               if (act_len != partial_len) {
+                       US_DEBUGP("Warning: Transferred only %d bytes\n",
+                               act_len);
+                       return US_BULK_TRANSFER_SHORT;
+               }
+
+               US_DEBUGP("Transfered %d of %d bytes\n", act_len, partial_len);
+
+               transferred += act_len;
+       // } // while transferred < len
+
+       return US_BULK_TRANSFER_GOOD;
+}
+
+static int scm_bulk_transport(struct us_data *us,
+                         unsigned char *command,
+                         unsigned short command_len,
+                         unsigned char *data,
+                         unsigned short len,
+                         int use_sg) {
+
+       int result;
+       int transferred = 0;
+       int maxlen;
+       unsigned char execute[8] = {
+               0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+       int i;
+       int pipe;
+       struct scatterlist *sg;
+       char string[64];
+
+       maxlen = us->pusb_dev->actconfig->
+               interface[0].altsetting[0].endpoint[
+               ( (command[0]&0x80) ? us->ep_in : us->ep_out)-1].
+               wMaxPacketSize;
+
+       /* Fix up the command's data length */
+
+       command[6] = len&0xFF;
+       command[7] = (len>>8)&0xFF;
+
+       result = scm_send_control(us, 
+                                 execute,
+                                 command,
+                                 command_len);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if (len==0)
+               return result;
+
+       /* transfer the data payload for the command, if there is any */
+
+       if (command[0]&0x80)
+               pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
+       else {
+               pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
+
+               /* Debug-print the first 48 bytes of the transfer */
+
+               if (!use_sg) {
+                       string[0] = 0;
+                       for (i=0; i<len && i<48; i++) {
+                               sprintf(string+strlen(string), "%02X ",
+                                 data[i]);
+                               if ((i%16)==15) {
+                                       US_DEBUGP("%s\n", string);
+                                       string[0] = 0;
+                               }
+                       }
+                       if (string[0]!=0)
+                               US_DEBUGP("%s\n", string);
+               }
+       }
+
+
+       US_DEBUGP("HP 8200e data %s maxlen %d transfer %d sg buffers %d\n",
+                 ( (command[0]&0x80) ? "in" : "out"),
+                 maxlen, len, use_sg);
+
+       if (!use_sg)
+               result = scm_raw_bulk(us, pipe, maxlen,
+                       data, len);
+       else {
+               sg = (struct scatterlist *)data;
+               for (i=0; i<use_sg && transferred<len; i++) {
+                       result = scm_raw_bulk(us, pipe, maxlen,
+                               sg[i].address, 
+                               len-transferred > sg[i].length ?
+                                       sg[i].length : len-transferred);
+                       if (result!=US_BULK_TRANSFER_GOOD)
+                               break;
+                       transferred += sg[i].length;
+               }
+       }
+
+       return result;
+}
+
+int scm_read(struct us_data *us,
+            unsigned char access,
+            unsigned char reg, 
+            unsigned char *content) {
+
+       int result;
+       unsigned char command[8] = {
+               0xC0, access, reg, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+
+       result =  scm_send_control(us, command, content, 1);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // US_DEBUGP("SCM: Reg %d -> %02X\n", reg, *content);
+
+       return result;
+}
+
+int scm_write(struct us_data *us,
+            unsigned char access,
+            unsigned char reg, 
+            unsigned char content) {
+
+       int result;
+       unsigned char command[8] = {
+               0x40, access|0x01, reg, content, 0x00, 0x00, 0x00, 0x00
+       };
+
+       result =  scm_send_control(us, command, NULL, 0);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // US_DEBUGP("SCM: Reg %d <- %02X\n", reg, content);
+
+       return result;
+}
+
+int scm_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[8] = {
+               0x40, 0x81, epp_control, external_trigger,
+               test_pattern, mask_byte, subcountL, subcountH
+       };
+
+       result =  scm_bulk_transport(us, command, 8, NULL, 0, 0);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       return result;
+}
+
+int scm_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[8] = {
+               0xC0, access|0x02, reg, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+
+       result =  scm_bulk_transport(us,
+               command, 8, content, len, use_sg);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // US_DEBUGP("SCM: Read data, result %d\n", result);
+
+       return result;
+}
+
+/*
+ * Block, waiting for an ATA device to become not busy or to report
+ * an error condition.
+ */
+
+int scm_wait_not_busy(struct us_data *us) {
+
+       int i;
+       int result;
+       unsigned char status;
+
+       /* Synchronizing cache on a CDR could take a heck of a long time,
+          but probably not more than 15 minutes or so */
+
+       for (i=0; i<500; i++) {
+               result = scm_read(us, SCM_ATA, 0x17, &status);
+               US_DEBUGP("SCM: Write ATA data status is %02X\n", status);
+               if (result!=USB_STOR_TRANSPORT_GOOD)
+                       return result;
+               if (status&0x01) // check condition
+                       return USB_STOR_TRANSPORT_FAILED;
+               if ((status&0x80)!=0x80) // not busy
+                       break;
+               if (i<5)
+                       wait_ms(100);
+               else if (i<20)
+                       wait_ms(500);
+               else if (i<49)
+                       wait_ms(1000);
+               else if (i<499)
+                       wait_ms(2000);
+       }
+
+       if (i==500)
+               return USB_STOR_TRANSPORT_FAILED;
+
+       return USB_STOR_TRANSPORT_GOOD;
+}
+
+int scm_write_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[8] = {
+               0x40, access|0x03, reg, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+       int i;
+       unsigned char status;
+
+       result =  scm_bulk_transport(us,
+               command, 8, content, len, use_sg);
+
+       if (result!=USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       return scm_wait_not_busy(us);
+}
+
+int scm_write_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 qualifier, 
+            unsigned char timeout, 
+            unsigned char *content,
+            unsigned short len,
+            int use_sg) {
+
+       int result;
+       unsigned char command[16] = {
+               0x40, access|0x07, 0x07, 0x17, 0xfc, 0xe7, 0x00, 0x00,
+               0x40, access|0x05, data_reg, status_reg,
+               qualifier, timeout, 0x00, 0x00
+       };
+       int i;
+       unsigned char status;
+       unsigned char data[num_registers*2];
+       int maxlen;
+       int transferred;
+       int pipe;
+       struct scatterlist *sg;
+       char string[64];
+
+       command[14] = len&0xFF;
+       command[15] = (len>>8)&0xFF;
+
+       for (i=0; i<num_registers; i++) {
+               data[i<<1] = registers[i];
+               data[1+(i<<1)] = data_out[i];
+       }
+
+       result =  scm_bulk_transport(us,
+               command, 16, data, num_registers*2, 0);
+
+       if (result!=USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       maxlen = us->pusb_dev->actconfig->
+               interface[0].altsetting[0].endpoint[us->ep_out-1].
+               wMaxPacketSize;
+
+       pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
+       transferred = 0;
+
+       US_DEBUGP("Transfer out %d bytes, sg buffers %d\n",
+               len, use_sg);
+
+       if (!use_sg) {
+
+               /* Debug-print the first 48 bytes of the transfer */
+
+               if (!use_sg) {
+                       string[0] = 0;
+                       for (i=0; i<len && i<48; i++) {
+                               sprintf(string+strlen(string), "%02X ",
+                                       content[i]);
+                               if ((i%16)==15) {
+                                       US_DEBUGP("%s\n", string);
+                                       string[0] = 0;
+                               }
+                       }
+                       if (string[0]!=0)
+                               US_DEBUGP("%s\n", string);
+               }
+
+               result = scm_raw_bulk(us, pipe, maxlen,
+                       content, len);
+
+       } else {
+
+               sg = (struct scatterlist *)content;
+               for (i=0; i<use_sg && transferred<len; i++) {
+                       result = scm_raw_bulk(us, pipe, maxlen,
+                               sg[i].address, 
+                               len-transferred > sg[i].length ?
+                                       sg[i].length : len-transferred);
+                       if (result!=US_BULK_TRANSFER_GOOD)
+                               break;
+                       transferred += sg[i].length;
+               }
+       }
+
+       if (result!=USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       return scm_wait_not_busy(us);
+}
+
+int scm_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[num_registers*2];
+       int i;
+       unsigned char cmd[8] = {
+               0x40, access|0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+       unsigned char status;
+
+       for (i=0; i<num_registers; i++) {
+               data[i<<1] = registers[i];
+               data[1+(i<<1)] = data_out[i];
+       }
+
+       result = scm_bulk_transport(us, cmd, 8, data, num_registers*2, 0);
+
+       if (result!=USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       return scm_wait_not_busy(us);
+}
+
+static int hp_8200e_select_and_test_registers(struct us_data *us) {
+
+       int result;
+       int selector;
+       unsigned char status;
+
+       // try device = master, then device = slave.
+
+       for (selector = 0xA0; selector <= 0xB0; selector += 0x10) {
+
+               if ( (result = scm_write(us, SCM_ATA, 0x16, selector)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x17, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x16, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x14, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x15, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_write(us, SCM_ATA, 0x14, 0x55)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_write(us, SCM_ATA, 0x15, 0xAA)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x14, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+
+               if ( (result = scm_read(us, SCM_ATA, 0x15, &status)) != 
+                               USB_STOR_TRANSPORT_GOOD)
+                       return result;
+       }
+
+       return result;
+}
+
+int scm_read_user_io(struct us_data *us,
+               unsigned char *data_flags) {
+
+       unsigned char command[8] = {
+               0xC0, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+       };
+       int result;
+
+       result = scm_send_control(us, command, data_flags, 1);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // US_DEBUGP("SCM: User I/O flags -> %02X\n", *data_flags);
+
+       return result;
+}
+
+int scm_write_user_io(struct us_data *us,
+               unsigned char enable_flags,
+               unsigned char data_flags) {
+
+       unsigned char command[8] = {
+               0x40, 0x82, enable_flags, data_flags, 0x00, 0x00, 0x00, 0x00
+       };
+       int result;
+
+       result = scm_send_control(us, command, NULL, 0);
+
+       if (result != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // US_DEBUGP("SCM: User I/O flags <- %02X\n", data_flags);
+
+       return result;
+}
+
+static int init_8200e(struct us_data *us) {
+
+       int result;
+       unsigned char status;
+
+       // Enable peripheral control signals
+
+       if ( (result = scm_write_user_io(us,
+         SCM_UIO_OE1 | SCM_UIO_OE0,
+         SCM_UIO_EPAD | SCM_UIO_1)) != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       wait_ms(2000);
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // Reset peripheral, enable periph control signals
+       // (bring reset signal up)
+
+       if ( (result = scm_write_user_io(us,
+         SCM_UIO_DRVRST | SCM_UIO_OE1 | SCM_UIO_OE0,
+         SCM_UIO_EPAD | SCM_UIO_1)) != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // Enable periph control signals
+       // (bring reset signal down)
+
+       if ( (result = scm_write_user_io(us,
+         SCM_UIO_OE1 | SCM_UIO_OE0,
+         SCM_UIO_EPAD | SCM_UIO_1)) != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       wait_ms(250);
+
+       // Write 0x80 to ISA port 0x3F
+
+       if ( (result = scm_write(us, SCM_ISA, 0x3F, 0x80)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // Read ISA port 0x27
+
+       if ( (result = scm_read(us, SCM_ISA, 0x27, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = hp_8200e_select_and_test_registers(us)) !=
+                        USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       // Enable periph control signals and card detect
+
+       if ( (result = scm_write_user_io(us,
+         SCM_UIO_ACKD |SCM_UIO_OE1 | SCM_UIO_OE0,
+         SCM_UIO_EPAD | SCM_UIO_1)) != USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       wait_ms(1400);
+
+       if ( (result = scm_read_user_io(us, &status)) !=
+                       USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = hp_8200e_select_and_test_registers(us)) !=
+                        USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       if ( (result = scm_set_shuttle_features(us, 
+                       0x83, 0x00, 0x88, 0x08, 0x15, 0x14)) !=
+                        USB_STOR_TRANSPORT_GOOD)
+               return result;
+
+       return result;
+}
+
+/*
+ * Transport for the HP 8200e
+ */
+int hp8200e_transport(Scsi_Cmnd *srb, struct us_data *us)
+{
+       int result;
+       unsigned char status;
+       unsigned char registers[32];
+       unsigned char data[32];
+       unsigned int len;
+       int i;
+       char string[64];
+
+       /* This table tells us:
+          X = command not supported
+          L = return length in cmnd[4] (8 bits).
+          H = return length in cmnd[7] and cmnd[8] (16 bits).
+          D = return length in cmnd[6] to cmnd[9] (32 bits).
+          B = return length/blocksize in cmnd[6] to cmnd[8].
+          T = return length in cmnd[6] to cmnd[8] (24 bits).
+          0-9 = fixed return length
+          W = 24 bytes
+          h = return length/2048 in cmnd[7-8].
+       */
+
+       static char *lengths =
+
+       /* 0123456789ABCDEF   0123456789ABCDEF */
+
+         "0XXL0XXXXXXXXXXX" "XXLXXXXXXXX0XX0X"  /* 00-1F */
+         "XXXXX8XXhXH0XXX0" "XXXXX0XXXXXXXXXX"  /* 20-3F */
+         "XXHHL0X0XXH0XX0X" "XHH00HXX0TH0H0XX"  /* 40-5F */
+         "XXXXXXXXXXXXXXXX" "XXXXXXXXXXXXXXXX"  /* 60-7F */
+         "XXXXXXXXXXXXXXXX" "XXXXXXXXXXXXXXXX"  /* 80-9F */
+         "X0XXX0XXDXDXXXXX" "XXXXXXXXX000XHBX"  /* A0-BF */
+         "XXXXXXXXXXXXXXXX" "XXXXXXXXXXXXXXXX"  /* C0-DF */
+         "XDXXXXXXXXXXXXXX" "XXW00HXXXXXXXXXX"; /* E0-FF */
+
+       /* FIXME: B9 (READ CD MSF) has unknown length! */
+
+       /* US_DEBUGP("XXXXXXXX 8200e transport called, tid %08X\n",
+               current->pid); */
+
+       if (us->flags & US_FL_NEED_INIT) {
+               US_DEBUGP("8200e: initializing\n");
+               init_8200e(us);
+               us->flags &= ~US_FL_NEED_INIT;
+       }
+
+       if (srb->sc_data_direction == SCSI_DATA_WRITE)
+               len = srb->request_bufflen;
+       else {
+
+               switch (lengths[srb->cmnd[0]]) {
+
+               case 'L':
+                       len = srb->cmnd[4];
+                       break;
+               case '0':
+               case '1':
+               case '2':
+               case '3':
+               case '4':
+               case '5':
+               case '6':
+               case '7':
+               case '8':
+               case '9':
+                       len = lengths[srb->cmnd[0]]-'0';
+                       break;
+               case 'H':
+                       len = (((unsigned int)srb->cmnd[7])<<8) | srb->cmnd[8];
+                       break;
+               case 'h':
+                       len = (((unsigned int)srb->cmnd[7])<<8) | srb->cmnd[8];
+                       len <<= 11; // *2048
+                       break;
+               case 'T':
+                       len = (((unsigned int)srb->cmnd[6])<<16) |
+                             (((unsigned int)srb->cmnd[7])<<8) |
+                             srb->cmnd[8];
+                       break;
+               case 'D':
+                       len = (((unsigned int)srb->cmnd[6])<<24) |
+                             (((unsigned int)srb->cmnd[7])<<16) |
+                             (((unsigned int)srb->cmnd[8])<<8) |
+                             srb->cmnd[9];
+                       break;
+               case 'W':
+                       len = 24;
+                       break;
+               default:
+                       US_DEBUGP("Error: UNSUPPORTED COMMAND %02X\n",
+                               srb->cmnd[0]);
+                       return USB_STOR_TRANSPORT_ERROR;
+               }
+       }
+
+       if (len > 0xFFFF) {
+               US_DEBUGP("Error: len = %08X... what do I do now?\n",
+                       len);
+               return USB_STOR_TRANSPORT_ERROR;
+       }
+
+       // US_DEBUGP("XXXXXXXXXXXXXXXX req_bufflen %d, len %d, bufflen %d\n", 
+       //      srb->request_bufflen, len, srb->bufflen);
+
+       /* Send A0 (ATA PACKET COMMAND).
+          Note: I guess we're never going to get any of the ATA
+          commands... just ATA Packet Commands.
+        */
+
+       registers[0] = 0x11;
+       registers[1] = 0x12;
+       registers[2] = 0x13;
+       registers[3] = 0x14;
+       registers[4] = 0x15;
+       registers[5] = 0x16;
+       registers[6] = 0x17;
+       data[0] = 0x00;
+       data[1] = 0x00;
+       data[2] = 0x00;
+       data[3] = len&0xFF;             // (cylL) = expected length (L)
+       data[4] = (len>>8)&0xFF;        // (cylH) = expected length (H)
+       data[5] = 0xB0;                 // (device sel) = slave
+       data[6] = 0xA0;                 // (command) = ATA PACKET COMMAND
+
+       if (srb->sc_data_direction == SCSI_DATA_WRITE) {
+
+               for (i=7; i<19; i++) {
+                       registers[i] = 0x10;
+                       data[i] = (i-7 >= srb->cmd_len) ? 0 : srb->cmnd[i-7];
+               }
+
+               result = scm_write_block_test(us, SCM_ATA, 
+                       registers, data, 19,
+                       0x10, 0x17, 0xFD, 0x30,
+                       srb->request_buffer, 
+                       len, srb->use_sg);
+
+               return result;
+       }
+
+       if ( (result = scm_multiple_write(us, 
+                       SCM_ATA,
+                       registers, data, 7)) != USB_STOR_TRANSPORT_GOOD) {
+               return result;
+       }
+
+       // Write the 12-byte command header.
+
+       if ( (result = scm_write_block(us, 
+                       SCM_ATA, 0x10, srb->cmnd, 12, 0)) !=
+                               USB_STOR_TRANSPORT_GOOD) {
+               return result;
+       }
+
+       // If there is response data to be read in 
+       // then do it here.
+
+       if (len != 0 && (srb->sc_data_direction == SCSI_DATA_READ)) {
+
+               // How many bytes to read in? Check cylL register
+
+               if ( (result = scm_read(us, SCM_ATA, 0x14, &status)) != 
+                   USB_STOR_TRANSPORT_GOOD) {
+                       return result;
+               }
+
+               if (len>0xFF) { // need to read cylH also
+                       len = status;
+                       if ( (result = scm_read(us, SCM_ATA, 0x15, &status)) !=
+                                   USB_STOR_TRANSPORT_GOOD) {
+                               return result;
+                       }
+                       len += ((unsigned int)status)<<8;
+               }
+               else
+                       len = status;
+                       
+
+               result = scm_read_block(us, SCM_ATA, 0x10, 
+                       srb->request_buffer, len, srb->use_sg);
+
+               /* Debug-print the first 32 bytes of the transfer */
+
+               if (!srb->use_sg) {
+                       string[0] = 0;
+                       for (i=0; i<len && i<32; i++) {
+                               sprintf(string+strlen(string), "%02X ",
+                                 ((unsigned char *)srb->request_buffer)[i]);
+                               if ((i%16)==15) {
+                                       US_DEBUGP("%s\n", string);
+                                       string[0] = 0;
+                               }
+                       }
+                       if (string[0]!=0)
+                               US_DEBUGP("%s\n", string);
+               }
+       }
+
+       // US_DEBUGP("Command result %d\n", result);
+
+       return result;
+}
diff --git a/drivers/usb/storage/scm.h b/drivers/usb/storage/scm.h
new file mode 100644 (file)
index 0000000..edc324a
--- /dev/null
@@ -0,0 +1,77 @@
+/* Driver for SCM Microsystems USB-ATAPI cable
+ * Header File
+ *
+ * Current development and maintainance by:
+ *   (c) 2000 Robert Baruch (autophile@dol.net)
+ *
+ * See scm.c for more explanation
+ *
+ * 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, 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.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef _USB_SCM_H
+#define _USB_SCM_H
+
+#define SCM_EPP_PORT           0x10
+#define SCM_EPP_REGISTER       0x30
+#define SCM_ATA                        0x40
+#define SCM_ISA                        0x50
+
+/* SCM User I/O Data registers */
+
+#define SCM_UIO_EPAD           0x80 // Enable Peripheral Control Signals
+#define SCM_UIO_CDT            0x40 // Card Detect (Read Only)
+                                    // CDT = ACKD & !UI1 & !UI0
+#define SCM_UIO_1              0x20 // I/O 1
+#define SCM_UIO_0              0x10 // I/O 0
+#define SCM_UIO_EPP_ATA                0x08 // 1=EPP mode, 0=ATA mode
+#define SCM_UIO_UI1            0x04 // Input 1
+#define SCM_UIO_UI0            0x02 // Input 0
+#define SCM_UIO_INTR_ACK       0x01 // Interrupt (ATA & ISA)/Acknowledge (EPP)
+
+/* SCM User I/O Enable registers */
+
+#define SCM_UIO_DRVRST         0x80 // Reset Peripheral
+#define SCM_UIO_ACKD           0x40 // Enable Card Detect
+#define SCM_UIO_OE1            0x20 // I/O 1 set=output/clr=input
+                                    // If ACKD=1, set OE1 to 1 also.
+#define SCM_UIO_OE0            0x10 // I/O 0 set=output/clr=input
+#define SCM_UIO_ADPRST         0x01 // Reset SCM chip
+
+/* SCM-specific commands */
+
+extern int scm_read(struct us_data *us, unsigned char access,
+       unsigned char reg, unsigned char *content);
+extern int scm_write(struct us_data *us, unsigned char access,
+       unsigned char reg, unsigned char content);
+extern int scm_read_block(struct us_data *us, unsigned char access,
+       unsigned char reg, unsigned char *content, unsigned short len,
+       int use_sg);
+extern int scm_write_block(struct us_data *us, unsigned char access,
+       unsigned char reg, unsigned char *content, unsigned short len,
+       int use_sg);
+extern int scm_multiple_write(struct us_data *us, unsigned char access,
+       unsigned char *registers, unsigned char *data_out,
+       unsigned short num_registers);
+extern int scm_read_user_io(struct us_data *us, unsigned char *data_flags);
+extern int scm_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);
+
+
+#endif
index 71487235dfb69e34e1767bc2e88f7d843cebf6c4..ad0df666be4e788e07a7e06802716f13796f30e9 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * SCSI layer glue code
  *
- * $Id: scsiglue.c,v 1.2 2000/06/27 10:20:39 mdharm Exp $
+ * $Id: scsiglue.c,v 1.4 2000/07/20 01:14:56 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -135,7 +135,7 @@ static int release(struct Scsi_Host *psh)
         */
        US_DEBUGP("-- sending US_ACT_EXIT command to thread\n");
        us->action = US_ACT_EXIT;
-       up(&(us->sleeper));
+       wake_up(&(us->wqh));
        down(&(us->notify));
        
        /* free the data structure we were using */
@@ -171,9 +171,11 @@ static int queuecommand( Scsi_Cmnd *srb , void (*done)(Scsi_Cmnd *))
        srb->scsi_done = done;
        us->action = US_ACT_COMMAND;
 
-       /* wake up the process task */
+       /* release the lock on the structure */
        up(&(us->queue_exclusion));
-       up(&(us->sleeper));
+
+       /* wake up the process task */
+       wake_up(&(us->wqh));
 
        return 0;
 }
@@ -335,7 +337,7 @@ Scsi_Host_Template usb_stor_host_template = {
        emulated:               TRUE
 };
 
-unsigned char usb_stor_sense_notready[12] = {
+unsigned char usb_stor_sense_notready[18] = {
        [0]     = 0x70,                     /* current error */
        [2]     = 0x02,                     /* not ready */
        [5]     = 0x0a,                     /* additional length */
index ea8a345041259a38b94d772a5b3bf1b52a894870..e9da1bcc01c644cc8921a2da731b4ca8a342ef8f 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * SCSI Connecting Glue Header File
  *
- * $Id: scsiglue.h,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: scsiglue.h,v 1.2 2000/07/19 22:12:07 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -45,7 +45,7 @@
 #include "scsi.h"
 #include "hosts.h"
 
-extern unsigned char usb_stor_sense_notready[12];
+extern unsigned char usb_stor_sense_notready[18];
 extern unsigned char us_direction[256/8];
 extern Scsi_Host_Template usb_stor_host_template;
 extern int usb_stor_scsiSense10to6(Scsi_Cmnd*);
index c83a7512d8e8cf4df98e161117b1de2e8e3b2196..88c8476419894836566089283e47b595cf9594b3 100644 (file)
@@ -1,6 +1,6 @@
 /* Driver for USB Mass Storage compliant devices
  *
- * $Id: transport.c,v 1.2 2000/06/27 10:20:39 mdharm Exp $
+ * $Id: transport.c,v 1.3 2000/07/20 01:06:40 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
  */
 static void usb_stor_blocking_completion(urb_t *urb)
 {
-       api_wrapper_data *awd = (api_wrapper_data *)urb->context;
+       wait_queue_head_t *wqh_ptr = (wait_queue_head_t *)urb->context;
 
-       if (waitqueue_active(awd->wakeup))
-               wake_up(awd->wakeup);
+       if (waitqueue_active(wqh_ptr))
+               wake_up(wqh_ptr);
 }
 
 /* This is our function to emulate usb_control_msg() but give us enough
@@ -73,9 +73,8 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
                         u8 request, u8 requesttype, u16 value, u16 index, 
                         void *data, u16 size)
 {
-       DECLARE_WAITQUEUE(wait, current);
-       DECLARE_WAIT_QUEUE_HEAD(wqh);
-       api_wrapper_data awd;
+       wait_queue_head_t wqh;
+       wait_queue_t wait;
        int status;
        devrequest *dr;
 
@@ -92,9 +91,8 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
        dr->length = cpu_to_le16(size);
 
        /* set up data structures for the wakeup system */
-       awd.wakeup = &wqh;
-       awd.handler = 0;
        init_waitqueue_head(&wqh);      
+       init_waitqueue_entry(&wait, current);   
        add_wait_queue(&wqh, &wait);
 
        /* lock the URB */
@@ -103,7 +101,7 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
        /* fill the URB */
        FILL_CONTROL_URB(us->current_urb, us->pusb_dev, pipe, 
                         (unsigned char*) dr, data, size, 
-                        usb_stor_blocking_completion, &awd);
+                        usb_stor_blocking_completion, &wqh);
 
        /* submit the URB */
        set_current_state(TASK_UNINTERRUPTIBLE);
@@ -143,15 +141,13 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
 int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe,
                      unsigned int len, unsigned int *act_len)
 {
-       DECLARE_WAITQUEUE(wait, current);
-       DECLARE_WAIT_QUEUE_HEAD(wqh);
-       api_wrapper_data awd;
+       wait_queue_head_t wqh;
+       wait_queue_t wait;
        int status;
 
        /* set up data structures for the wakeup system */
-       awd.wakeup = &wqh;
-       awd.handler = 0;
        init_waitqueue_head(&wqh);      
+       init_waitqueue_entry(&wait, current);   
        add_wait_queue(&wqh, &wait);
 
        /* lock the URB */
@@ -159,7 +155,7 @@ int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe,
 
        /* fill the URB */
        FILL_BULK_URB(us->current_urb, us->pusb_dev, pipe, data, len,
-                     usb_stor_blocking_completion, &awd);
+                     usb_stor_blocking_completion, &wqh);
 
        /* submit the URB */
        set_current_state(TASK_UNINTERRUPTIBLE);
index fb86997818f160f5371a0d2ca11c2b85a67fe835..e5445f21b627833c94bde402495e0b547a188b43 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * Transport Functions Header File
  *
- * $Id: transport.h,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: transport.h,v 1.3 2000/07/20 23:36:22 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -54,6 +54,9 @@ extern unsigned char us_direction[256/8];
 #define US_PR_CBI      0x00            /* Control/Bulk/Interrupt */
 #define US_PR_CB       0x01            /* Control/Bulk w/o interrupt */
 #define US_PR_BULK     0x50            /* bulk only */
+#ifdef CONFIG_USB_STORAGE_HP8200e
+#define US_PR_SCM_ATAPI        0x80            /* SCM-ATAPI bridge */
+#endif
 
 /*
  * Bulk only data structures
index d493bc69555f4ba135a4ab7c4ab06ce8d5609670..060c8f4c0c5845fe3071d63ad3ff29bc07b6b39a 100644 (file)
@@ -1,6 +1,6 @@
 /* Driver for USB Mass Storage compliant devices
  *
- * $Id: usb.c,v 1.3 2000/06/27 10:20:39 mdharm Exp $
+ * $Id: usb.c,v 1.6 2000/07/20 23:36:22 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
 #include "transport.h"
 #include "protocol.h"
 #include "debug.h"
+#ifdef CONFIG_USB_STORAGE_HP8200e
+#include "scm.h"
+#endif
 
 #include <linux/module.h>
- /*FIXME: note that this next include is needed for the new sleeping system
-  * which is not implemented yet
-  */
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -88,6 +88,7 @@ static struct usb_driver storage_driver = {
 
 static int usb_stor_control_thread(void * __us)
 {
+       wait_queue_t wait;
        struct us_data *us = (struct us_data *)__us;
        int action;
 
@@ -104,15 +105,23 @@ static int usb_stor_control_thread(void * __us)
 
        unlock_kernel();
 
+       /* set up for wakeups by new commands */
+       init_waitqueue_entry(&wait, current);
+       init_waitqueue_head(&(us->wqh));
+       add_wait_queue(&(us->wqh), &wait);
+
        /* signal that we've started the thread */
        up(&(us->notify));
 
        for(;;) {
+               set_current_state(TASK_INTERRUPTIBLE);
                US_DEBUGP("*** thread sleeping.\n");
-               down(&(us->sleeper));
-               down(&(us->queue_exclusion));
+               schedule();
                US_DEBUGP("*** thread awakened.\n");
 
+               /* lock access to the queue element */
+               down(&(us->queue_exclusion));
+
                /* take the command off the queue */
                action = us->action;
                us->action = 0;
@@ -216,6 +225,11 @@ static int usb_stor_control_thread(void * __us)
 static struct us_unusual_dev us_unusual_dev_list[] = {
        { 0x03f0, 0x0107, 0x0200, 0x0200, "HP USB CD-Writer Plus",
                US_SC_8070, US_PR_CB, 0}, 
+#ifdef CONFIG_USB_STORAGE_HP8200e
+       { 0x03f0, 0x0207, 0x0001, 0x0001, "HP USB CD-Writer Plus 8200e",
+               US_SC_8070, US_PR_SCM_ATAPI, 
+               US_FL_ALT_LENGTH | US_FL_NEED_INIT | US_FL_SINGLE_LUN}, 
+#endif
        { 0x04e6, 0x0001, 0x0200, 0x0200, "Matshita LS-120",
                US_SC_8020, US_PR_CB, US_FL_SINGLE_LUN},
        { 0x04e6, 0x0002, 0x0100, 0x0100, "Shuttle eUSCSI Bridge",
@@ -518,7 +532,6 @@ static void * storage_probe(struct usb_device *dev, unsigned int ifnum)
                }
 
                /* Initialize the mutexes only when the struct is new */
-               init_MUTEX_LOCKED(&(ss->sleeper));
                init_MUTEX_LOCKED(&(ss->notify));
                init_MUTEX_LOCKED(&(ss->ip_waitq));
                init_MUTEX(&(ss->queue_exclusion));
@@ -584,6 +597,15 @@ static void * storage_probe(struct usb_device *dev, unsigned int ifnum)
                        ss->max_lun = usb_stor_Bulk_max_lun(ss);
                        break;
                        
+#ifdef CONFIG_USB_STORAGE_HP8200e
+               case US_PR_SCM_ATAPI:
+                       ss->transport_name = "SCM/ATAPI";
+                       ss->transport = hp8200e_transport;
+                       ss->transport_reset = usb_stor_CB_reset;
+                       ss->max_lun = 1;
+#endif
+                       break;
+                       
                default:
                        ss->transport_name = "Unknown";
                        up(&us_list_semaphore);
index f18b6c868ffa0515f851e9e46df78a380ef66e72..8c7008fa920450205041508b2badec836e114dd4 100644 (file)
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * Main Header File
  *
- * $Id: usb.h,v 1.1 2000/06/27 01:25:28 mdharm Exp $
+ * $Id: usb.h,v 1.3 2000/07/20 01:14:56 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -103,6 +103,7 @@ struct us_unusual_dev {
 #define US_FL_ALT_LENGTH      0x00000008 /* use the alternate algorithm for
                                                    us_transfer_length()    */
 #define US_FL_IGNORE_SER      0x00000010 /* Ignore the serial number given  */
+#define US_FL_NEED_INIT              0x00000020 /* Device needs initialization     */
 
 #define USB_STOR_STRING_LEN 32
 
@@ -169,9 +170,11 @@ struct us_data {
        struct semaphore        current_urb_sem; /* to protect irq_urb   */
        struct urb              *current_urb;    /* non-int USB requests */
 
+       /* the waitqueue for sleeping the control thread */
+       wait_queue_head_t       wqh;             /* to sleep thread on   */
+
        /* mutual exclusion structures */
        struct semaphore        notify;          /* thread begin/end        */
-       struct semaphore        sleeper;         /* to sleep the thread on  */
        struct semaphore        queue_exclusion; /* to protect data structs */
 };
 
index d1155e0eed8a9dfca0965d304261ac61f380bf59..8300fc7d2ff3aad1d89a573f13a15b9a02d1d5a2 100644 (file)
@@ -622,10 +622,29 @@ static int sohci_free_dev (struct usb_device * usb_dev)
                spin_unlock_irqrestore (&usb_ed_lock, flags);
                
                if (cnt > 0) {
-                       add_wait_queue (&op_wakeup, &wait);
-                       current->state = TASK_UNINTERRUPTIBLE;
-                       schedule_timeout (HZ / 10);
-                       remove_wait_queue (&op_wakeup, &wait);
+
+                       if (ohci->disabled) {
+                               /* FIXME: Something like this should kick in,
+                                * though it's currently an exotic case ...
+                                * the controller won't ever be touching
+                                * these lists again!!
+                               dl_del_list (ohci,
+                                       le16_to_cpu (ohci->hcca.frame_no) & 1);
+                                */
+                               warn ("TD leak, %d", cnt);
+
+
+                       } else if (!in_interrupt ()) {
+                               /* SF interrupt handler calls dl_del_list */
+                               add_wait_queue (&op_wakeup, &wait);
+                               current->state = TASK_UNINTERRUPTIBLE;
+                               schedule_timeout (HZ / 10);
+                               remove_wait_queue (&op_wakeup, &wait);
+
+                       } else {
+                               /* drivers mustn't expect this to work */
+                               err ("can't free tds, interrupt context");
+                       }
                }
        }
        kfree (dev);
index bfac6098beae819b998c48aaf1e11df0857c25ac..de3b0dd9c8b5d56ed3de214850eac0bede997338 100644 (file)
 #include <linux/bitops.h>
 #include <linux/malloc.h>
 #include <linux/interrupt.h>  /* for in_interrupt() */
+
+
+#if    defined(CONFIG_KMOD) && defined(CONFIG_HOTPLUG)
+#include <linux/kmod.h>
+#include <linux/sched.h>
+#include <asm/uaccess.h>
+
+#define __KERNEL_SYSCALLS__
+#include <linux/unistd.h>
+
+/* waitpid() call glue uses this */
+static int errno;
+#endif
+
+
 #ifdef CONFIG_USB_DEBUG
        #define DEBUG
 #else
@@ -481,6 +496,213 @@ static int usb_find_interface_driver(struct usb_device *dev, unsigned ifnum)
        return -1;
 }
 
+
+#if    defined(CONFIG_KMOD) && defined(CONFIG_HOTPLUG)
+
+/*
+ * USB hotplugging invokes what /proc/sys/kernel/hotplug says
+ * (normally /sbin/hotplug) when USB devices get added or removed.
+ */
+
+static int exec_helper (void *arg)
+{
+       void **params = (void **) arg;
+       char *path = (char *) params [0];
+       char **argv = (char **) params [1];
+       char **envp = (char **) params [2];
+       return exec_usermodehelper (path, argv, envp);
+}
+
+int call_usermodehelper (char *path, char **argv, char **envp)
+{
+       void *params [3] = { path, argv, envp };
+       int pid, pid2, retval;
+       mm_segment_t fs;
+
+       if ((pid = kernel_thread (exec_helper, (void *) params, 0)) < 0) {
+               err ("failed fork of %s, errno = %d", argv [0], -pid);
+               return -1;
+       }
+
+       /* set signal mask? */
+       fs = get_fs ();
+       set_fs (KERNEL_DS);                             /* retval is in kernel space. */
+       pid2 = waitpid (pid, &retval, __WCLONE);        /* "errno" gets assigned */
+       set_fs (fs);
+       /* restore signal mask? */
+
+       if (pid2 != pid) {
+               err ("waitpid(%d) failed, returned %d\n", pid, pid2);
+                       return -1;
+       }
+       return retval;
+}
+
+static int to_bcd (char *buf, __u16 *bcdValue)
+{
+       int     retval = 0;
+       char    *value = (char *) bcdValue;
+       int     temp;
+
+       /* digits are 0-9 then ":;<=>?" for devices using
+        * non-bcd (non-standard!) values here ... */
+
+       /* No leading (or later, trailing) zeroes since scripts do
+        * literal matches, and that's how they're doing them. */
+       if ((temp = value [1] & 0xf0) != 0) {
+               temp >>= 4;
+               temp += '0';
+               *buf++ = (char) temp;
+               retval++;
+       }
+
+       temp = value [1] & 0x0f;
+       temp += '0';
+       *buf++ = (char) temp;
+       retval++;
+
+       *buf++ = '.';
+       retval++;
+
+       temp = value [0] & 0xf0;
+       temp >>= 4;
+       temp += '0';
+       *buf++ = (char) temp;
+       retval++;
+
+       if ((temp = value [0] & 0x0f) != 0) {
+               temp += '0';
+               *buf++ = (char) temp;
+               retval++;
+       }
+       *buf++ = 0;
+
+       return retval;
+}
+
+/*
+ * This invokes a user mode policy agent, typically helping to load driver
+ * or other modules, configure the device, or both.
+ *
+ * Some synchronization is important: removes can't start processing
+ * before the add-device processing completes, and vice versa.  That keeps
+ * a stack of USB-related identifiers stable while they're in use.  If we
+ * know that agents won't complete after they return (such as by forking
+ * a process that completes later), it's enough to just waitpid() for the
+ * agent -- as is currently done.
+ *
+ * The reason: we know we're called either from khubd (the typical case)
+ * or from root hub initialization (init, kapmd, modprobe, etc).  In both
+ * cases, we know no other thread can recycle our address, since we must
+ * already have been serialized enough to prevent that.
+ */
+static void call_policy (char *verb, struct usb_device *dev)
+{
+       char *argv [3], **envp, *buf, *scratch;
+       int i = 0, value;
+
+       if (!hotplug_path [0])
+               return;
+       if (in_interrupt ()) {
+               dbg ("In_interrupt");
+               return;
+       }
+       if (!(envp = (char **) kmalloc (20 * sizeof (char *), GFP_KERNEL))) {
+               dbg ("enomem");
+               return;
+       }
+       if (!(buf = kmalloc (256, GFP_KERNEL))) {
+               kfree (envp);
+               dbg ("enomem2");
+               return;
+       }
+
+       /* only one standardized param to hotplug command: type */
+       argv [0] = hotplug_path;
+       argv [1] = "usb";
+       argv [2] = 0;
+
+       /* minimal command environment */
+       envp [i++] = "HOME=/";
+       envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
+
+#ifdef DEBUG
+       /* hint that policy agent should enter no-stdout debug mode */
+       envp [i++] = "DEBUG=kernel";
+#endif
+       /* extensible set of named bus-specific parameters,
+        * supporting multiple driver selection algorithms.
+        */
+       scratch = buf;
+
+       /* action:  add, remove */
+       envp [i++] = scratch;
+       scratch += sprintf (scratch, "ACTION=%s", verb) + 1;
+
+#ifdef CONFIG_USB_DEVICEFS
+       /* If this is available, userspace programs can directly read
+        * all the device descriptors we don't tell them about.  Or
+        * even act as usermode drivers.
+        *
+        * XXX how little intelligence can we hardwire?
+        * (a) mount point: /devfs, /dev, /proc/bus/usb etc.
+        * (b) naming convention: bus1/device3, 001/003 etc.
+        */
+       envp [i++] = "DEVFS=/proc/bus/usb";
+       envp [i++] = scratch;
+       scratch += sprintf (scratch, "DEVICE=/proc/bus/usb/%03d/%03d",
+               dev->bus->busnum, dev->devnum) + 1;
+#endif
+
+       /* per-device configuration hacks are often necessary */
+       envp [i++] = scratch;
+       scratch += sprintf (scratch, "PRODUCT=%x/%x/",
+               dev->descriptor.idVendor,
+               dev->descriptor.idProduct);
+       scratch += to_bcd (scratch, &dev->descriptor.bcdDevice) + 1;
+
+       /* otherwise, use a simple (so far) generic driver binding model */
+       envp [i++] = scratch;
+       if (dev->descriptor.bDeviceClass == 0) {
+               int alt = dev->actconfig->interface [0].act_altsetting;
+
+               /* simple/common case: one config, one interface, one driver
+                * unsimple cases:  everything else
+                */
+               scratch += sprintf (scratch, "INTERFACE=%d/%d/%d",
+                       dev->actconfig->interface [0].altsetting [alt].bInterfaceClass,
+                       dev->actconfig->interface [0].altsetting [alt].bInterfaceSubClass,
+                       dev->actconfig->interface [0].altsetting [alt].bInterfaceProtocol)
+                       + 1;
+               /* INTERFACE-0, INTERFACE-1, ... ? */
+       } else {
+               /* simple/common case: generic device, handled generically */
+               scratch += sprintf (scratch, "TYPE=%d/%d/%d",
+                       dev->descriptor.bDeviceClass,
+                       dev->descriptor.bDeviceSubClass,
+                       dev->descriptor.bDeviceProtocol) + 1;
+       }
+       envp [i++] = 0;
+       /* assert: (scratch - buf) < sizeof buf */
+
+       /* NOTE: user mode daemons can call the agents too */
+
+       dbg ("kusbd: %s %s", argv [0], argv [1]);
+       value = call_usermodehelper (argv [0], argv, envp);
+       kfree (buf);
+       kfree (envp);
+       dbg ("kusbd policy returned 0x%x", value);
+}
+
+#else
+
+static inline void
+call_policy (char *verb, struct usb_device *dev)
+{ } 
+
+#endif /* KMOD && HOTPLUG */
+
+
 /*
  * This entrypoint gets called for each new device.
  *
@@ -506,7 +728,8 @@ static void usb_find_drivers(struct usb_device *dev)
                dbg("unhandled interfaces on device");
 
        if (!claimed) {
-               warn("This device is not recognized by any installed USB driver.");
+               warn("USB device %d is not claimed by any active driver.",
+                       dev->devnum);
 #ifdef DEBUG
                usb_show_device(dev);
 #endif
@@ -1195,6 +1418,8 @@ void usb_disconnect(struct usb_device **pdev)
 
        info("USB disconnect on device %d", dev->devnum);
 
+       call_policy ("remove", dev);
+
        if (dev->actconfig) {
                for (i = 0; i < dev->actconfig->bNumInterfaces; i++) {
                        struct usb_interface *interface = &dev->actconfig->interface[i];
@@ -1712,6 +1937,9 @@ int usb_new_device(struct usb_device *dev)
        /* find drivers willing to handle this device */
        usb_find_drivers(dev);
 
+       /* userspace may load modules and/or configure further */
+       call_policy ("add", dev);
+
        return 0;
 }
 
index b48b27fd3bd5deb82373fd31c4d332842356081a..a422a7fe2b82e1e3344687c198032a205ae5d02c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: hitfb.c,v 1.1 2000/06/10 21:45:40 yaegashi Exp $
+ * $Id: hitfb.c,v 1.2 2000/07/04 06:24:46 yaegashi Exp $
  * linux/drivers/video/hitfb.c -- Hitachi LCD frame buffer device
  * (C) 1999 Mihai Spatar
  * (C) 2000 YAEGASHI Takeshi
index 8c87289a0a13e285983d4f9ffc1a995c26c4b3cb..11ac092cb849bd2b81372084200e2e50637a5318 100644 (file)
@@ -10,6 +10,7 @@
  *     Max Cohan: Fixed invalid FSINFO offset when info_sector is 0
  */
 
+#include <linux/config.h>
 #include <linux/version.h>
 #define __NO_VERSION__
 #include <linux/module.h>
index 2eaceae075eb9c7677f932f865d6bddbe8697f9c..f500588280276dce1f1ad0da2597778d75536155 100644 (file)
@@ -136,7 +136,7 @@ static void __fput(struct file *filp)
                mntput(mnt);
 }
 
-void _fput(struct file *file)
+static void _fput(struct file *file)
 {
        locks_remove_flock(file);
        __fput(file);
@@ -148,6 +148,25 @@ void _fput(struct file *file)
        file_list_unlock();
 }
 
+void fput(struct file * file)
+{
+       if (atomic_dec_and_test(&file->f_count))
+               _fput(file);
+}
+
+struct file * fget(unsigned int fd)
+{
+       struct file * file = NULL;
+       struct files_struct *files = current->files;
+
+       read_lock(&files->file_lock);
+       file = fcheck(fd);
+       if (file)
+               get_file(file);
+       read_unlock(&files->file_lock);
+       return file;
+}
+
 /* Here. put_filp() is SMP-safe now. */
 
 void put_filp(struct file *file)
index 0e82e36af9ffc4f6c14c8d69c5604ea500237893..e20e276073b187b9767461faa56b1f868c92c8c7 100644 (file)
@@ -153,19 +153,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -195,13 +182,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -227,17 +207,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -254,26 +223,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -282,34 +231,6 @@ static unsigned char page23[256] = {
        0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -335,17 +256,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 4fdaa6d96552579a35d038ad717b183de50fa439..2894e5c5656a8240d909056d33cca624e6d26283 100644 (file)
@@ -129,7 +129,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -160,12 +159,6 @@ static unsigned char page03[256] = {
        0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, /* 0xb8-0xbf */
        0xa7, 0xa8, 0xaa, 0xa9, 0xab, 0xac, 0xad, 0xae, /* 0xc0-0xc7 */
        0xaf, 0xe0, 0xe4, 0xe8, 0xe6, 0xe7, 0xe9, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -185,23 +178,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -218,26 +194,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0x00, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -263,17 +219,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 657daff55708618b929b2fea554a9c088fdb7759..4578c6ba11c4836085a38a78b8d7e9b82d51c748 100644 (file)
@@ -149,23 +149,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0xc7, 0xd7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0xc6, 0xd6, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -173,35 +156,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -209,35 +163,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -263,17 +188,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 807121e5697eab0850e7737077b2f46fb387c1c0..b2bb68aab0818c8b3404fa5483b3a32faf049200 100644 (file)
@@ -153,55 +153,12 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, /* 0x10-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -227,17 +184,6 @@ static unsigned char page25[256] = {
        0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index ea89ebc9c99fb10b9c10e9bf7e050c2bd21e948d..a4be6d26366c21e65c97328f8d7e9fdd67bced6e 100644 (file)
@@ -149,23 +149,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0x85, /* 0x68-0x6f */
        0xeb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x8d, 0xab, 0xbd, 0xbe, 0xa6, 0xa7, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page02[256] = {
@@ -198,10 +181,6 @@ static unsigned char page02[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
        0xf4, 0xfa, 0x00, 0xf2, 0x00, 0xf1, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -227,17 +206,6 @@ static unsigned char page25[256] = {
        0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index e2f9bcfa7932fd887250e2e4265429707cb388d0..778c99a0fa67f7fb1896beb1ac813cd7d7669994 100644 (file)
@@ -122,14 +122,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0xae, 0x00, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page04[256] = {
@@ -145,63 +137,12 @@ static unsigned char page04[256] = {
        0xf5, 0xf9, 0x9e, 0xf1, 0xed, 0xf7, 0x9c, 0xde, /* 0x48-0x4f */
        0x00, 0x84, 0x80, 0x82, 0x86, 0x88, 0x8a, 0x8c, /* 0x50-0x57 */
        0x8e, 0x90, 0x92, 0x94, 0x96, 0x00, 0x98, 0x9a, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page21[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, /* 0x10-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -227,17 +168,6 @@ static unsigned char page25[256] = {
        0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index e89007f84c99ffeab624bba050429a56a8883297..19d521025482804f4b95626bc1aeec41347c2ced 100644 (file)
@@ -145,27 +145,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0x9f, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -191,17 +170,6 @@ static unsigned char page25[256] = {
        0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 99f4725b8995fc0bfdbeb665620b31b5422d8c46..eff20e40ccf451c904387b8a3d2d84d26ed3d892 100644 (file)
@@ -159,13 +159,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -191,17 +184,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -218,26 +200,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -246,34 +208,6 @@ static unsigned char page23[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -299,17 +233,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 239bead06d666fe39193ceb3ad70b9bea37ceebc..c6263740d065f0cb0f78a972619e5469cec7cc84 100644 (file)
@@ -153,19 +153,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -195,13 +182,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -227,17 +207,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -254,26 +223,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -282,34 +231,6 @@ static unsigned char page23[256] = {
        0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -335,17 +256,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 95689a949f85fb639802e37d559548a68762d136..f4c70e6fae0f25848bcdf03356fa5069aef1656c 100644 (file)
@@ -153,19 +153,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -195,13 +182,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page05[256] = {
@@ -236,8 +216,6 @@ static unsigned char page05[256] = {
        0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0xd8-0xdf */
        0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0xe0-0xe7 */
        0x98, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -263,17 +241,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -290,26 +257,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -318,34 +265,6 @@ static unsigned char page23[256] = {
        0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -371,17 +290,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 81790cfd8566e8595164ed45013b0a63c00e5d2c..a443851ad9dd776d54daccfbb5bdf2e8502eb0a9 100644 (file)
@@ -153,19 +153,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -195,13 +182,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -221,23 +201,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -254,26 +217,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -282,34 +225,6 @@ static unsigned char page23[256] = {
        0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -335,17 +250,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index a8eac079c6f1cb43451a8bfcbdf9d080a0f6ddb5..b58e27c73a17c11127ba79bc3607f6d4576edc47 100644 (file)
@@ -129,7 +129,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdd, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -159,13 +158,6 @@ static unsigned char page03[256] = {
        0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page06[256] = {
@@ -183,25 +175,6 @@ static unsigned char page06[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x60-0x67 */
        0xb8, 0xb9, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -215,29 +188,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
        0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -263,17 +213,6 @@ static unsigned char page25[256] = {
        0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char pagefe[256] = {
index 74d50577882c11ac3b0af7164505fca8afadcd7e..f115fb6fb526a90bffebd36a8f8e3e8735eb4856 100644 (file)
@@ -153,19 +153,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
        0x00, 0x00, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -195,13 +182,6 @@ static unsigned char page03[256] = {
        0x00, 0xe0, 0x00, 0x00, 0xeb, 0xee, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
        0xe3, 0x00, 0x00, 0xe5, 0xe7, 0x00, 0xed, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -227,17 +207,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -254,26 +223,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0xf0, 0x00, 0x00, 0xf3, 0xf2, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -282,34 +231,6 @@ static unsigned char page23[256] = {
        0xa9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -335,17 +256,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 2b5ab5af246dbae0d0ebf9e8a8f1611af44c4cf9..04f6636875d6e1fa937388810bdb8052d60481b5 100644 (file)
@@ -121,15 +121,6 @@ static unsigned char page00[256] = {
        0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
        0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page04[256] = {
@@ -145,63 +136,12 @@ static unsigned char page04[256] = {
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
        0x00, 0xf1, 0x00, 0x00, 0xf3, 0x00, 0x00, 0xf5, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page21[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, /* 0x10-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -209,35 +149,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -263,17 +174,6 @@ static unsigned char page25[256] = {
        0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 4c5ee7020a0b4dc8d6a1d864eb9928ff4b15b5e5..082feaad37d8e3fe7d5a1e37b8e32abd656da5b0 100644 (file)
@@ -122,14 +122,6 @@ static unsigned char page00[256] = {
        0xf9, 0x97, 0x00, 0xae, 0x89, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
        0xf8, 0xf1, 0x99, 0x9a, 0x00, 0x00, 0x00, 0x88, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0xaf, 0x00, 0xab, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -160,12 +152,6 @@ static unsigned char page03[256] = {
        0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, /* 0xb8-0xbf */
        0xea, 0xeb, 0xed, 0xec, 0xee, 0xf2, 0xf3, 0xf4, /* 0xc0-0xc7 */
        0xf6, 0xfa, 0xa0, 0xfb, 0xa2, 0xa3, 0xfd, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -173,35 +159,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, /* 0x10-0x17 */
        0x8b, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -227,17 +184,6 @@ static unsigned char page25[256] = {
        0x00, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 7217c059cf09a41d4463568edab5c5981fd2f185..ff01f91aa064c0165403125966b31a238d913c24 100644 (file)
@@ -119,17 +119,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page0e[256] = {
@@ -145,27 +134,6 @@ static unsigned char page0e[256] = {
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
        0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */
        0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -174,34 +142,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x91, 0x92, 0x00, 0x00, 0x93, 0x94, 0x00, 0x00, /* 0x18-0x1f */
        0x00, 0x00, 0x95, 0x00, 0x00, 0x00, 0x85, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 0abe635e9e640851efad2c934e851cbc3298ba0f..a7e51e9d0a0e0ae33da9c8d51a6fd5a29e706cf6 100644 (file)
@@ -82,7 +82,6 @@ static wchar_t c2u_82[256] = {
        0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,0x3088,0x3089,/* 0xE0-0xE7 */
        0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,0x3090,0x3091,/* 0xE8-0xEF */
        0x3092,0x3093,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_83[256] = {
@@ -114,11 +113,6 @@ static wchar_t c2u_83[256] = {
        0x03B2,0x03B3,0x03B4,0x03B5,0x03B6,0x03B7,0x03B8,0x03B9,/* 0xC0-0xC7 */
        0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0,0x03C1,/* 0xC8-0xCF */
        0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,0x03C9,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_84[256] = {
@@ -147,14 +141,6 @@ static wchar_t c2u_84[256] = {
        0x2534,0x253C,0x2501,0x2503,0x250F,0x2513,0x251B,0x2517,/* 0xA8-0xAF */
        0x2523,0x2533,0x252B,0x253B,0x254B,0x2520,0x252F,0x2528,/* 0xB0-0xB7 */
        0x2537,0x253F,0x251D,0x2530,0x2525,0x2538,0x2542,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_87[256] = {
@@ -179,18 +165,6 @@ static wchar_t c2u_87[256] = {
        0x32A7,0x32A8,0x3231,0x3232,0x3239,0x337E,0x337D,0x337C,/* 0x88-0x8F */
        0x2252,0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,/* 0x90-0x97 */
        0x221F,0x22BF,0x2235,0x2229,0x222A,0x0000,0x0000,0x0000,/* 0x98-0x9F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_88[256] = {
@@ -1608,29 +1582,6 @@ static wchar_t c2u_FC[256] = {
        0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x38-0x3F */
        0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70,/* 0x40-0x47 */
        0x9D6B,0xFA2D,0x9E19,0x9ED1,0x0000,0x0000,0x0000,0x0000,/* 0x48-0x4F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x50-0x57 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x58-0x5F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x60-0x67 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x68-0x6F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x70-0x77 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x78-0x7F */
-       
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x80-0x87 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x88-0x8F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x90-0x97 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x98-0x9F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t *page_charset2uni[256] = {
@@ -1721,19 +1672,6 @@ static unsigned char u2c_03[512] = {
        0x83, 0xCE, 0x83, 0xCF, 0x00, 0x00, 0x83, 0xD0, /* 0xC0-0xC3 */
        0x83, 0xD1, 0x83, 0xD2, 0x83, 0xD3, 0x83, 0xD4, /* 0xC4-0xC7 */
        0x83, 0xD5, 0x83, 0xD6, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_04[512] = {
@@ -1758,50 +1696,6 @@ static unsigned char u2c_04[512] = {
        0x84, 0x8A, 0x84, 0x8B, 0x84, 0x8C, 0x84, 0x8D, /* 0x48-0x4B */
        0x84, 0x8E, 0x84, 0x8F, 0x84, 0x90, 0x84, 0x91, /* 0x4C-0x4F */
        0x00, 0x00, 0x84, 0x76, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_20[512] = {
@@ -1820,56 +1714,6 @@ static unsigned char u2c_20[512] = {
        0x81, 0xF1, 0x00, 0x00, 0x81, 0x8C, 0x81, 0x8D, /* 0x30-0x33 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0xA6, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_21[512] = {
@@ -1928,16 +1772,6 @@ static unsigned char u2c_21[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
        0x00, 0x00, 0x00, 0x00, 0x81, 0xCB, 0x00, 0x00, /* 0xD0-0xD3 */
        0x81, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_22[512] = {
@@ -1990,22 +1824,6 @@ static unsigned char u2c_22[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x99, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_23[512] = {
@@ -2014,66 +1832,6 @@ static unsigned char u2c_23[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
        0x00, 0x00, 0x00, 0x00, 0x81, 0xDC, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_24[512] = {
@@ -2106,42 +1864,6 @@ static unsigned char u2c_24[512] = {
        0x87, 0x48, 0x87, 0x49, 0x87, 0x4A, 0x87, 0x4B, /* 0x68-0x6B */
        0x87, 0x4C, 0x87, 0x4D, 0x87, 0x4E, 0x87, 0x4F, /* 0x6C-0x6F */
        0x87, 0x50, 0x87, 0x51, 0x87, 0x52, 0x87, 0x53, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_25[512] = {
@@ -2206,10 +1928,6 @@ static unsigned char u2c_25[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0xFC, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_26[512] = {
@@ -2241,43 +1959,6 @@ static unsigned char u2c_26[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
        0x00, 0x00, 0x00, 0x00, 0x81, 0xF4, 0x00, 0x00, /* 0x68-0x6B */
        0x00, 0x00, 0x81, 0xF3, 0x00, 0x00, 0x81, 0xF2, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_30[512] = {
@@ -2386,34 +2067,13 @@ static unsigned char u2c_32[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x87, 0x85, 0x87, 0x86, 0x87, 0x87, 0x87, 0x88, /* 0xA4-0xA7 */
-       0x87, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
+       0x87, 0x85, 0x87, 0x86, 0x87, 0x87, 0x87, 0x88, /* 0xA4-0xA7 */
+       0x87, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
 };
 
 static unsigned char u2c_33[512] = {
@@ -2470,18 +2130,6 @@ static unsigned char u2c_33[512] = {
        0x87, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
        0x00, 0x00, 0x87, 0x83, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_4E[512] = {
@@ -2685,7 +2333,6 @@ static unsigned char u2c_50[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xED, 0x60, 0x99, 0x4B, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x99, 0x4A, 0x00, 0x00, 0x95, 0xC6, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_51[512] = {
@@ -2889,7 +2536,6 @@ static unsigned char u2c_53[512] = {
        0x91, 0xE4, 0x8E, 0xB6, 0x8E, 0x6A, 0x89, 0x45, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x8A, 0x90, 0x8D, 0x86, /* 0xF4-0xF7 */
        0x8E, 0x69, 0x00, 0x00, 0x99, 0xDB, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_54[512] = {
@@ -3365,7 +3011,6 @@ static unsigned char u2c_5A[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x9B, 0x65, 0x9B, 0x66, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_5B[512] = {
@@ -3773,7 +3418,6 @@ static unsigned char u2c_60[512] = {
        0x91, 0xC4, 0x9C, 0xBB, 0xED, 0xA6, 0x91, 0x7A, /* 0xF0-0xF3 */
        0x9C, 0xB6, 0x00, 0x00, 0x9C, 0xB3, 0x9C, 0xB4, /* 0xF4-0xF7 */
        0x00, 0x00, 0x8E, 0xE4, 0x9C, 0xB7, 0x9C, 0xBA, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_61[512] = {
@@ -3977,7 +3621,6 @@ static unsigned char u2c_63[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x89, 0x87, 0xED, 0xAD, 0x9D, 0x88, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x97, 0x68, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_64[512] = {
@@ -4113,7 +3756,6 @@ static unsigned char u2c_65[512] = {
        0x00, 0x00, 0x9D, 0xDB, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x89, 0xA0, 0x9D, 0xDF, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_66[512] = {
@@ -4317,7 +3959,6 @@ static unsigned char u2c_68[512] = {
        0x00, 0x00, 0x00, 0x00, 0x90, 0xB1, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x9E, 0xA8, 0x8A, 0xBB, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_69[512] = {
@@ -4453,7 +4094,6 @@ static unsigned char u2c_6A[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x9F, 0x51, 0x9F, 0x4E, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6B[512] = {
@@ -4519,9 +4159,6 @@ static unsigned char u2c_6B[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x7C, /* 0xE8-0xEB */
        0x9F, 0x7B, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x7E, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x7D, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6C[512] = {
@@ -4587,9 +4224,6 @@ static unsigned char u2c_6C[512] = {
        0x92, 0x8D, 0x00, 0x00, 0x9F, 0xA3, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0xA1, /* 0xEC-0xEF */
        0x91, 0xD7, 0x9F, 0x96, 0x00, 0x00, 0x89, 0x6A, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6D[512] = {
@@ -5133,7 +4767,6 @@ static unsigned char u2c_74[512] = {
        0xE1, 0x46, 0xE1, 0x47, 0xE1, 0x45, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x95, 0x72, 0xE1, 0x49, /* 0xF4-0xF7 */
        0xE1, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_75[512] = {
@@ -5473,7 +5106,6 @@ static unsigned char u2c_79[512] = {
        0x8F, 0xCC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xDA, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7A[512] = {
@@ -5608,8 +5240,6 @@ static unsigned char u2c_7B[512] = {
        0x00, 0x00, 0x98, 0x55, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE2, 0xC8, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xE2, 0xCC, 0xE2, 0xC9, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7C[512] = {
@@ -5745,7 +5375,6 @@ static unsigned char u2c_7D[512] = {
        0x00, 0x00, 0x00, 0x00, 0xE3, 0x6C, 0x00, 0x00, /* 0xF0-0xF3 */
        0x97, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE3, 0x6B, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7E[512] = {
@@ -5790,30 +5419,6 @@ static unsigned char u2c_7E[512] = {
        0xE3, 0x98, 0x00, 0x00, 0xE3, 0x99, 0x00, 0x00, /* 0x94-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE3, 0x9B, /* 0x98-0x9B */
        0xE3, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7F[512] = {
@@ -6085,7 +5690,6 @@ static unsigned char u2c_82[512] = {
        0x00, 0x00, 0x89, 0x70, 0x00, 0x00, 0xE4, 0x94, /* 0xF0-0xF3 */
        0xE4, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xE4, 0x99, 0xE4, 0x95, 0xE4, 0x98, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_83[512] = {
@@ -6561,7 +6165,6 @@ static unsigned char u2c_89[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xE6, 0x5B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xE6, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8A[512] = {
@@ -6673,31 +6276,6 @@ static unsigned char u2c_8B[512] = {
        0x8F, 0x51, 0x00, 0x00, 0xE6, 0xA7, 0xE6, 0xA8, /* 0x90-0x93 */
        0x00, 0x00, 0x00, 0x00, 0xE6, 0xA9, 0x00, 0x00, /* 0x94-0x97 */
        0x00, 0x00, 0xE6, 0xAA, 0xE6, 0xAB, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8C[512] = {
@@ -7241,7 +6819,6 @@ static unsigned char u2c_93[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xEE, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_94[512] = {
@@ -7279,37 +6856,6 @@ static unsigned char u2c_94[512] = {
        0xE8, 0x74, 0xE8, 0x72, 0xE8, 0x75, 0xE8, 0x77, /* 0x7C-0x7F */
        
        0x00, 0x00, 0xE8, 0x76, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_95[512] = {
@@ -7372,12 +6918,6 @@ static unsigned char u2c_95[512] = {
        0xE8, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0x00, 0x00, 0xE8, 0x91, 0xE8, 0x93, 0x00, 0x00, /* 0xE0-0xE3 */
        0x00, 0x00, 0xE8, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_96[512] = {
@@ -7445,7 +6985,6 @@ static unsigned char u2c_96[512] = {
        0x95, 0xB5, 0x00, 0x00, 0x89, 0x5F, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x97, 0xEB, 0x97, 0x8B, /* 0xF4-0xF7 */
        0x00, 0x00, 0xE8, 0xB9, 0x00, 0x00, 0x93, 0x64, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_97[512] = {
@@ -7717,7 +7256,6 @@ static unsigned char u2c_9A[512] = {
        0x00, 0x00, 0xE9, 0x9D, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xE9, 0x9C, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x9E, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x9F, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9B[512] = {
@@ -7784,8 +7322,6 @@ static unsigned char u2c_9B[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0xE9, 0xCE, 0xE9, 0xCD, 0xE9, 0xCC, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x88, 0xB1, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9C[512] = {
@@ -7852,8 +7388,6 @@ static unsigned char u2c_9C[512] = {
        0xE9, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0xE9, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x96, 0x50, /* 0xF0-0xF3 */
        0x96, 0xC2, 0x00, 0x00, 0x93, 0xCE, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9D[512] = {
@@ -8035,97 +7569,10 @@ static unsigned char u2c_9F[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
        0xEA, 0x9D, 0xE2, 0x73, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
        0xEA, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_DC[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_F9[512] = {
@@ -8186,14 +7633,6 @@ static unsigned char u2c_F9[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
        0xEE, 0xCD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FA[512] = {
@@ -8209,59 +7648,6 @@ static unsigned char u2c_FA[512] = {
        0xEE, 0x97, 0xEE, 0x98, 0xEE, 0x9B, 0xEE, 0xB7, /* 0x24-0x27 */
        0xEE, 0xBE, 0xEE, 0xCE, 0xEE, 0xDA, 0xEE, 0xDB, /* 0x28-0x2B */
        0xEE, 0xDD, 0xEE, 0xEA, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FF[512] = {
@@ -8324,12 +7710,6 @@ static unsigned char u2c_FF[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0x81, 0x91, 0x81, 0x92, 0xEE, 0xF9, 0x81, 0x50, /* 0xE0-0xE3 */
        0xEE, 0xFA, 0x81, 0x8F, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 4bb624415e50f83828b7e2ea54da19bea4dd7896..d0d1f3826dabc3329df57ff9bfc0e4aa06fe4ca1 100644 (file)
@@ -1306,7 +1306,6 @@ static wchar_t c2u_A4[256] = {
        0x3080,0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,/* 0xE0-0xE7 */
        0x3088,0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,/* 0xE8-0xEF */
        0x3090,0x3091,0x3092,0x3093,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A5[256] = {
@@ -1342,7 +1341,6 @@ static wchar_t c2u_A5[256] = {
        0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,/* 0xE0-0xE7 */
        0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,/* 0xE8-0xEF */
        0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A6[256] = {
@@ -1378,7 +1376,6 @@ static wchar_t c2u_A6[256] = {
        0xFE35,0xFE36,0xFE39,0xFE3A,0xFE3F,0xFE40,0xFE3D,0xFE3E,/* 0xE0-0xE7 */
        0xFE41,0xFE42,0xFE43,0xFE44,0x0000,0x0000,0xFE3B,0xFE3C,/* 0xE8-0xEF */
        0xFE37,0xFE38,0xFE31,0x0000,0xFE33,0xFE34,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A7[256] = {
@@ -1414,7 +1411,6 @@ static wchar_t c2u_A7[256] = {
        0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,/* 0xE0-0xE7 */
        0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,/* 0xE8-0xEF */
        0x044E,0x044F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A8[256] = {
@@ -1449,8 +1445,6 @@ static wchar_t c2u_A8[256] = {
        0x3118,0x3119,0x311A,0x311B,0x311C,0x311D,0x311E,0x311F,/* 0xD8-0xDF */
        0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126,0x3127,/* 0xE0-0xE7 */
        0x3128,0x3129,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A9[256] = {
@@ -1485,8 +1479,6 @@ static wchar_t c2u_A9[256] = {
        0x2534,0x2535,0x2536,0x2537,0x2538,0x2539,0x253A,0x253B,/* 0xD8-0xDF */
        0x253C,0x253D,0x253E,0x253F,0x2540,0x2541,0x2542,0x2543,/* 0xE0-0xE7 */
        0x2544,0x2545,0x2546,0x2547,0x2548,0x2549,0x254A,0x254B,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AA[256] = {
@@ -1512,17 +1504,6 @@ static wchar_t c2u_AA[256] = {
        0x735D,0x735E,0x735F,0x7361,0x7362,0x7363,0x7364,0x7365,/* 0x90-0x97 */
        0x7366,0x7367,0x7368,0x7369,0x736A,0x736B,0x736E,0x7370,/* 0x98-0x9F */
        0x7371,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AB[256] = {
@@ -1548,17 +1529,6 @@ static wchar_t c2u_AB[256] = {
        0x73E2,0x73E3,0x73E4,0x73E6,0x73E8,0x73EA,0x73EB,0x73EC,/* 0x90-0x97 */
        0x73EE,0x73EF,0x73F0,0x73F1,0x73F3,0x73F4,0x73F5,0x73F6,/* 0x98-0x9F */
        0x73F7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AC[256] = {
@@ -1584,17 +1554,6 @@ static wchar_t c2u_AC[256] = {
        0x7466,0x7467,0x7468,0xF9AE,0x746A,0x746B,0x746C,0x746E,/* 0x90-0x97 */
        0x746F,0x7471,0x7472,0x7473,0x7474,0x7475,0x7478,0x7479,/* 0x98-0x9F */
        0x747A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AD[256] = {
@@ -1620,17 +1579,6 @@ static wchar_t c2u_AD[256] = {
        0x74D9,0x74DA,0x74DB,0x74DD,0x74DF,0x74E1,0x74E5,0x74E7,/* 0x90-0x97 */
        0x74E8,0x74E9,0x74EA,0x74EB,0x74EC,0x74ED,0x74F0,0x74F1,/* 0x98-0x9F */
        0x74F2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AE[256] = {
@@ -1656,17 +1604,6 @@ static wchar_t c2u_AE[256] = {
        0xF962,0x7571,0x7573,0x7575,0x7576,0x7577,0x757A,0x757B,/* 0x90-0x97 */
        0x757C,0x757D,0x757E,0x7580,0x7581,0x7582,0x7584,0x7585,/* 0x98-0x9F */
        0x7587,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AF[256] = {
@@ -1692,17 +1629,6 @@ static wchar_t c2u_AF[256] = {
        0x7623,0x7627,0x7628,0x762C,0x762E,0x762F,0x7631,0x7632,/* 0x90-0x97 */
        0x7636,0x7637,0x7639,0x763A,0x763B,0x763D,0x7641,0xF9C1,/* 0x98-0x9F */
        0x7644,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_B0[256] = {
@@ -4356,17 +4282,6 @@ static wchar_t c2u_F9[256] = {
        0x9D92,0x9D93,0x9D94,0x9D95,0x9D96,0x9D97,0x9D98,0x9D99,/* 0x90-0x97 */
        0x9D9A,0x9D9B,0x9D9C,0x9D9D,0x9D9E,0x9D9F,0x9DA0,0x9DA1,/* 0x98-0x9F */
        0x9DA2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_FA[256] = {
@@ -4392,17 +4307,6 @@ static wchar_t c2u_FA[256] = {
        0x9DF2,0x9DF3,0x9DF4,0x9DF5,0x9DF6,0x9DF7,0x9DF8,0x9DF9,/* 0x90-0x97 */
        0xF93A,0x9DFB,0x9DFC,0x9DFD,0x9DFE,0x9DFF,0x9E00,0x9E01,/* 0x98-0x9F */
        0x9E02,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_FB[256] = {
@@ -4428,17 +4332,6 @@ static wchar_t c2u_FB[256] = {
        0xF988,0x9E98,0x9E99,0x9E9A,0x9E9B,0x9E9C,0x9E9E,0x9EA0,/* 0x90-0x97 */
        0x9EA1,0x9EA2,0x9EA3,0x9EA4,0x9EA5,0x9EA7,0x9EA8,0x9EA9,/* 0x98-0x9F */
        0x9EAA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_FC[256] = {
@@ -4464,17 +4357,6 @@ static wchar_t c2u_FC[256] = {
        0x9F1D,0x9F1E,0x9F1F,0x9F21,0x9F23,0x9F24,0x9F25,0x9F26,/* 0x90-0x97 */
        0x9F27,0x9F28,0x9F29,0x9F2A,0x9F2B,0x9F2D,0x9F2E,0x9F30,/* 0x98-0x9F */
        0x9F31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_FD[256] = {
@@ -4500,17 +4382,6 @@ static wchar_t c2u_FD[256] = {
        0x9F95,0x9F96,0x9F97,0x9F98,0xF908,0x9F9D,0x9F9E,0x9FA1,/* 0x90-0x97 */
        0x9FA2,0x9FA3,0x9FA4,0x9FA5,0xF92C,0xF979,0xF995,0xF9E7,/* 0x98-0x9F */
        0xF9F1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_FE[256] = {
@@ -4524,29 +4395,6 @@ static wchar_t c2u_FE[256] = {
        0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x38-0x3F */
        0xFA0C,0xFA0D,0xFA0E,0xFA0F,0xFA11,0xFA13,0xFA14,0xFA18,/* 0x40-0x47 */
        0xFA1F,0xFA20,0xFA21,0xFA23,0xFA24,0xFA27,0xFA28,0xFA29,/* 0x48-0x4F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x50-0x57 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x58-0x5F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x60-0x67 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x68-0x6F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x70-0x77 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x78-0x7F */
-       
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x80-0x87 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x88-0x8F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x90-0x97 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x98-0x9F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t *page_charset2uni[256] = {
@@ -4642,14 +4490,6 @@ static unsigned char u2c_01[512] = {
        0xA8, 0xB3, 0xA8, 0xB5, 0xA8, 0xB5, 0xA8, 0xB6, /* 0xD4-0xD7 */
        0xA8, 0xB6, 0xA8, 0xB7, 0xA8, 0xB7, 0xA8, 0xB8, /* 0xD8-0xDB */
        0xA8, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_02[512] = {
@@ -4709,15 +4549,6 @@ static unsigned char u2c_02[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
        0x00, 0x00, 0xA8, 0x42, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_03[512] = {
@@ -4773,19 +4604,6 @@ static unsigned char u2c_03[512] = {
        0xA6, 0xD0, 0xA6, 0xD1, 0x00, 0x00, 0xA6, 0xD2, /* 0xC0-0xC3 */
        0xA6, 0xD3, 0xA6, 0xD4, 0xA6, 0xD5, 0xA6, 0xD6, /* 0xC4-0xC7 */
        0xA6, 0xD7, 0xA6, 0xD8, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_04[512] = {
@@ -4810,50 +4628,6 @@ static unsigned char u2c_04[512] = {
        0xA7, 0xEA, 0xA7, 0xEB, 0xA7, 0xEC, 0xA7, 0xED, /* 0x48-0x4B */
        0xA7, 0xEE, 0xA7, 0xEF, 0xA7, 0xF0, 0xA7, 0xF1, /* 0x4C-0x4F */
        0x00, 0x00, 0xA7, 0xD7, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_20[512] = {
@@ -4873,55 +4647,6 @@ static unsigned char u2c_20[512] = {
        0x00, 0x00, 0xA8, 0x46, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xF9, /* 0x38-0x3B */
        0x00, 0x00, 0x00, 0x00, 0xA3, 0xFE, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_21[512] = {
@@ -4965,31 +4690,6 @@ static unsigned char u2c_21[512] = {
        0xA1, 0xFB, 0xA1, 0xFC, 0xA1, 0xFA, 0xA1, 0xFD, /* 0x90-0x93 */
        0x00, 0x00, 0x00, 0x00, 0xA8, 0x49, 0xA8, 0x4A, /* 0x94-0x97 */
        0xA8, 0x4B, 0xA8, 0x4C, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_22[512] = {
@@ -5042,22 +4742,6 @@ static unsigned char u2c_22[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA8, 0x53, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_23[512] = {
@@ -5066,66 +4750,6 @@ static unsigned char u2c_23[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
        0x00, 0x00, 0x00, 0x00, 0xA1, 0xD0, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_24[512] = {
@@ -5169,31 +4793,6 @@ static unsigned char u2c_24[512] = {
        0xA2, 0xB9, 0xA2, 0xBA, 0xA2, 0xBB, 0xA2, 0xBC, /* 0x90-0x93 */
        0xA2, 0xBD, 0xA2, 0xBE, 0xA2, 0xBF, 0xA2, 0xC0, /* 0x94-0x97 */
        0xA2, 0xC1, 0xA2, 0xC2, 0xA2, 0xC3, 0xA2, 0xC4, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_25[512] = {
@@ -5238,92 +4837,24 @@ static unsigned char u2c_25[512] = {
        0xA8, 0x89, 0xA8, 0x8A, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0xA1, 0xF6, 0xA1, 0xF5, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF8, 0xA1, 0xF7, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0xA8, 0x8B, 0xA8, 0x8C, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF4, 0xA1, 0xF3, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xF0, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF2, 0xA1, 0xF1, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0xA8, 0x8D, 0xA8, 0x8E, /* 0xE0-0xE3 */
-       0xA8, 0x8F, 0xA8, 0x90, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
-};
-
-static unsigned char u2c_26[512] = {
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
-       0x00, 0x00, 0xA1, 0xEF, 0xA1, 0xEE, 0x00, 0x00, /* 0x04-0x07 */
-       0x00, 0x00, 0xA8, 0x91, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0xA1, 0xE2, 0x00, 0x00, 0xA1, 0xE1, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
+       0xA1, 0xF6, 0xA1, 0xF5, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
+       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF8, 0xA1, 0xF7, /* 0xB0-0xB3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
+       0xA8, 0x8B, 0xA8, 0x8C, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
+       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF4, 0xA1, 0xF3, /* 0xC4-0xC7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xF0, /* 0xC8-0xCB */
+       0x00, 0x00, 0x00, 0x00, 0xA1, 0xF2, 0xA1, 0xF1, /* 0xCC-0xCF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
+       0x00, 0x00, 0x00, 0x00, 0xA8, 0x8D, 0xA8, 0x8E, /* 0xE0-0xE3 */
+       0xA8, 0x8F, 0xA8, 0x90, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
@@ -5332,6 +4863,26 @@ static unsigned char u2c_26[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
+static unsigned char u2c_26[512] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
+       0x00, 0x00, 0xA1, 0xEF, 0xA1, 0xEE, 0x00, 0x00, /* 0x04-0x07 */
+       0x00, 0x00, 0xA8, 0x91, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
+       0xA1, 0xE2, 0x00, 0x00, 0xA1, 0xE1, 0x00, 0x00, /* 0x40-0x43 */
+};
+
 static unsigned char u2c_30[512] = {
        0xA1, 0xA1, 0xA1, 0xA2, 0xA1, 0xA3, 0xA1, 0xA8, /* 0x00-0x03 */
        0x00, 0x00, 0xA1, 0xA9, 0xA9, 0x65, 0xA9, 0x96, /* 0x04-0x07 */
@@ -5442,30 +4993,6 @@ static unsigned char u2c_31[512] = {
        0xC8, 0xFD, 0xCB, 0xC4, 0xC9, 0xCF, 0xD6, 0xD0, /* 0x94-0x97 */
        0xCF, 0xC2, 0xBC, 0xD7, 0xD2, 0xD2, 0xB1, 0xFB, /* 0x98-0x9B */
        0xB6, 0xA1, 0xCC, 0xEC, 0xB5, 0xD8, 0xC8, 0xCB, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_32[512] = {
@@ -5515,25 +5042,6 @@ static unsigned char u2c_32[512] = {
        0x00, 0x00, 0xD2, 0xBD, 0xD7, 0xDA, 0xD1, 0xA7, /* 0xA8-0xAB */
        0xBC, 0xE0, 0xC6, 0xF3, 0xD7, 0xCA, 0xD0, 0xAD, /* 0xAC-0xAF */
        0xD2, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_33[512] = {
@@ -5592,16 +5100,6 @@ static unsigned char u2c_33[512] = {
        0x00, 0x00, 0x00, 0x00, 0xA9, 0x51, 0x00, 0x00, /* 0xCC-0xCF */
        0x00, 0x00, 0xA9, 0x52, 0xA9, 0x53, 0x00, 0x00, /* 0xD0-0xD3 */
        0x00, 0x00, 0xA9, 0x54, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_4E[512] = {
@@ -11156,96 +10654,10 @@ static unsigned char u2c_9F[512] = {
        0xFD, 0x94, 0xFD, 0x95, 0xFD, 0x96, 0xB9, 0xEA, /* 0x9C-0x9F */
        0xD9, 0xDF, 0xFD, 0x97, 0xFD, 0x98, 0xFD, 0x99, /* 0xA0-0xA3 */
        0xFD, 0x9A, 0xFD, 0x9B, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_DC[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_F9[512] = {
@@ -11329,59 +10741,6 @@ static unsigned char u2c_FA[512] = {
        0xFE, 0x4C, 0xD2, 0xDD, 0xB6, 0xBC, 0xFE, 0x4D, /* 0x24-0x27 */
        0xFE, 0x4E, 0xFE, 0x4F, 0xEF, 0x88, 0xEF, 0x95, /* 0x28-0x2B */
        0xF0, 0x5E, 0xFA, 0x51, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FE[512] = {
@@ -11412,44 +10771,6 @@ static unsigned char u2c_FE[512] = {
        0xA9, 0x7D, 0xA9, 0x7E, 0xA9, 0x80, 0xA9, 0x81, /* 0x60-0x63 */
        0xA9, 0x82, 0xA9, 0x83, 0xA9, 0x84, 0x00, 0x00, /* 0x64-0x67 */
        0xA9, 0x85, 0xA9, 0x86, 0xA9, 0x87, 0xA9, 0x88, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FF[512] = {
@@ -11512,12 +10833,6 @@ static unsigned char u2c_FF[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0xA1, 0xE9, 0xA1, 0xEA, 0xA9, 0x56, 0xA3, 0xFE, /* 0xE0-0xE3 */
        0xA9, 0x57, 0xA3, 0xA4, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char *page_uni2charset[256] = {
index bb623ce6897c54a2e36383deb69a0c525514b528..a1a869d0e869638343514115cc7e3f4ad986e387 100644 (file)
@@ -1232,9 +1232,6 @@ static wchar_t c2u_A2[256] = {
        0x261C,0x261E,0x00B6,0x2020,0x2021,0x2195,0x2197,0x2199,/* 0xD0-0xD7 */
        0x2196,0x2198,0x266D,0x2669,0x266A,0x266C,0x327F,0x321C,/* 0xD8-0xDF */
        0x2116,0x33C7,0x2122,0x33C2,0x33D8,0x2121,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A3[256] = {
@@ -1376,9 +1373,6 @@ static wchar_t c2u_A6[256] = {
        0x252A,0x252D,0x252E,0x2531,0x2532,0x2535,0x2536,0x2539,/* 0xD0-0xD7 */
        0x253A,0x253D,0x253E,0x2540,0x2541,0x2543,0x2544,0x2545,/* 0xD8-0xDF */
        0x2546,0x2547,0x2548,0x2549,0x254A,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A7[256] = {
@@ -1413,8 +1407,6 @@ static wchar_t c2u_A7[256] = {
        0x3394,0x2126,0x33C0,0x33C1,0x338A,0x338B,0x338C,0x33D6,/* 0xD8-0xDF */
        0x33C5,0x33AD,0x33AE,0x33AF,0x33DB,0x33A9,0x33AA,0x33AB,/* 0xE0-0xE7 */
        0x33AC,0x33DD,0x33D0,0x33D3,0x33C3,0x33C9,0x33DC,0x33C6,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_A8[256] = {
@@ -1522,7 +1514,6 @@ static wchar_t c2u_AA[256] = {
        0x3080,0x3081,0x3082,0x3083,0x3084,0x3085,0x3086,0x3087,/* 0xE0-0xE7 */
        0x3088,0x3089,0x308A,0x308B,0x308C,0x308D,0x308E,0x308F,/* 0xE8-0xEF */
        0x3090,0x3091,0x3092,0x3093,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AB[256] = {
@@ -1558,7 +1549,6 @@ static wchar_t c2u_AB[256] = {
        0x30E0,0x30E1,0x30E2,0x30E3,0x30E4,0x30E5,0x30E6,0x30E7,/* 0xE0-0xE7 */
        0x30E8,0x30E9,0x30EA,0x30EB,0x30EC,0x30ED,0x30EE,0x30EF,/* 0xE8-0xEF */
        0x30F0,0x30F1,0x30F2,0x30F3,0x30F4,0x30F5,0x30F6,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AC[256] = {
@@ -1594,7 +1584,6 @@ static wchar_t c2u_AC[256] = {
        0x043E,0x043F,0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,/* 0xE0-0xE7 */
        0x0446,0x0447,0x0448,0x0449,0x044A,0x044B,0x044C,0x044D,/* 0xE8-0xEF */
        0x044E,0x044F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AD[256] = {
@@ -1620,17 +1609,6 @@ static wchar_t c2u_AD[256] = {
        0xCDB4,0xCDB5,0xCDB6,0xCDB7,0xCDB8,0xCDB9,0xCDBA,0xCDBB,/* 0x90-0x97 */
        0xCDBC,0xCDBD,0xCDBE,0xCDBF,0xCDC0,0xCDC1,0xCDC2,0xCDC3,/* 0x98-0x9F */
        0xCDC5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AE[256] = {
@@ -1656,17 +1634,6 @@ static wchar_t c2u_AE[256] = {
        0xCE16,0xCE17,0xCE18,0xCE1A,0xCE1B,0xCE1C,0xCE1D,0xCE1E,/* 0x90-0x97 */
        0xCE1F,0xCE22,0xCE23,0xCE25,0xCE26,0xCE27,0xCE29,0xCE2A,/* 0x98-0x9F */
        0xCE2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_AF[256] = {
@@ -1692,17 +1659,6 @@ static wchar_t c2u_AF[256] = {
        0xCE81,0xCE82,0xCE83,0xCE86,0xCE88,0xCE8A,0xCE8B,0xCE8C,/* 0x90-0x97 */
        0xCE8D,0xCE8E,0xCE8F,0xCE92,0xCE93,0xCE95,0xCE96,0xCE97,/* 0x98-0x9F */
        0xCE99,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_B0[256] = {
@@ -4539,45 +4495,6 @@ static unsigned char u2c_01[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
        0x00, 0x00, 0x00, 0x00, 0xA8, 0xAE, 0xA9, 0xAE, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_02[512] = {
@@ -4638,14 +4555,6 @@ static unsigned char u2c_02[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
        0xA2, 0xA8, 0xA2, 0xAB, 0xA2, 0xAA, 0xA2, 0xAD, /* 0xD8-0xDB */
        0x00, 0x00, 0xA2, 0xA9, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_03[512] = {
@@ -4701,19 +4610,6 @@ static unsigned char u2c_03[512] = {
        0xA5, 0xF0, 0xA5, 0xF1, 0x00, 0x00, 0xA5, 0xF2, /* 0xC0-0xC3 */
        0xA5, 0xF3, 0xA5, 0xF4, 0xA5, 0xF5, 0xA5, 0xF6, /* 0xC4-0xC7 */
        0xA5, 0xF7, 0xA5, 0xF8, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_04[512] = {
@@ -4738,50 +4634,6 @@ static unsigned char u2c_04[512] = {
        0xAC, 0xEA, 0xAC, 0xEB, 0xAC, 0xEC, 0xAC, 0xED, /* 0x48-0x4B */
        0xAC, 0xEE, 0xAC, 0xEF, 0xAC, 0xF0, 0xAC, 0xF1, /* 0x4C-0x4F */
        0x00, 0x00, 0xAC, 0xD7, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_11[512] = {
@@ -4849,7 +4701,6 @@ static unsigned char u2c_11[512] = {
        0xA4, 0xB7, 0xA4, 0xF2, 0xA4, 0xF3, 0x00, 0x00, /* 0xF0-0xF3 */
        0xA4, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xA4, 0xF6, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_20[512] = {
@@ -4897,27 +4748,6 @@ static unsigned char u2c_20[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
        0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_21[512] = {
@@ -4976,16 +4806,6 @@ static unsigned char u2c_21[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
        0x00, 0x00, 0x00, 0x00, 0xA2, 0xA1, 0x00, 0x00, /* 0xD0-0xD3 */
        0xA2, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_22[512] = {
@@ -5032,28 +4852,6 @@ static unsigned char u2c_22[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
        0x00, 0x00, 0xA1, 0xD1, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_23[512] = {
@@ -5062,66 +4860,6 @@ static unsigned char u2c_23[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
        0x00, 0x00, 0x00, 0x00, 0xA1, 0xD2, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_24[512] = {
@@ -5185,11 +4923,6 @@ static unsigned char u2c_24[512] = {
        0xA8, 0xDD, 0xA8, 0xDE, 0xA8, 0xDF, 0xA8, 0xE0, /* 0xE0-0xE3 */
        0xA8, 0xE1, 0xA8, 0xE2, 0xA8, 0xE3, 0xA8, 0xE4, /* 0xE4-0xE7 */
        0xA8, 0xE5, 0xA8, 0xE6, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_25[512] = {
@@ -5247,17 +4980,6 @@ static unsigned char u2c_25[512] = {
        0xA2, 0xC2, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xDB, /* 0xC8-0xCB */
        0x00, 0x00, 0x00, 0x00, 0xA1, 0xDD, 0xA1, 0xDC, /* 0xCC-0xCF */
        0xA2, 0xC4, 0xA2, 0xC5, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_26[512] = {
@@ -5289,43 +5011,6 @@ static unsigned char u2c_26[512] = {
        0xA2, 0xBB, 0xA2, 0xBE, 0x00, 0x00, 0xA2, 0xBF, /* 0x64-0x67 */
        0xA2, 0xCD, 0xA2, 0xDB, 0xA2, 0xDC, 0x00, 0x00, /* 0x68-0x6B */
        0xA2, 0xDD, 0xA2, 0xDA, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_30[512] = {
@@ -5392,8 +5077,6 @@ static unsigned char u2c_30[512] = {
        0xAB, 0xEC, 0xAB, 0xED, 0xAB, 0xEE, 0xAB, 0xEF, /* 0xEC-0xEF */
        0xAB, 0xF0, 0xAB, 0xF1, 0xAB, 0xF2, 0xAB, 0xF3, /* 0xF0-0xF3 */
        0xAB, 0xF4, 0xAB, 0xF5, 0xAB, 0xF6, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_31[512] = {
@@ -5438,30 +5121,6 @@ static unsigned char u2c_31[512] = {
        0xDF, 0xB2, 0xDE, 0xCC, 0xDF, 0xBE, 0xF1, 0xE9, /* 0x94-0x97 */
        0xF9, 0xBB, 0xCB, 0xA3, 0xEB, 0xE0, 0xDC, 0xB0, /* 0x98-0x9B */
        0xEF, 0xCB, 0xF4, 0xB8, 0xF2, 0xA2, 0xEC, 0xD1, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_32[512] = {
@@ -5511,25 +5170,6 @@ static unsigned char u2c_32[512] = {
        0xE9, 0xD3, 0xEC, 0xA2, 0xF0, 0xF3, 0xF9, 0xCA, /* 0xA8-0xAB */
        0xCA, 0xF8, 0xD0, 0xEA, 0xED, 0xC0, 0xFA, 0xF0, /* 0xAC-0xAF */
        0xE5, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_33[512] = {
@@ -5590,14 +5230,6 @@ static unsigned char u2c_33[512] = {
        0x00, 0x00, 0x00, 0x00, 0xA7, 0xDF, 0x00, 0x00, /* 0xD4-0xD7 */
        0xA2, 0xE4, 0x00, 0x00, 0x00, 0x00, 0xA7, 0xE4, /* 0xD8-0xDB */
        0xA7, 0xEE, 0xA7, 0xE9, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_4E[512] = {
@@ -5665,7 +5297,6 @@ static unsigned char u2c_4E[512] = {
        0xE4, 0xE6, 0x00, 0x00, 0xF1, 0xEA, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xCB, 0xEC, 0xCB, 0xC0, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xF2, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_4F[512] = {
@@ -5733,7 +5364,6 @@ static unsigned char u2c_4F[512] = {
        0x00, 0x00, 0xCE, 0xFC, 0x00, 0x00, 0xDB, 0xC4, /* 0xF0-0xF3 */
        0x00, 0x00, 0xF8, 0xF1, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xDC, 0xE4, 0x00, 0x00, 0xE5, 0xEF, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_50[512] = {
@@ -6005,7 +5635,6 @@ static unsigned char u2c_53[512] = {
        0xF7, 0xBB, 0xF2, 0xEA, 0xDE, 0xC8, 0xE9, 0xD3, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xDE, 0xC9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_54[512] = {
@@ -6073,7 +5702,6 @@ static unsigned char u2c_54[512] = {
        0x00, 0x00, 0x00, 0x00, 0xF4, 0xC9, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0xF8, 0xD4, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_55[512] = {
@@ -6209,7 +5837,6 @@ static unsigned char u2c_56[512] = {
        0xCD, 0xDD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xD6, 0xB7, 0xCD, 0xB3, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_57[512] = {
@@ -6477,11 +6104,6 @@ static unsigned char u2c_5A[512] = {
        0x00, 0x00, 0xEE, 0xD5, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
        0x00, 0x00, 0x00, 0x00, 0xF9, 0xF4, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0xD2, 0xEC, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_5B[512] = {
@@ -6549,7 +6171,6 @@ static unsigned char u2c_5B[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0xF5, 0xC1, 0xDC, 0xC4, 0x00, 0x00, /* 0xF4-0xF7 */
        0xF5, 0xBB, 0x00, 0x00, 0xDE, 0xD1, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_5C[512] = {
@@ -6753,7 +6374,6 @@ static unsigned char u2c_5E[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xE6, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xE6, 0xC5, 0xEF, 0xD5, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0xCB, 0xEF, 0xFC, 0xDF, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_5F[512] = {
@@ -6889,7 +6509,6 @@ static unsigned char u2c_60[512] = {
        0xF6, 0xE7, 0xD2, 0xDD, 0x00, 0x00, 0xDF, 0xCC, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xFC, 0xC9, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xE5, 0xA9, 0xE0, 0xF6, 0xF6, 0xB3, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_61[512] = {
@@ -7092,8 +6711,6 @@ static unsigned char u2c_63[512] = {
        0x00, 0x00, 0xCC, 0xA9, 0xFD, 0xC6, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xEA, 0xB5, 0x00, 0x00, 0xE5, 0xAA, 0xDF, 0xBA, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_64[512] = {
@@ -7433,7 +7050,6 @@ static unsigned char u2c_68[512] = {
        0x00, 0x00, 0x00, 0x00, 0xDF, 0xF8, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xD4, 0xA1, 0xCE, 0xB2, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_69[512] = {
@@ -7569,7 +7185,6 @@ static unsigned char u2c_6A[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xFA, 0xCB, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE5, 0xA1, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6B[512] = {
@@ -7634,10 +7249,6 @@ static unsigned char u2c_6B[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFB, 0xC6, /* 0xE8-0xEB */
        0xCF, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6C[512] = {
@@ -7703,9 +7314,6 @@ static unsigned char u2c_6C[512] = {
        0xF1, 0xBC, 0x00, 0x00, 0x00, 0x00, 0xFA, 0xDA, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0xDA, 0xEA, 0xDA, 0xC6, /* 0xEC-0xEF */
        0xF7, 0xC1, 0x00, 0x00, 0x00, 0x00, 0xE7, 0xB6, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6D[512] = {
@@ -7773,7 +7381,6 @@ static unsigned char u2c_6D[512] = {
        0x00, 0x00, 0xE4, 0xA2, 0x00, 0x00, 0xE2, 0xE8, /* 0xF0-0xF3 */
        0x00, 0x00, 0xE6, 0xD0, 0x00, 0x00, 0xFB, 0xE8, /* 0xF4-0xF7 */
        0xF4, 0xE8, 0xE5, 0xF4, 0xF4, 0xBC, 0xF4, 0xD5, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6E[512] = {
@@ -8248,8 +7855,6 @@ static unsigned char u2c_74[512] = {
        0x00, 0x00, 0x00, 0x00, 0xE8, 0xB7, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xED, 0xB6, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_75[512] = {
@@ -8451,9 +8056,6 @@ static unsigned char u2c_77[512] = {
        0x00, 0x00, 0xCF, 0xBB, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0xD3, 0xAD, 0xE8, 0xE1, 0xCE, 0xEC, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xB4, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_78[512] = {
@@ -8521,7 +8123,6 @@ static unsigned char u2c_78[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0xCA, 0xD8, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDA, 0xF2, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_79[512] = {
@@ -8589,7 +8190,6 @@ static unsigned char u2c_79[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xB9, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7A[512] = {
@@ -8721,11 +8321,6 @@ static unsigned char u2c_7B[512] = {
        0xE1, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
        0xD4, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0xDE, 0xE8, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7C[512] = {
@@ -8861,7 +8456,6 @@ static unsigned char u2c_7D[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xD6, 0xA3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF6, 0xC6, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7E[512] = {
@@ -8890,46 +8484,22 @@ static unsigned char u2c_7E[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
        0x00, 0x00, 0x00, 0x00, 0xE9, 0xA4, 0x00, 0x00, /* 0x5C-0x5F */
        0x00, 0x00, 0xE2, 0xB9, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0xE3, 0xB1, 0xFC, 0xEB, 0xCD, 0xA8, /* 0x68-0x6B */
-       0x00, 0x00, 0xCC, 0xB6, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0xF0, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0xE6, 0xBA, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0xCD, 0xA9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0xF3, 0xC3, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0xE1, 0xD9, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xAB, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE7, 0xC5, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0xE0, 0xE9, 0x00, 0x00, /* 0x94-0x97 */
-       0xF3, 0xC5, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xC0, /* 0x98-0x9B */
-       0xD5, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
+       0x00, 0x00, 0xE3, 0xB1, 0xFC, 0xEB, 0xCD, 0xA8, /* 0x68-0x6B */
+       0x00, 0x00, 0xCC, 0xB6, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
+       0xF0, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
+       0x00, 0x00, 0xE6, 0xBA, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
+       0xCD, 0xA9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
+       
+       0x00, 0x00, 0x00, 0x00, 0xF3, 0xC3, 0x00, 0x00, /* 0x80-0x83 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
+       0xE1, 0xD9, 0x00, 0x00, 0x00, 0x00, 0xEF, 0xAB, /* 0x8C-0x8F */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE7, 0xC5, /* 0x90-0x93 */
+       0x00, 0x00, 0x00, 0x00, 0xE0, 0xE9, 0x00, 0x00, /* 0x94-0x97 */
+       0xF3, 0xC5, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xC0, /* 0x98-0x9B */
+       0xD5, 0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
 };
 
 static unsigned char u2c_7F[512] = {
@@ -9677,7 +9247,6 @@ static unsigned char u2c_89[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xDF, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xF5, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8A[512] = {
@@ -9789,31 +9358,6 @@ static unsigned char u2c_8B[512] = {
        0xE2, 0xC2, 0x00, 0x00, 0xF3, 0xD8, 0xE5, 0xD3, /* 0x90-0x93 */
        0x00, 0x00, 0x00, 0x00, 0xF3, 0xD9, 0x00, 0x00, /* 0x94-0x97 */
        0x00, 0x00, 0x00, 0x00, 0xF3, 0xC6, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8C[512] = {
@@ -9947,9 +9491,6 @@ static unsigned char u2c_8D[512] = {
        0xCE, 0xA5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD6, 0xD8, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xAF, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8E[512] = {
@@ -10220,8 +9761,6 @@ static unsigned char u2c_91[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0xF3, 0xFB, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_92[512] = {
@@ -10356,8 +9895,6 @@ static unsigned char u2c_93[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xF3, 0xA1, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_94[512] = {
@@ -10393,39 +9930,6 @@ static unsigned char u2c_94[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
        0x00, 0x00, 0xF3, 0xC8, 0x00, 0x00, 0xF3, 0xBA, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_95[512] = {
@@ -10487,13 +9991,6 @@ static unsigned char u2c_95[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
        0xCE, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0x00, 0x00, 0xF4, 0xC5, 0xDC, 0xA3, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_96[512] = {
@@ -10561,7 +10058,6 @@ static unsigned char u2c_96[512] = {
        0xDD, 0xD4, 0x00, 0x00, 0xEA, 0xA3, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0xD6, 0xC3, 0xD6, 0xF4, /* 0xF4-0xF7 */
        0x00, 0x00, 0xDA, 0xDF, 0x00, 0x00, 0xEF, 0xB3, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_97[512] = {
@@ -10830,10 +10326,6 @@ static unsigned char u2c_9A[512] = {
        0x00, 0x00, 0xE7, 0xA3, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
        0x00, 0x00, 0x00, 0x00, 0xDB, 0xA5, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9B[512] = {
@@ -10897,11 +10389,6 @@ static unsigned char u2c_9B[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
        0xCD, 0xE6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
        0xCC, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9C[512] = {
@@ -10968,8 +10455,6 @@ static unsigned char u2c_9C[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0xF3, /* 0xF0-0xF3 */
        0xD9, 0xB0, 0x00, 0x00, 0xE6, 0xE9, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9D[512] = {
@@ -11037,7 +10522,6 @@ static unsigned char u2c_9D[512] = {
        0x00, 0x00, 0x00, 0x00, 0xF6, 0xAF, 0x00, 0x00, /* 0xF0-0xF3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0xFD, 0xD3, 0xEB, 0xED, 0xD6, 0xDC, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9E[512] = {
@@ -11104,8 +10588,6 @@ static unsigned char u2c_9E[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
        0xDA, 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_9F[512] = {
@@ -11150,30 +10632,6 @@ static unsigned char u2c_9F[512] = {
        0x00, 0x00, 0xCA, 0xFE, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
        0xCF, 0xCF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_AC[512] = {
@@ -14143,97 +13601,10 @@ static unsigned char u2c_D7[512] = {
        0xC8, 0xFB, 0xC8, 0xFC, 0xC6, 0x4B, 0xC8, 0xFD, /* 0x98-0x9B */
        0xC6, 0x4C, 0xC8, 0xFE, 0xC6, 0x4D, 0xC6, 0x4E, /* 0x9C-0x9F */
        0xC6, 0x4F, 0xC6, 0x50, 0xC6, 0x51, 0xC6, 0x52, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_DC[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_F9[512] = {
@@ -14317,59 +13688,6 @@ static unsigned char u2c_FA[512] = {
        0x00, 0x00, 0xEC, 0xEF, 0xD4, 0xB4, 0x00, 0x00, /* 0x24-0x27 */
        0x00, 0x00, 0x00, 0x00, 0xDA, 0xF9, 0xDE, 0xF8, /* 0x28-0x2B */
        0xCE, 0xBD, 0xF9, 0xCD, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FF[512] = {
@@ -14432,12 +13750,6 @@ static unsigned char u2c_FF[512] = {
        0xA4, 0xD3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0xA1, 0xCB, 0xA1, 0xCC, 0xA1, 0xFE, 0xA3, 0xFE, /* 0xE0-0xE3 */
        0x00, 0x00, 0xA1, 0xCD, 0xA3, 0xDC, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 26bcd8b30c906e03650c49f2ae314b7e2f48ad47..5d8cecc0e505cca4fcec4e70ac98a9d741c9f1cc 100644 (file)
@@ -1362,23 +1362,6 @@ static wchar_t c2u_C6[256] = {
        0x9477,0x97C9,0x9A62,0x9A65,0x7E9C,0x8B9C,0x8EAA,0x91C5,/* 0x68-0x6F */
        0x947D,0x947E,0x947C,0x9C77,0x9C78,0x9EF7,0x8C54,0x947F,/* 0x70-0x77 */
        0x9E1A,0x7228,0xF987,0x9B31,0x9E1B,0xF920,0x7C72,0x0000,/* 0x78-0x7F */
-       
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x80-0x87 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x88-0x8F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x90-0x97 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0x98-0x9F */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA0-0xA7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xA8-0xAF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB0-0xB7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xB8-0xBF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC0-0xC7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xC8-0xCF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD0-0xD7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xD8-0xDF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE0-0xE7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xE8-0xEF */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF0-0xF7 */
-       0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,/* 0xF8-0xFF */
 };
 
 static wchar_t c2u_C9[256] = {
@@ -3237,15 +3220,6 @@ static unsigned char u2c_02[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
        0x00, 0x00, 0xA3, 0xBB, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_03[512] = {
@@ -3301,19 +3275,6 @@ static unsigned char u2c_03[512] = {
        0xA3, 0x6B, 0xA3, 0x6C, 0x00, 0x00, 0xA3, 0x6D, /* 0xC0-0xC3 */
        0xA3, 0x6E, 0xA3, 0x6F, 0xA3, 0x70, 0xA3, 0x71, /* 0xC4-0xC7 */
        0xA3, 0x72, 0xA3, 0x73, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_20[512] = {
@@ -3333,55 +3294,6 @@ static unsigned char u2c_20[512] = {
        0x00, 0x00, 0xA1, 0xAB, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xB0, /* 0x38-0x3B */
        0x00, 0x00, 0x00, 0x00, 0xA1, 0xC3, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_21[512] = {
@@ -3425,31 +3337,6 @@ static unsigned char u2c_21[512] = {
        0xA1, 0xF6, 0xA1, 0xF4, 0xA1, 0xF7, 0xA1, 0xF5, /* 0x90-0x93 */
        0x00, 0x00, 0x00, 0x00, 0xA1, 0xF8, 0xA1, 0xF9, /* 0x94-0x97 */
        0xA1, 0xFB, 0xA1, 0xFA, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_22[512] = {
@@ -3502,90 +3389,11 @@ static unsigned char u2c_22[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xE9, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_23[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x5B, /* 0x04-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_25[512] = {
@@ -3648,12 +3456,6 @@ static unsigned char u2c_25[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0x00, 0x00, 0x00, 0x00, 0xA2, 0xA8, 0xA2, 0xA9, /* 0xE0-0xE3 */
        0xA2, 0xAB, 0xA2, 0xAA, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_26[512] = {
@@ -3674,54 +3476,6 @@ static unsigned char u2c_26[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
        0xA1, 0xF0, 0xA1, 0xF2, 0xA1, 0xF1, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_30[512] = {
@@ -3738,58 +3492,6 @@ static unsigned char u2c_30[512] = {
        0xA2, 0xCA, 0xA2, 0xCB, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
        0xA1, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_31[512] = {
@@ -3834,30 +3536,6 @@ static unsigned char u2c_31[512] = {
        0xA4, 0x54, 0xA5, 0x7C, 0xA4, 0x57, 0xA4, 0xA4, /* 0x94-0x97 */
        0xA4, 0x55, 0xA5, 0xD2, 0xA4, 0x41, 0xA4, 0xFE, /* 0x98-0x9B */
        0xA4, 0x42, 0xA4, 0xD1, 0xA6, 0x61, 0xA4, 0x48, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_32[512] = {
@@ -3907,25 +3585,6 @@ static unsigned char u2c_32[512] = {
        0xA5, 0x6B, 0xC2, 0xE5, 0xA9, 0x76, 0xBE, 0xC7, /* 0xA8-0xAB */
        0xBA, 0xCA, 0xA5, 0xF8, 0xB8, 0xEA, 0xA8, 0xF3, /* 0xAC-0xAF */
        0xA9, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_33[512] = {
@@ -3984,16 +3643,6 @@ static unsigned char u2c_33[512] = {
        0x00, 0x00, 0x00, 0x00, 0xA2, 0x53, 0x00, 0x00, /* 0xCC-0xCF */
        0x00, 0x00, 0xA1, 0xEB, 0xA1, 0xEA, 0x00, 0x00, /* 0xD0-0xD3 */
        0x00, 0x00, 0xA2, 0x4F, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_4E[512] = {
@@ -6101,7 +5750,6 @@ static unsigned char u2c_6C[512] = {
        0xAE, 0xF5, 0xAA, 0x74, 0xCC, 0xFE, 0xAA, 0x61, /* 0xF0-0xF3 */
        0x00, 0x00, 0xAC, 0xA6, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
        0x00, 0x00, 0xCD, 0x4C, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_6D[512] = {
@@ -7257,7 +6905,6 @@ static unsigned char u2c_7D[512] = {
        0xE6, 0xEE, 0xE6, 0xED, 0xBD, 0x7A, 0xE5, 0x72, /* 0xF0-0xF3 */
        0xBD, 0x6D, 0x00, 0x00, 0xE6, 0xEC, 0xE6, 0xE3, /* 0xF4-0xF7 */
        0x00, 0x00, 0xBD, 0x7B, 0xE6, 0xEA, 0xBD, 0x6F, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_7E[512] = {
@@ -7282,50 +6929,26 @@ static unsigned char u2c_7E[512] = {
        0xC1, 0x66, 0xED, 0xD7, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
        0xED, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
        0xF0, 0x6E, 0xF0, 0x74, 0xC2, 0xB9, 0xF0, 0x77, /* 0x50-0x53 */
-       0xC2, 0xB4, 0xC2, 0xB5, 0xF0, 0x6F, 0xF0, 0x76, /* 0x54-0x57 */
-       0xF0, 0x71, 0xC2, 0xBA, 0xC2, 0xB7, 0x00, 0x00, /* 0x58-0x5B */
-       0xF0, 0x6D, 0x00, 0x00, 0xC2, 0xB6, 0xF0, 0x73, /* 0x5C-0x5F */
-       0xF0, 0x75, 0xC2, 0xB8, 0xF0, 0x72, 0xF0, 0x70, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0xF2, 0xB8, 0xC3, 0xB7, 0xC3, 0xB8, 0xC3, 0xB4, /* 0x68-0x6B */
-       0x00, 0x00, 0xC3, 0xB5, 0x00, 0x00, 0xF2, 0xB4, /* 0x6C-0x6F */
-       0xF2, 0xB2, 0x00, 0x00, 0xF2, 0xB6, 0xC3, 0xBA, /* 0x70-0x73 */
-       0xF2, 0xB7, 0xF2, 0xB0, 0xF2, 0xAF, 0xF2, 0xB3, /* 0x74-0x77 */
-       0xF2, 0xB1, 0xC3, 0xB6, 0xF2, 0xB5, 0xF4, 0xAC, /* 0x78-0x7B */
-       0xC4, 0x7E, 0xC4, 0x7D, 0xF4, 0xAD, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0xF4, 0xAF, 0xF4, 0xAE, 0xC4, 0xA1, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0xF5, 0xEB, 0xF5, 0xE8, /* 0x84-0x87 */
-       0xF5, 0xE9, 0x00, 0x00, 0xF5, 0xE7, 0xF5, 0xEA, /* 0x88-0x8B */
-       0xC4, 0xF2, 0xF5, 0xEC, 0x00, 0x00, 0xC4, 0xF1, /* 0x8C-0x8F */
-       0x00, 0x00, 0xF7, 0x42, 0x00, 0x00, 0xC5, 0xD5, /* 0x90-0x93 */
-       0xC5, 0xD7, 0xF7, 0xEE, 0xC5, 0xD6, 0xF8, 0xB9, /* 0x94-0x97 */
-       0xF9, 0x40, 0xF9, 0x42, 0xF8, 0xFE, 0xF9, 0x41, /* 0x98-0x9B */
-       0xC6, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
+       0xC2, 0xB4, 0xC2, 0xB5, 0xF0, 0x6F, 0xF0, 0x76, /* 0x54-0x57 */
+       0xF0, 0x71, 0xC2, 0xBA, 0xC2, 0xB7, 0x00, 0x00, /* 0x58-0x5B */
+       0xF0, 0x6D, 0x00, 0x00, 0xC2, 0xB6, 0xF0, 0x73, /* 0x5C-0x5F */
+       0xF0, 0x75, 0xC2, 0xB8, 0xF0, 0x72, 0xF0, 0x70, /* 0x60-0x63 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
+       0xF2, 0xB8, 0xC3, 0xB7, 0xC3, 0xB8, 0xC3, 0xB4, /* 0x68-0x6B */
+       0x00, 0x00, 0xC3, 0xB5, 0x00, 0x00, 0xF2, 0xB4, /* 0x6C-0x6F */
+       0xF2, 0xB2, 0x00, 0x00, 0xF2, 0xB6, 0xC3, 0xBA, /* 0x70-0x73 */
+       0xF2, 0xB7, 0xF2, 0xB0, 0xF2, 0xAF, 0xF2, 0xB3, /* 0x74-0x77 */
+       0xF2, 0xB1, 0xC3, 0xB6, 0xF2, 0xB5, 0xF4, 0xAC, /* 0x78-0x7B */
+       0xC4, 0x7E, 0xC4, 0x7D, 0xF4, 0xAD, 0x00, 0x00, /* 0x7C-0x7F */
+       
+       0xF4, 0xAF, 0xF4, 0xAE, 0xC4, 0xA1, 0x00, 0x00, /* 0x80-0x83 */
+       0x00, 0x00, 0x00, 0x00, 0xF5, 0xEB, 0xF5, 0xE8, /* 0x84-0x87 */
+       0xF5, 0xE9, 0x00, 0x00, 0xF5, 0xE7, 0xF5, 0xEA, /* 0x88-0x8B */
+       0xC4, 0xF2, 0xF5, 0xEC, 0x00, 0x00, 0xC4, 0xF1, /* 0x8C-0x8F */
+       0x00, 0x00, 0xF7, 0x42, 0x00, 0x00, 0xC5, 0xD5, /* 0x90-0x93 */
+       0xC5, 0xD7, 0xF7, 0xEE, 0xC5, 0xD6, 0xF8, 0xB9, /* 0x94-0x97 */
+       0xF9, 0x40, 0xF9, 0x42, 0xF8, 0xFE, 0xF9, 0x41, /* 0x98-0x9B */
+       0xC6, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
 };
 
 static unsigned char u2c_7F[512] = {
@@ -8186,30 +7809,6 @@ static unsigned char u2c_8B[512] = {
        0xF8, 0xC1, 0xF8, 0xC2, 0xC6, 0x40, 0x00, 0x00, /* 0x94-0x97 */
        0xF9, 0x4D, 0xF9, 0x4E, 0xC6, 0x67, 0x00, 0x00, /* 0x98-0x9B */
        0xC6, 0x6D, 0x00, 0x00, 0xF9, 0xA9, 0xF9, 0xC8, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_8C[512] = {
@@ -8791,37 +8390,6 @@ static unsigned char u2c_94[512] = {
        0xC6, 0x72, 0xC6, 0x70, 0xC6, 0x71, 0xC6, 0x77, /* 0x7C-0x7F */
        
        0xF9, 0xC0, 0xF9, 0xC1, 0xF9, 0xBF, 0xF9, 0xC9, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_95[512] = {
@@ -8884,12 +8452,6 @@ static unsigned char u2c_95[512] = {
        0xC3, 0xF6, 0x00, 0x00, 0xF5, 0x45, 0xF5, 0x47, /* 0xDC-0xDF */
        0xF5, 0x46, 0xC4, 0xC4, 0xC5, 0x50, 0xF6, 0x6D, /* 0xE0-0xE3 */
        0xF6, 0x6C, 0xF6, 0x6B, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_96[512] = {
@@ -9548,96 +9110,10 @@ static unsigned char u2c_9F[512] = {
        0xC0, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
        0xEF, 0xB6, 0x00, 0x00, 0xF7, 0xCF, 0x00, 0x00, /* 0xA0-0xA3 */
        0xF9, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_DC[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x03 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0C-0x0F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x13 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x14-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1C-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x23 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x24-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_F9[512] = {
@@ -9721,59 +9197,6 @@ static unsigned char u2c_FA[512] = {
        0x00, 0x00, 0xB6, 0x68, 0xB3, 0xA3, 0x00, 0x00, /* 0x24-0x27 */
        0x00, 0x00, 0x00, 0x00, 0xB6, 0xBA, 0xB9, 0x7D, /* 0x28-0x2B */
        0xC0, 0x5D, 0xC5, 0x62, 0x00, 0x00, 0x00, 0x00, /* 0x2C-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x33 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x34-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3C-0x3F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x43 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x44-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x4C-0x4F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x53 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x54-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x5C-0x5F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x63 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x64-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FE[512] = {
@@ -9804,44 +9227,6 @@ static unsigned char u2c_FE[512] = {
        0xA1, 0xCD, 0xA1, 0xCE, 0xA1, 0xDE, 0xA1, 0xDF, /* 0x60-0x63 */
        0xA1, 0xE0, 0xA1, 0xE1, 0xA1, 0xE2, 0x00, 0x00, /* 0x64-0x67 */
        0xA2, 0x42, 0xA2, 0x4C, 0xA2, 0x4D, 0xA2, 0x4E, /* 0x68-0x6B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x6C-0x6F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x73 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x74-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x7C-0x7F */
-       
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x83 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x84-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x8C-0x8F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x93 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x94-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9B */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x9C-0x9F */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA0-0xA3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA4-0xA7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xA8-0xAB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xAC-0xAF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB0-0xB3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB4-0xB7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xB8-0xBB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xBC-0xBF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC0-0xC3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC4-0xC7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xC8-0xCB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xCC-0xCF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD0-0xD3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD4-0xD7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xD8-0xDB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE0-0xE3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char u2c_FF[512] = {
@@ -9904,12 +9289,6 @@ static unsigned char u2c_FF[512] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xDC-0xDF */
        0xA2, 0x46, 0xA2, 0x47, 0x00, 0x00, 0xA1, 0xC3, /* 0xE0-0xE3 */
        0x00, 0x00, 0xA2, 0x44, 0x00, 0x00, 0x00, 0x00, /* 0xE4-0xE7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xE8-0xEB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xEC-0xEF */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF0-0xF3 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF4-0xF7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xF8-0xFB */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xFC-0xFF */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 2ccb561ce570bbd84606fb971e4b037d748e7220..a2297d3e824f7e401d9962bdca821e8d7a8bef22 100644 (file)
@@ -147,23 +147,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0xbe, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xb8, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -190,16 +173,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
        0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 1ee59bc3ce7af98b27468619622e5a9e7c7f04c8..6ad040a3e9d33224d4b00964776ea6d504da11b3 100644 (file)
@@ -149,23 +149,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd9, 0xf9, /* 0x68-0x6f */
        0xdb, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0xac, 0xbc, 0xaf, 0xbf, 0xae, 0xbe, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page02[256] = {
@@ -198,10 +181,6 @@ static unsigned char page02[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
        0xa2, 0xff, 0x00, 0xb2, 0x00, 0xbd, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 16912ea1374e2f19b8d40b788b1225ffda3a715b..f035000e01b0e03e21f90293f616bc3d6ce72086 100644 (file)
@@ -149,23 +149,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0xdd, 0xfd, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x00, 0x00, 0xaf, 0xbf, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page02[256] = {
@@ -198,10 +181,6 @@ static unsigned char page02[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
        0xa2, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index e7ae7590da7f4abe69d708433099e3b891e6bfe6..1bd6ef2bfe5e254aead74495910be860fbb8b965 100644 (file)
@@ -149,23 +149,6 @@ static unsigned char page01[256] = {
        0xdd, 0xfd, 0xde, 0xfe, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
        0x00, 0x00, 0xd9, 0xf9, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0xbe, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page02[256] = {
@@ -198,10 +181,6 @@ static unsigned char page02[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
        0x00, 0xff, 0x00, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index e7674d41b504808dc9c6fde7d79634d1bb354bc0..052df9354a3bf75b3a248c444ce7ddf2a34d8848 100644 (file)
@@ -120,16 +120,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page04[256] = {
@@ -145,63 +135,12 @@ static unsigned char page04[256] = {
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
        0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0x50-0x57 */
        0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0xfe, 0xff, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page21[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, /* 0x10-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 3fce9a66eb27dd3a0dfb8492152f0881463f3dbe..785cbeec1cc83a1dfc33d87cc21504561e7b1922 100644 (file)
@@ -120,16 +120,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page06[256] = {
@@ -147,25 +137,6 @@ static unsigned char page06[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x60-0x67 */
        0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
@@ -241,7 +212,6 @@ static unsigned char charset2upper[256] = {
        0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
        0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
index 603936bf1523f1287d208bc7ecb3d236ae1788a8..23b834b10c4b561879717efc74070e4497af5758 100644 (file)
@@ -122,14 +122,6 @@ static unsigned char page00[256] = {
        0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
        0xb0, 0xb1, 0xb2, 0xb3, 0x00, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0xbb, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page02[256] = {
@@ -158,14 +150,6 @@ static unsigned char page02[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
        0x00, 0x00, 0x00, 0x00, 0xa2, 0xa1, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page03[256] = {
@@ -196,48 +180,12 @@ static unsigned char page03[256] = {
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xb8-0xbf */
        0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xc0-0xc7 */
        0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, 0x00, /* 0x10-0x17 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 9d50ec8780fde9e09787b9efd8e1f98a9e69449d..06bf40d4455621b31d99cd2ee418f8c7bc360abb 100644 (file)
@@ -129,7 +129,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page05[256] = {
@@ -164,8 +163,6 @@ static unsigned char page05[256] = {
        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xd8-0xdf */
        0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xe0-0xe7 */
        0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page20[256] = {
@@ -177,31 +174,6 @@ static unsigned char page20[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaf, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index d251e9a1bab7e056306cb35fea78fee13abfff3d..47e18e6bb8ca67f9a2dcef70b5015b4ce727dc98 100644 (file)
@@ -145,27 +145,6 @@ static unsigned char page01[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfe, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 7169c7d6e69a018334c3d76702eddf2ea945ea5d..e4cf807afa080a65cd035f6f3a8d48bb951219ac 100644 (file)
@@ -129,7 +129,6 @@ static unsigned char page00[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page04[256] = {
@@ -144,28 +143,6 @@ static unsigned char page04[256] = {
        0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0x40-0x47 */
        0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1, /* 0x48-0x4f */
        0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page22[256] = {
@@ -182,26 +159,6 @@ static unsigned char page22[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
        0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page23[256] = {
@@ -210,34 +167,6 @@ static unsigned char page23[256] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
        0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
-
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char page25[256] = {
@@ -263,17 +192,6 @@ static unsigned char page25[256] = {
        0x8f, 0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
        0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
-       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
 };
 
 static unsigned char *page_uni2charset[256] = {
index 291e8e67dff2eb664d9ff3387582a260022aa412..a72e2ccbc1ee5e597c4491b275b34986417688a9 100644 (file)
@@ -185,14 +185,6 @@ void add_gd_partition(struct gendisk *hd, int minor, int start, int size)
 #endif
 }
 
-int get_hardsect_size(kdev_t dev)
-{
-       if (hardsect_size[MAJOR(dev)] != NULL)
-               return hardsect_size[MAJOR(dev)][MINOR(dev)];
-       else
-               return 512;
-}
-
 unsigned int get_ptable_blocksize(kdev_t dev)
 {
        int ret = 1024;
index a5c2139307bdba0715b5be260b29cb6034964030..0b371830931b54b4c31cf534589c878c31e34b20 100644 (file)
 #define ROUND_UP(x,y) (((x)+(y)-1)/(y))
 #define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
 
+struct poll_table_entry {
+       struct file * filp;
+       wait_queue_t wait;
+       wait_queue_head_t * wait_address;
+};
+
+struct poll_table_page {
+       struct poll_table_page * next;
+       struct poll_table_entry * entry;
+       struct poll_table_entry entries[0];
+};
+
+#define POLL_TABLE_FULL(table) \
+       ((unsigned long)(table->entry+1) > PAGE_SIZE + (unsigned long)(table))
+
 /*
  * Ok, Peter made a complicated, but straightforward multiple_wait() function.
  * I have rewritten this, taking some shortcuts: This code may not be easy to
@@ -44,13 +59,12 @@ void poll_freewait(poll_table* pt)
                struct poll_table_entry * entry;
                struct poll_table_page *old;
 
-               entry = p->entry + p->nr;
-               while (p->nr > 0) {
-                       p->nr--;
+               entry = p->entry;
+               do {
                        entry--;
                        remove_wait_queue(entry->wait_address,&entry->wait);
                        fput(entry->filp);
-               }
+               } while (entry > p->entries);
                old = p;
                p = p->next;
                free_page((unsigned long) old);
@@ -61,7 +75,7 @@ void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table
 {
        struct poll_table_page *table = p->table;
 
-       if (!table || table->nr >= __MAX_POLL_TABLE_ENTRIES) {
+       if (!table || POLL_TABLE_FULL(table)) {
                struct poll_table_page *new_table;
 
                new_table = (struct poll_table_page *) __get_free_page(GFP_KERNEL);
@@ -70,8 +84,7 @@ void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table
                        __set_current_state(TASK_RUNNING);
                        return;
                }
-               new_table->nr = 0;
-               new_table->entry = (struct poll_table_entry *)(new_table + 1);
+               new_table->entry = new_table->entries;
                new_table->next = table;
                p->table = new_table;
                table = new_table;
@@ -79,9 +92,8 @@ void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table
 
        /* Add a new entry */
        {
-               struct poll_table_entry * entry;
-               entry = table->entry + table->nr;
-               table->nr++;
+               struct poll_table_entry * entry = table->entry;
+               table->entry = entry+1;
                get_file(filp);
                entry->filp = filp;
                entry->wait_address = wait_address;
index 6ce4ea3882e34eb53bf8f34f293d882f8a7b761f..fde5f21215cdb8e1b93f7220d5dd5ff041235fb9 100644 (file)
@@ -6,10 +6,10 @@
 /* For __swab32 */
 #include <asm/byteorder.h>
 
-extern __inline__ void set_bit(int nr, void * addr)
+extern __inline__ void set_bit(int nr, volatile void * addr)
 {
        int     mask;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -19,10 +19,10 @@ extern __inline__ void set_bit(int nr, void * addr)
        restore_flags(flags);
 }
 
-extern __inline__ void clear_bit(int nr, void * addr)
+extern __inline__ void clear_bit(int nr, volatile void * addr)
 {
        int     mask;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -32,10 +32,10 @@ extern __inline__ void clear_bit(int nr, void * addr)
        restore_flags(flags);
 }
 
-extern __inline__ void change_bit(int nr, void * addr)
+extern __inline__ void change_bit(int nr, volatile void * addr)
 {
        int     mask;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -45,10 +45,10 @@ extern __inline__ void change_bit(int nr, void * addr)
        restore_flags(flags);
 }
 
-extern __inline__ int test_and_set_bit(int nr, void * addr)
+extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
 {
        int     mask, retval;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -61,10 +61,10 @@ extern __inline__ int test_and_set_bit(int nr, void * addr)
        return retval;
 }
 
-extern __inline__ int test_and_clear_bit(int nr, void * addr)
+extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
 {
        int     mask, retval;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -77,10 +77,10 @@ extern __inline__ int test_and_clear_bit(int nr, void * addr)
        return retval;
 }
 
-extern __inline__ int test_and_change_bit(int nr, void * addr)
+extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
 {
        int     mask, retval;
-       unsigned int *a = addr;
+       volatile unsigned int *a = addr;
        unsigned long flags;
 
        a += nr >> 5;
@@ -94,9 +94,9 @@ extern __inline__ int test_and_change_bit(int nr, void * addr)
 }
 
 
-extern __inline__ int test_bit(int nr, const void *addr)
+extern __inline__ int test_bit(int nr, const volatile void *addr)
 {
-       return 1UL & (((const unsigned int *) addr)[nr >> 5] >> (nr & 31));
+       return 1UL & (((const volatile unsigned int *) addr)[nr >> 5] >> (nr & 31));
 }
 
 extern __inline__ unsigned long ffz(unsigned long word)
@@ -159,11 +159,11 @@ found_middle:
 #define ext2_find_next_zero_bit(addr, size, offset) \
                 find_next_zero_bit((addr), (size), (offset))
 #else
-extern __inline__ int ext2_set_bit(int nr,void * addr)
+extern __inline__ int ext2_set_bit(int nr, volatile void * addr)
 {
        int             mask, retval;
        unsigned long   flags;
-       unsigned char   *ADDR = (unsigned char *) addr;
+       volatile unsigned char  *ADDR = (unsigned char *) addr;
 
        ADDR += nr >> 3;
        mask = 1 << (nr & 0x07);
@@ -174,11 +174,11 @@ extern __inline__ int ext2_set_bit(int nr,void * addr)
        return retval;
 }
 
-extern __inline__ int ext2_clear_bit(int nr, void * addr)
+extern __inline__ int ext2_clear_bit(int nr, volatile void * addr)
 {
        int             mask, retval;
        unsigned long   flags;
-       unsigned char   *ADDR = (unsigned char *) addr;
+       volatile unsigned char  *ADDR = (unsigned char *) addr;
 
        ADDR += nr >> 3;
        mask = 1 << (nr & 0x07);
@@ -189,10 +189,10 @@ extern __inline__ int ext2_clear_bit(int nr, void * addr)
        return retval;
 }
 
-extern __inline__ int ext2_test_bit(int nr, const void * addr)
+extern __inline__ int ext2_test_bit(int nr, const volatile void * addr)
 {
        int                     mask;
-       const unsigned char     *ADDR = (const unsigned char *) addr;
+       const volatile unsigned char    *ADDR = (const unsigned char *) addr;
 
        ADDR += nr >> 3;
        mask = 1 << (nr & 0x07);
index 6e1a728bff08580bd1fe717d789f490e7a2d7202..f19fc90679b73255afb998e56b8d1f5ef619f339 100644 (file)
@@ -164,6 +164,7 @@ static __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len)
 }
 
 #define _HAVE_ARCH_IPV6_CSUM
+#ifdef CONFIG_IPV6
 static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
                                                     struct in6_addr *daddr,
                                                     __u32 len,
@@ -198,6 +199,7 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
 
        return csum_fold(sum);
 }
+#endif
 
 /* 
  *     Copy and checksum to user
index e57d0e31a2f76c03e18c2780dfbf1fbc59b71a7b..592b31d95a6e1328f23ffc574b1877f2e91b4d27 100644 (file)
@@ -4,25 +4,28 @@
 #include <linux/config.h>
 #include <linux/threads.h>
 
-extern unsigned int local_irq_count[NR_CPUS];
-extern unsigned int local_bh_count[NR_CPUS];
+extern unsigned int __local_irq_count[NR_CPUS];
+extern unsigned int __local_bh_count[NR_CPUS];
+
+#define local_irq_count(cpu) (__local_irq_count[(cpu)])
+#define local_bh_count(cpu) (__local_bh_count[(cpu)])
 
 /*
  * Are we in an interrupt context? Either doing bottom half
  * or hardware interrupt processing?
  */
 #define in_interrupt() ({ int __cpu = smp_processor_id(); \
-       (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
+       (__local_irq_count[__cpu] + __local_bh_count[__cpu] != 0); })
 
-#define in_irq() (local_irq_count[smp_processor_id()] != 0)
+#define in_irq() (__local_irq_count[smp_processor_id()] != 0)
 
 #ifndef CONFIG_SMP
 
-#define hardirq_trylock(cpu)   (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu)   (__local_irq_count[cpu] == 0)
 #define hardirq_endlock(cpu)   do { } while (0)
 
-#define irq_enter(cpu, irq)    (local_irq_count[cpu]++)
-#define irq_exit(cpu, irq)     (local_irq_count[cpu]--)
+#define irq_enter(cpu, irq)    (__local_irq_count[cpu]++)
+#define irq_exit(cpu, irq)     (__local_irq_count[cpu]--)
 
 #define synchronize_irq()      barrier()
 
index e4448a7dd8168d09252eb08748b2fcfdd840ed1c..0f48339b273814936e522a08a51f88882c042892 100644 (file)
@@ -112,6 +112,16 @@ extern __inline__ void destroy_context(struct mm_struct *mm)
 
 #define MMU_NTLB_ENTRIES       64      /* for 7750 */
 #define MMU_CONTROL_INIT       0x205   /* SQMD=1, SV=0, TI=1, AT=1 */
+
+#define MMU_ITLB_DATA_ARRAY    0xF3000000
+#define MMU_UTLB_DATA_ARRAY    0xF7000000
+
+#define MMU_UTLB_ENTRIES          64
+#define MMU_U_ENTRY_SHIFT          8
+#define MMU_UTLB_VALID         0x100
+#define MMU_ITLB_ENTRIES           4
+#define MMU_I_ENTRY_SHIFT          8
+#define MMU_ITLB_VALID         0x100
 #endif
 
 extern __inline__ void set_asid(unsigned long asid)
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h
new file mode 100644 (file)
index 0000000..3156c8a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * include/asm-sh/serial.h
+ *
+ * Configuration details for 8250, 16450, 16550, etc. serial ports
+ */
+
+#ifndef _ASM_SERIAL_H
+#define _ASM_SERIAL_H
+
+#include <linux/config.h>
+
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ *
+ * It'd be nice if someone built a serial card with a 24.576 MHz
+ * clock, since the 16550A is capable of handling a top speed of 1.5
+ * megabits/second; but this requires the faster clock.
+ */
+#define BASE_BAUD ( 1843200 / 16 )
+
+#define RS_TABLE_SIZE  2
+
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+
+#define STD_SERIAL_PORT_DEFNS                  \
+       /* UART CLK   PORT IRQ     FLAGS        */                      \
+       { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },      /* ttyS0 */     \
+       { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }       /* ttyS1 */
+
+#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
+
+/* XXX: This should be moved ino irq.h */
+#define irq_cannonicalize(x) (x)
+
+#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-sh/sh_bios.h b/include/asm-sh/sh_bios.h
new file mode 100644 (file)
index 0000000..7f084b0
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ASM_SH_BIOS_H
+#define __ASM_SH_BIOS_H
+
+/*
+ * Copyright (C) 2000 Greg Banks, Mitch Davis
+ * C API to interface to the standard LinuxSH BIOS
+ * usually from within the early stages of kernel boot.
+ */
+
+#include <config/sh/standard/bios.h>
+
+
+extern void sh_bios_console_write(const char *buf, unsigned int len);
+extern void sh_bios_char_out(char ch);
+extern int sh_bios_in_gdb_mode(void);
+extern void sh_bios_gdb_detach(void);
+
+
+#endif /* __ASM_SH_BIOS_H */
index 9f0a9ff96d249871b196fdf4986b04e82256e8d8..44f4e0423a69d82ca8b0fbe7d84abc9d01f48271 100644 (file)
@@ -4,12 +4,12 @@
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 
-#define cpu_bh_disable(cpu)    do { local_bh_count[(cpu)]++; barrier(); } while (0)
-#define cpu_bh_enable(cpu)     do { barrier(); local_bh_count[(cpu)]--; } while (0)
+#define cpu_bh_disable(cpu)    do { __local_bh_count[(cpu)]++; barrier(); } while (0)
+#define cpu_bh_enable(cpu)     do { barrier(); __local_bh_count[(cpu)]--; } while (0)
 
 #define local_bh_disable()     cpu_bh_disable(smp_processor_id())
 #define local_bh_enable()      cpu_bh_enable(smp_processor_id())
 
-#define in_softirq() (local_bh_count[smp_processor_id()] != 0)
+#define in_softirq() (__local_bh_count[smp_processor_id()] != 0)
 
 #endif /* __ASM_SH_SOFTIRQ_H */
index c58ec44d567715174c72e5c0c99f133e2c4ca3a4..2351c2f0b92000e27c0347ce1455963cdc249c7d 100644 (file)
@@ -12,7 +12,7 @@
        (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
                << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
 
-typedef unsigned long cycles_t;
+typedef unsigned long long cycles_t;
 
 extern cycles_t cacheflush_time;
 
index 4f00239bf83a12477a5436dd4afdd49e25635cfa..f8ec698cc00a7054c9fadd28dc18b4a58abfce5c 100644 (file)
@@ -196,4 +196,14 @@ extern int * max_segments[MAX_BLKDEV];
 extern void drive_stat_acct (kdev_t dev, int rw,
                                        unsigned long nr_sectors, int new_io);
 
+static inline int get_hardsect_size(kdev_t dev)
+{
+       extern int *hardsect_size[];
+       if (hardsect_size[MAJOR(dev)] != NULL)
+               return hardsect_size[MAJOR(dev)][MINOR(dev)];
+       else
+               return 512;
+}
+
+
 #endif
index 268fd27a18b44c72ea1814ed6054556f3f26fd59..a206b616bfe2407d83c05ca1e4ffc7c77916fdbf 100644 (file)
@@ -5,7 +5,8 @@
 #ifndef __LINUX_FILE_H
 #define __LINUX_FILE_H
 
-extern void _fput(struct file *);
+extern void FASTCALL(fput(struct file *));
+extern struct file * FASTCALL(fget(unsigned int fd));
 
 static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
 {
@@ -38,40 +39,6 @@ static inline struct file * frip(struct files_struct *files, unsigned int fd)
        return file;
 }
 
-static inline struct file * fget(unsigned int fd)
-{
-       struct file * file = NULL;
-       struct files_struct *files = current->files;
-
-       read_lock(&files->file_lock);
-       file = fcheck(fd);
-       if (file)
-               get_file(file);
-       read_unlock(&files->file_lock);
-       return file;
-}
-
-/*
- * 23/12/1998 Marcin Dalecki <dalecki@cs.net.pl>: 
- * 
- * Since those functions where calling other functions, it was completely 
- * bogus to make them all "extern inline".
- *
- * The removal of this pseudo optimization saved me scandalous:
- *
- *             3756 (i386 arch) 
- *
- * precious bytes from my kernel, even without counting all the code compiled
- * as module!
- *
- * I suspect there are many other similar "optimizations" across the
- * kernel...
- */
-static inline void fput(struct file * file)
-{
-       if (atomic_dec_and_test(&file->f_count))
-               _fput(file);
-}
 extern void put_filp(struct file *);
 
 extern int get_unused_fd(void);
index c0f69dbb49437595f1724e882f2d1fc32e287143..6cfe0bbb78c5e0242f8e0eae033d788a59ee9e7f 100644 (file)
@@ -231,7 +231,7 @@ char *disk_name (struct gendisk *hd, int minor, char *buf);
 extern void devfs_register_partitions (struct gendisk *dev, int minor,
                                       int unregister);
 
-int get_hardsect_size(kdev_t dev);
+
 
 /*
  * FIXME: this should use genhd->minor_shift, but that is slow to look up.
index 4e880c93748745c201588d691c01b894c5ed45dc..4bc6187b3b8de75b0c2455e7664b68a50970651b 100644 (file)
@@ -8,6 +8,9 @@
 #ifdef CONFIG_KMOD
 extern int request_module(const char * name);
 extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]);
+#ifdef CONFIG_HOTPLUG
+extern char hotplug_path [];
+#endif
 #else
 static inline int request_module(const char * name) { return -ENOSYS; }
 static inline int exec_usermodehelper(char *program_path, char *argv[], char *envp[])
index 70f57f77060b9a402c670f96709f354ffe905ca7..b8f6a496413de55125028cffd01228a2bdc220ba 100644 (file)
@@ -327,18 +327,10 @@ static inline struct page * alloc_pages(int gfp_mask, unsigned long order)
 extern struct page * alloc_pages(int gfp_mask, unsigned long order);
 #endif /* !CONFIG_DISCONTIGMEM */
 
-#define alloc_page(gfp_mask) \
-               alloc_pages(gfp_mask, 0)
+#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
 
-static inline unsigned long __get_free_pages (int gfp_mask, unsigned long order)
-{
-       struct page * page;
-
-       page = alloc_pages(gfp_mask, order);
-       if (!page)
-               return 0;
-       return page_address(page);
-}
+extern unsigned long FASTCALL(__get_free_pages(int gfp_mask, unsigned long order));
+extern unsigned long FASTCALL(get_zeroed_page(int gfp_mask));
 
 #define __get_free_page(gfp_mask) \
                __get_free_pages((gfp_mask),0)
@@ -346,16 +338,6 @@ static inline unsigned long __get_free_pages (int gfp_mask, unsigned long order)
 #define __get_dma_pages(gfp_mask, order) \
                __get_free_pages((gfp_mask) | GFP_DMA,(order))
 
-static inline unsigned long get_zeroed_page(int gfp_mask)
-{
-       unsigned long page;
-
-       page = __get_free_page(gfp_mask);
-       if (page)
-               clear_page((void *)page);
-       return page;
-}
-
 /*
  * The old interface name will be removed in 2.5:
  */
@@ -364,29 +346,10 @@ static inline unsigned long get_zeroed_page(int gfp_mask)
 /*
  * There is only one 'core' page-freeing function.
  */
-extern void FASTCALL(__free_pages_ok(struct page * page, unsigned long order));
-
-static inline void __free_pages(struct page *page, unsigned long order)
-{
-       if (!put_page_testzero(page))
-               return;
-       __free_pages_ok(page, order);
-}
-
-#define __free_page(page) __free_pages(page, 0)
-
-static inline void free_pages(unsigned long addr, unsigned long order)
-{
-       unsigned long map_nr;
-
-#ifdef CONFIG_DISCONTIGMEM
-       if (addr == 0) return;
-#endif
-       map_nr = MAP_NR(addr);
-       if (map_nr < max_mapnr)
-               __free_pages(mem_map + map_nr, order);
-}
+extern void FASTCALL(__free_pages(struct page *page, unsigned long order));
+extern void FASTCALL(free_pages(unsigned long addr, unsigned long order));
 
+#define __free_page(page) __free_pages((page), 0)
 #define free_page(addr) free_pages((addr),0)
 
 extern void show_free_areas(void);
index cedd7f05e21e541c60b620e323006734240fc85f..7d67f410b1e0ddb9121d23347e855f6390856679 100644 (file)
@@ -212,7 +212,7 @@ static inline void *
 static inline void ncp_kfree_s(void *obj, int size)
 {
        ncp_current_malloced -= 1;
-       kfree(obj, size);
+       kfree(obj);
 }
 
 #else                          /* DEBUG_NCP_MALLOC */
index 64b5df671fbb216c3a639daa6b948e0b3d561deb..24138dbd2514ab299ac0ca941b739f776fd420da 100644 (file)
 #include <linux/mm.h>
 #include <asm/uaccess.h>
 
-
-struct poll_table_entry {
-       struct file * filp;
-       wait_queue_t wait;
-       wait_queue_head_t * wait_address;
-};
-
-struct poll_table_page {
-       struct poll_table_page * next;
-       unsigned int nr;
-       struct poll_table_entry * entry;
-};
+struct poll_table_page;
 
 typedef struct poll_table_struct {
        int error;
        struct poll_table_page * table;
 } poll_table;
 
-#define __MAX_POLL_TABLE_ENTRIES ((PAGE_SIZE - sizeof (struct poll_table_page)) / sizeof (struct poll_table_entry))
-
 extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
 
 extern inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
index b36a7ce01acfc50240a8e3d143faaa00cf510cca..7aef27bca72e5d005beaa86baac2f7728e12bb59 100644 (file)
@@ -19,7 +19,6 @@
 #define _MD_H
 
 #include <linux/mm.h>
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
 #include <asm/semaphore.h>
@@ -84,8 +83,6 @@ extern int md_notify_reboot(struct notifier_block *this,
                                        unsigned long code, void *x);
 extern int md_error (kdev_t mddev, kdev_t rdev);
 
-extern void raid_setup(char *str) md__init;
-
 extern void md_print_devices (void);
 
 #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
index 1b9632c14c9cdce1adc48f36355c052f184d190b..0c6e1a368e11b672e8e1642bd776624495e91edb 100644 (file)
@@ -115,7 +115,7 @@ typedef struct mdp_superblock_s {
        __u32 not_persistent;   /* 12 does it have a persistent superblock    */
        __u32 set_uuid1;        /* 13 Raid set identifier #2                  */
        __u32 set_uuid2;        /* 14 Raid set identifier #3                  */
-       __u32 set_uuid3;        /* 14 Raid set identifier #4                  */
+       __u32 set_uuid3;        /* 15 Raid set identifier #4                  */
        __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
 
        /*
@@ -128,7 +128,13 @@ typedef struct mdp_superblock_s {
        __u32 failed_disks;     /*  4 Number of failed disks                  */
        __u32 spare_disks;      /*  5 Number of spare disks                   */
        __u32 sb_csum;          /*  6 checksum of the whole superblock        */
-       __u64 events;           /*  7 number of superblock updates (64-bit!)  */
+#ifdef __BIG_ENDIAN
+       __u32 events_hi;        /*  7 high-order of superblock update count   */
+       __u32 events_lo;        /*  8 low-order of superblock update count    */
+#else
+       __u32 events_lo;        /*  7 low-order of superblock update count    */
+       __u32 events_hi;        /*  8 high-order of superblock update count   */
+#endif
        __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 9];
 
        /*
@@ -157,5 +163,10 @@ typedef struct mdp_superblock_s {
 
 } mdp_super_t;
 
+static inline __u64 md_event(mdp_super_t *sb) {
+       __u64 ev = sb->events_hi;
+       return (ev<<32)| sb->events_lo;
+}
+
 #endif _MD_P_H
 
index 53dbdaafae078d07a0539ddde0e9fbecd885081c..0b4ac5438a737994a9f9a49860397165d0ed35cf 100644 (file)
@@ -725,33 +725,9 @@ extern void daemonize(void);
 extern int do_execve(char *, char **, char **, struct pt_regs *);
 extern int do_fork(unsigned long, unsigned long, struct pt_regs *);
 
-static inline void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
-{
-       unsigned long flags;
-
-       wq_write_lock_irqsave(&q->lock, flags);
-       __add_wait_queue(q, wait);
-       wq_write_unlock_irqrestore(&q->lock, flags);
-}
-
-static inline void add_wait_queue_exclusive(wait_queue_head_t *q,
-                                                       wait_queue_t * wait)
-{
-       unsigned long flags;
-
-       wq_write_lock_irqsave(&q->lock, flags);
-       __add_wait_queue_tail(q, wait);
-       wq_write_unlock_irqrestore(&q->lock, flags);
-}
-
-static inline void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
-{
-       unsigned long flags;
-
-       wq_write_lock_irqsave(&q->lock, flags);
-       __remove_wait_queue(q, wait);
-       wq_write_unlock_irqrestore(&q->lock, flags);
-}
+extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
+extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
+extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
 
 #define __wait_event(wq, condition)                                    \
 do {                                                                   \
index d1f90126211db8ce33e1d08b933909bda83bf711..1545e60e1c012e19c777b4017b53a6c053036c39 100644 (file)
@@ -180,7 +180,8 @@ struct pci_board_inst {
 #define SPCI_FL_IRQBASE4       (0x0004 << 4)
 #define SPCI_FL_GET_IRQBASE(x)        ((x & SPCI_FL_IRQ_MASK) >> 4)
 
-/* Use sucessiveentries base resource table */
+/* Use sucessive BARs (PCI base address registers), 
+   else use offset into some specified BAR */
 #define SPCI_FL_BASE_TABLE     0x0100
 
 /* Use successive entries in the irq resource table */
index b374bb9c6b4851d7d5d1c791855f3ba7c67c0de0..7dfe40942a794d3429e5d264efac4a6fe999265c 100644 (file)
@@ -112,6 +112,7 @@ enum
        KERN_OVERFLOWUID=46,    /* int: overflow UID */
        KERN_OVERFLOWGID=47,    /* int: overflow GID */
        KERN_SHMPATH=48,        /* string: path to shm fs */
+       KERN_HOTPLUG=49,        /* string: path to hotplug policy agent */
 };
 
 
index 8856871935d08b9c76e256fd0b23b5f0d47af29b..27e6fe7df7eaa3caee78ffc3957ed768c05ed4c0 100644 (file)
 #define USB_CLASS_AUDIO                        1
 #define USB_CLASS_COMM                 2
 #define USB_CLASS_HID                  3
+#define USB_CLASS_PHYSICAL             5
 #define USB_CLASS_PRINTER              7
 #define USB_CLASS_MASS_STORAGE         8
 #define USB_CLASS_HUB                  9
 #define USB_CLASS_DATA                 10
+#define USB_CLASS_APP_SPEC             0xfe
 #define USB_CLASS_VENDOR_SPEC          0xff
 
 /*
index 0de6a5f784151892ed3323cd38c62973ee3bcf6c..b27087d7e9c644938158063082a2c2410ad22fdd 100644 (file)
@@ -159,6 +159,33 @@ int alloc_uid(struct task_struct *p)
        return 0;
 }
 
+void add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+{
+       unsigned long flags;
+
+       wq_write_lock_irqsave(&q->lock, flags);
+       __add_wait_queue(q, wait);
+       wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
+void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)
+{
+       unsigned long flags;
+
+       wq_write_lock_irqsave(&q->lock, flags);
+       __add_wait_queue_tail(q, wait);
+       wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
+void remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)
+{
+       unsigned long flags;
+
+       wq_write_lock_irqsave(&q->lock, flags);
+       __remove_wait_queue(q, wait);
+       wq_write_unlock_irqrestore(&q->lock, flags);
+}
+
 void __init fork_init(unsigned long mempages)
 {
        int i;
index 2a78a9606489d3441b11270ffc42000b0805d8b2..5f9c3b7df048024c0ebad5eb1dc1f152b203700b 100644 (file)
@@ -218,3 +218,26 @@ int request_module(const char * module_name)
        }
        return 0;
 }
+
+
+#ifdef CONFIG_HOTPLUG
+/*
+       hotplug path is set via /proc/sys
+       invoked by hotplug-aware bus drivers,
+       with exec_usermodehelper and some thread-spawner
+
+       argv [0] = hotplug_path;
+       argv [1] = "usb", "scsi", "pci", "network", etc;
+       ... plus optional type-specific parameters
+       argv [n] = 0;
+
+       envp [*] = HOME, PATH; optional type-specific parameters
+
+       a hotplug bus should invoke this for device add/remove
+       events.  the command is expected to load drivers when
+       necessary, and may perform additional system setup.
+*/
+char hotplug_path[256] = "/sbin/hotplug";
+
+#endif
+
index 32e5483154293deba03f1b5b124625762fc240f0..eae4ef1b7e897b41a53f8b52f1e35715dcec8db2 100644 (file)
@@ -77,6 +77,9 @@ __attribute__((section("__ksymtab"))) = {
 #ifdef CONFIG_KMOD
 EXPORT_SYMBOL(request_module);
 EXPORT_SYMBOL(exec_usermodehelper);
+#ifdef CONFIG_HOTPLUG
+EXPORT_SYMBOL(hotplug_path);
+#endif
 #endif
 
 #ifdef CONFIG_MODULES
@@ -97,7 +100,10 @@ EXPORT_SYMBOL(exit_sighand);
 /* internal kernel memory management */
 EXPORT_SYMBOL(__alloc_pages);
 EXPORT_SYMBOL(alloc_pages_node);
-EXPORT_SYMBOL(__free_pages_ok);
+EXPORT_SYMBOL(__get_free_pages);
+EXPORT_SYMBOL(get_zeroed_page);
+EXPORT_SYMBOL(__free_pages);
+EXPORT_SYMBOL(free_pages);
 #ifndef CONFIG_DISCONTIGMEM
 EXPORT_SYMBOL(contig_page_data);
 #endif
@@ -134,7 +140,7 @@ EXPORT_SYMBOL(get_super);
 EXPORT_SYMBOL(get_empty_super);
 EXPORT_SYMBOL(getname);
 EXPORT_SYMBOL(names_cachep);
-EXPORT_SYMBOL(_fput);
+EXPORT_SYMBOL(fput);
 EXPORT_SYMBOL(igrab);
 EXPORT_SYMBOL(iunique);
 EXPORT_SYMBOL(iget4);
index 935af0b427a47f67188ddafa12207883b1781f59..1cfa76d3bd0bcd65f15e3f2c12f9a1dc6acc7e28 100644 (file)
@@ -54,18 +54,19 @@ extern void mem_use(void);
  * calculation depends on the value of HZ.
  */
 #if HZ < 200
-#define LOG2_HZ 7
+#define TICK_SCALE(x)  ((x) >> 2)
 #elif HZ < 400
-#define LOG2_HZ 8
+#define TICK_SCALE(x)  ((x) >> 1)
 #elif HZ < 800
-#define LOG2_HZ 9
+#define TICK_SCALE(x)  (x)
 #elif HZ < 1600
-#define LOG2_HZ 10
+#define TICK_SCALE(x)  ((x) << 1)
 #else
-#define LOG2_HZ 11
+#define TICK_SCALE(x)  ((x) << 2)
 #endif
 
-#define NICE_TO_TICKS(nice)    ((((20)-(nice)) >> (LOG2_HZ-5))+1)
+#define NICE_TO_TICKS(nice)    (TICK_SCALE(20-(nice))+1)
+
 
 /*
  *     Init task must be ok at boot for the ix86 as we will check its signals
@@ -770,7 +771,6 @@ void __wake_up_sync(wait_queue_head_t *q, unsigned int mode)
        __wake_up_common(q, mode, 1);
 }
 
-
 #define        SLEEP_ON_VAR                            \
        unsigned long flags;                    \
        wait_queue_t wait;                      \
index 6b652628ba635e4622efabe83a98a0ab10880465..581021d858e028fb11b8ce5ab7217c838837ed43 100644 (file)
@@ -234,8 +234,9 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
 
 /*
  * Ugh. To avoid negative return values, "getpriority()" will
- * not return the normal nice-value, but a value that has been
- * offset by 20 (ie it returns 0..39 instead of -20..19)
+ * not return the normal nice-value, but a negated value that
+ * has been offset by 20 (ie it returns 40..1 instead of -20..19)
+ * to stay compatible.
  */
 asmlinkage long sys_getpriority(int which, int who)
 {
@@ -247,11 +248,11 @@ asmlinkage long sys_getpriority(int which, int who)
 
        read_lock(&tasklist_lock);
        for_each_task (p) {
-               unsigned niceval;
+               long niceval;
                if (!proc_sel(p, which, who))
                        continue;
                niceval = 20 - p->nice;
-               if (niceval < (unsigned)retval)
+               if (niceval retval)
                        retval = niceval;
        }
        read_unlock(&tasklist_lock);
index ab62787d1dfee1c6d3d07f8fbfe2b4bfb05b6d24..4290619d092129e9562dcb42d2903cc956ae781f 100644 (file)
@@ -53,6 +53,9 @@ static int minolduid;
 
 #ifdef CONFIG_KMOD
 extern char modprobe_path[];
+#ifdef CONFIG_HOTPLUG
+extern char hotplug_path[];
+#endif
 #endif
 #ifdef CONFIG_CHR_DEV_SG
 extern int sg_big_buff;
@@ -184,6 +187,10 @@ static ctl_table kern_table[] = {
 #ifdef CONFIG_KMOD
        {KERN_MODPROBE, "modprobe", &modprobe_path, 256,
         0644, NULL, &proc_dostring, &sysctl_string },
+#ifdef CONFIG_HOTPLUG
+       {KERN_HOTPLUG, "hotplug", &hotplug_path, 256,
+        0644, NULL, &proc_dostring, &sysctl_string },
+#endif
 #endif
 #ifdef CONFIG_CHR_DEV_SG
        {KERN_SG_BIG_BUFF, "sg-big-buff", &sg_big_buff, sizeof (int),
index 3b00780454e8aa73b6cd9753ae1db66b247f68d5..688682aad0c3b61a41874bf907ff6743522fabca 100644 (file)
@@ -1744,9 +1744,7 @@ static int msync_interval(struct vm_area_struct * vma,
                        struct file * file = vma->vm_file;
                        if (file && file->f_op && file->f_op->fsync) {
                                down(&file->f_dentry->d_inode->i_sem);
-                               lock_kernel();
                                error = file->f_op->fsync(file, file->f_dentry, 1);
-                               unlock_kernel();
                                up(&file->f_dentry->d_inode->i_sem);
                        }
                }
index ae05cf8f885452d49dbb0e40ab5eef270b5fa18e..7843d553b0d6f69c419438b513ddd465bf47e422 100644 (file)
@@ -64,7 +64,8 @@ static int zone_balance_max[MAX_NR_ZONES] = { 255 , 255, 255, };
  * Hint: -mask = 1+~mask
  */
 
-void __free_pages_ok (struct page *page, unsigned long order)
+static void FASTCALL(__free_pages_ok (struct page *page, unsigned long order));
+static void __free_pages_ok (struct page *page, unsigned long order)
 {
        unsigned long index, page_idx, mask, flags;
        free_area_t *area;
@@ -315,6 +316,50 @@ fail:
        return NULL;
 }
 
+/*
+ * Common helper functions.
+ */
+unsigned long __get_free_pages(int gfp_mask, unsigned long order)
+{
+       struct page * page;
+
+       page = alloc_pages(gfp_mask, order);
+       if (!page)
+               return 0;
+       return page_address(page);
+}
+
+unsigned long get_zeroed_page(int gfp_mask)
+{
+       struct page * page;
+
+       page = alloc_pages(gfp_mask, 0);
+       if (page) {
+               unsigned long address = page_address(page);
+               clear_page((void *)address);
+               return address;
+       }
+       return 0;
+}
+
+void __free_pages(struct page *page, unsigned long order)
+{
+       if (put_page_testzero(page))
+               __free_pages_ok(page, order);
+}
+
+void free_pages(unsigned long addr, unsigned long order)
+{
+       unsigned long map_nr;
+
+#ifdef CONFIG_DISCONTIGMEM
+       if (addr == 0) return;
+#endif
+       map_nr = MAP_NR(addr);
+       if (map_nr < max_mapnr)
+               __free_pages(mem_map + map_nr, order);
+}
+
 /*
  * Total amount of free (allocatable) RAM:
  */
index 79ae4d3cabb9bf656201e105276fc97fc78337cc..cb9b3d11ed38bdca02b318276b7ee47bef9ff079 100644 (file)
@@ -594,7 +594,7 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void *arg)
                if (edev == NULL)
                {
                        /* Magic up a new one. */
-                       edev = kmalloc(GFP_KERNEL, sizeof(struct ec_device));
+                       edev = kmalloc(sizeof(struct ec_device), GFP_KERNEL);
                        if (edev == NULL) {
                                printk("af_ec: memory squeeze.\n");
                                dev_put(dev);
index a9568ef0df5fe0eb274cc820404c43661f4f04d0..5c39c59b9db63cdee56d6941d27fa7a002e7b863 100644 (file)
@@ -277,7 +277,7 @@ static int ManagementDaemon(void *unused)
                while (I<ActualThreads)
                {
                        atomic_set(&Running[I],1);
-                       (void)kernel_thread(MainDaemon,&(CountBuf[I]),0);
+                       (void)kernel_thread(MainDaemon,&(CountBuf[I]), CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
                        I++;
                }
                
@@ -294,7 +294,7 @@ static int ManagementDaemon(void *unused)
                                        if (atomic_read(&Running[I])==0)
                                        {
                                                atomic_set(&Running[I],1);
-                                               (void)kernel_thread(MainDaemon,&(CountBuf[I]),0);
+                                               (void)kernel_thread(MainDaemon,&(CountBuf[I]), CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
                                                (void)printk(KERN_CRIT "kHTTPd: Restarting daemon %i \n",I);
                                        }
                                        I++;
@@ -383,7 +383,7 @@ int __init khttpd_init(void)
 
        StartSysctl();
        
-       (void)kernel_thread(ManagementDaemon,NULL,0);
+       (void)kernel_thread(ManagementDaemon,NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
        
        return 0;
 }