Import 2.1.602.1.60
authorLinus Torvalds<torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:13:58 +0000 (23 15:13 -0500)
committerLinus Torvalds<torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:13:58 +0000 (23 15:13 -0500)
193 files changed:
CREDITS
Documentation/Configure.help
Documentation/filesystems/00-INDEX
Documentation/filesystems/vfat.txt
Makefile
arch/alpha/config.in
arch/alpha/kernel/entry.S
arch/i386/config.in
arch/m68k/config.in
arch/mips/config.in
arch/mips/kernel/irixelf.c
arch/ppc/config.in
arch/sparc/config.in
arch/sparc64/config.in
arch/sparc64/kernel/binfmt_aout32.c
drivers/block/floppy.c
drivers/block/ide-tape.c
drivers/block/md.c
drivers/block/rd.c
drivers/char/mem.c
drivers/char/n_tty.c
drivers/char/psaux.c
drivers/char/random.c
drivers/char/rtc.c
drivers/char/tty_io.c
drivers/char/vc_screen.c
drivers/net/3c501.c
drivers/net/3c503.c
drivers/net/3c505.c
drivers/net/3c507.c
drivers/net/3c509.c
drivers/net/8390.c
drivers/net/8390.h
drivers/net/ac3200.c
drivers/net/apricot.c
drivers/net/arc-rimi.c
drivers/net/arcnet.c
drivers/net/at1700.c
drivers/net/atp.c
drivers/net/auto_irq.c
drivers/net/com20020.c
drivers/net/com90io.c
drivers/net/com90xx.c
drivers/net/cops.c
drivers/net/cs89x0.c
drivers/net/de600.c
drivers/net/de620.c
drivers/net/depca.c
drivers/net/e2100.c
drivers/net/eepro.c
drivers/net/eepro100.c
drivers/net/eexpress.c
drivers/net/es3210.c
drivers/net/eth16i.c
drivers/net/ewrk3.c
drivers/net/fmv18x.c
drivers/net/hp-plus.c
drivers/net/hp.c
drivers/net/hp100.c
drivers/net/ibmtr.c
drivers/net/lance.c
drivers/net/ltpc.c
drivers/net/ne.c
drivers/net/ni52.c
drivers/net/ni65.c
drivers/net/pi2.c
drivers/net/plip.c
drivers/net/ppp.c
drivers/net/pt.c
drivers/net/sdla.c
drivers/net/seeq8005.c
drivers/net/sk_g16.c
drivers/net/skeleton.c
drivers/net/smc-mca.c
drivers/net/smc-ultra.c
drivers/net/smc9194.c
drivers/net/wavelan.c
drivers/net/wd.c
drivers/net/znet.c
drivers/pci/pci.c
drivers/scsi/sg.c
drivers/scsi/st.c
fs/Config.in
fs/Makefile
fs/affs/dir.c
fs/affs/file.c
fs/autofs/waitq.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/block_dev.c
fs/dcache.c
fs/exec.c
fs/ext2/dir.c
fs/ext2/file.c
fs/fat/buffer.c
fs/fat/cache.c
fs/fat/dir.c
fs/fat/fatfs_syms.c
fs/fat/file.c
fs/fat/inode.c
fs/fat/misc.c
fs/fat/mmap.c
fs/fat/tables.c
fs/filesystems.c
fs/hpfs/hpfs_fs.c
fs/inode.c
fs/isofs/Makefile
fs/isofs/dir.c
fs/isofs/inode.c
fs/isofs/joliet.c[new file with mode: 0644]
fs/isofs/namei.c
fs/isofs/rock.c
fs/isofs/util.c
fs/locks.c
fs/minix/dir.c
fs/minix/file.c
fs/msdos/namei.c
fs/namei.c
fs/nfs/dir.c
fs/nfs/file.c
fs/nfs/inode.c
fs/nfs/write.c
fs/nfsd/vfs.c
fs/nls/Config.in[new file with mode: 0644]
fs/nls/Makefile[new file with mode: 0644]
fs/nls/nls_base.c[new file with mode: 0644]
fs/nls/nls_cp437.c[new file with mode: 0644]
fs/nls/nls_cp737.c[new file with mode: 0644]
fs/nls/nls_cp775.c[new file with mode: 0644]
fs/nls/nls_cp850.c[new file with mode: 0644]
fs/nls/nls_cp852.c[new file with mode: 0644]
fs/nls/nls_cp855.c[new file with mode: 0644]
fs/nls/nls_cp857.c[new file with mode: 0644]
fs/nls/nls_cp860.c[new file with mode: 0644]
fs/nls/nls_cp861.c[new file with mode: 0644]
fs/nls/nls_cp862.c[new file with mode: 0644]
fs/nls/nls_cp863.c[new file with mode: 0644]
fs/nls/nls_cp864.c[new file with mode: 0644]
fs/nls/nls_cp865.c[new file with mode: 0644]
fs/nls/nls_cp866.c[new file with mode: 0644]
fs/nls/nls_cp869.c[new file with mode: 0644]
fs/nls/nls_cp874.c[new file with mode: 0644]
fs/nls/nls_iso8859-1.c[new file with mode: 0644]
fs/nls/nls_iso8859-2.c[new file with mode: 0644]
fs/nls/nls_iso8859-3.c[new file with mode: 0644]
fs/nls/nls_iso8859-4.c[new file with mode: 0644]
fs/nls/nls_iso8859-5.c[new file with mode: 0644]
fs/nls/nls_iso8859-6.c[new file with mode: 0644]
fs/nls/nls_iso8859-7.c[new file with mode: 0644]
fs/nls/nls_iso8859-8.c[new file with mode: 0644]
fs/nls/nls_iso8859-9.c[new file with mode: 0644]
fs/nls/nls_koi8-r.c[new file with mode: 0644]
fs/pipe.c
fs/proc/array.c
fs/proc/generic.c
fs/proc/kmsg.c
fs/proc/mem.c
fs/proc/scsi.c
fs/read_write.c
fs/smbfs/dir.c
fs/smbfs/file.c
fs/super.c
fs/sysv/dir.c
fs/sysv/file.c
fs/sysv/inode.c
fs/vfat/Makefile
fs/vfat/namei.c
fs/vfat/vfatfs_syms.c[new file with mode: 0644]
include/asm-alpha/unistd.h
include/linux/binfmts.h
include/linux/dcache.h
include/linux/fs.h
include/linux/in6.h
include/linux/ioport.h
include/linux/iso_fs.h
include/linux/iso_fs_sb.h
include/linux/module.h
include/linux/msdos_fs.h
include/linux/msdos_fs_i.h
include/linux/msdos_fs_sb.h
include/linux/nls.h[new file with mode: 0644]
include/linux/pci.h
include/linux/sysctl.h
include/linux/sysv_fs.h
include/linux/tty_ldisc.h
kernel/ksyms.c
kernel/module.c
kernel/sys.c
kernel/sysctl.c
mm/filemap.c
mm/vmscan.c
net/netsyms.c
net/socket.c

index 1caa141..725edcf 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -215,8+215,9 @@ S: Fremont, California 94539
 S: USA
 
 N: Gordon Chaffee
-E: chaffee@plateau.cs.berkeley.edu
-D: vfat filesystem
+E: chaffee@bmrc.berkeley.edu
+W: http://bmrc.berkeley.edu/people/chaffee/
+D: vfat, fat32, joliet, native language support
 S: 3674 Oakwood Terrace #201
 S: Fremont, California 94536
 S: USA
index 0a29302..1e5cbaa 100644 (file)
@@ -4218,6+4218,154 @@ CONFIG_UMSDOS_FS
   umsdos.o. Note that the filesystem of your root partition cannot be
   a module, so this could be dangerous. If unsure, say N.
 
+nls: Native language codepages and Unicode support
+CONFIG_NLS
+  This is required by the FAT filesystems and by the ISO9660 filesystem
+  when it is compiled with Joliet support.  Joliet is a Microsoft
+  extension for CDROMs that supports Unicode.  This allows translation
+  between different character sets. When dealing with the FAT based
+  filesystems, there are two character sets that are important. The
+  first is the codepage.  Codepages are character sets that are used by
+  DOS to allow filenames to have native language characters when
+  character sets were limited to 256 characters. The codepage is the
+  character set that is used to store native language characters on
+  disk.  The two most common codepages are 437 in the United States and
+  850 in much of Europe. The second important character set is the
+  input/output character set. This is the character set that is
+  displayed on the screen. In the United States, this will almost always
+  be the ISO 8859-1 character set. This is the default. Linux will only
+  do a translation of the FAT filenames, not the contents of the files.
+
+nls iso8859-1
+CONFIG_NLS_ISO8859_1
+  ISO8859-1 is the Latin 1 character set, and it covers most West
+  European languages such as Albanian, Catalan, Danish, Dutch, English,
+  Faeroese, Finnish, French, German, Galician, Irish, Icelandic, Italian,
+  Norwegian, Portuguese, Spanish, Swedish, and Valencian.
+
+nls iso8859-2
+CONFIG_NLS_ISO8859_2
+  ISO8859-2 is the Latin 2 character set, and it works for most
+  Latin-written Slavic and Central European languages: Czech, German,
+  Hungarian, Polish, Rumanian, Croatian, Slovak, Slovene.
+
+nls iso8859-3
+CONFIG_NLS_ISO8859_3
+  ISO8859-3 is the Latin 3 character set, and it s popular with authors
+  of Esperanto, Galician, Maltese, and Turkish.
+
+nls iso8859-4
+CONFIG_NLS_ISO8859_4
+  ISO8859-4 is the Latin 4 character set, and it introduces letters
+  for Estonian, Latvian, and Lithuanian. It is an incomplete predecessor of
+  Latin 6.
+
+nls iso8859-5
+CONFIG_NLS_ISO8859_5
+  ISO8859-5 is a Cyrillic character set, and you can type Bulgarian,
+  Byelorussian, Macedonian, Russian, Serbian, and Ukrainian.
+  Note that the charset KOI8-R is preferred in Russia.
+
+nls iso8859-6
+CONFIG_NLS_ISO8859_6
+  ISO8859-6 is the Arabic character set.
+
+nls iso8859-7
+CONFIG_NLS_ISO8859_7
+  ISO8859-7 is the Modern Greek character set.
+
+nls iso8859-8
+CONFIG_NLS_ISO8859_8
+  ISO8859-8 is the Hebrew character set.
+
+nls iso8859-9
+CONFIG_NLS_ISO8859_9
+  ISO8859-9 is the Latin 5 character set, and it replaces the rarely
+  needed Icelandic letters in Latin 1 with the Turkish ones. Useful in
+  Turkey.
+
+nls iso8859-10
+CONFIG_NLS_ISO8859_10
+  ISO8859-10 is the Latin 6 character set, and it adds the last Inuit
+  (Greenlandic) and Sami (Lappish) letters that were missing in Latin 4 to
+  cover the entire Nordic area. 
+
+nls koi8-r
+CONFIG_NLS_KOI8_R
+  This is the preferred Russian character set.
+
+nls codepage 437
+CONFIG_NLS_CODEPAGE_437
+  This is the DOS codepage that is used in the United States and parts of
+  Canada.
+
+nls codepage 737
+CONFIG_NLS_CODEPAGE_737
+  This is the codepage used by DOS for Greek.
+
+nls codepage 775
+CONFIG_NLS_CODEPAGE_775
+  This is the codepage used by DOS for the Baltic Rim Languages.
+
+nls codepage 850
+CONFIG_NLS_CODEPAGE_850
+  This is the DOS codepage that is used in much of Europe--United Kingdom,
+  Germany, Spain, Italy, and [add more countries here]. It has some
+  characters useful to many European languages that are not part of
+  codepage 437.
+
+nls codepage 852
+CONFIG_NLS_CODEPAGE_852
+  This is the Latin 2 codepage used by DOS for much of Central and
+  Eastern Europe.  It has all the required characters for these languages:
+  Albanian, Croatian, Czech, English, Finnish, Hungarian, Irish, German,
+  Polish, Romanian, Serbian (Latin transcription), Slovak, Slovenian, and
+  Sorbian.
+
+nls codepage 855
+CONFIG_NLS_CODEPAGE_855
+  This is the DOS codepage that is used for Cyrillic.
+
+nls codepage 857
+CONFIG_NLS_CODEPAGE_857
+  This is the DOS codepage that is used for Turkish.
+
+nls codepage 860
+CONFIG_NLS_CODEPAGE_860
+  This is the DOS codepage that is used for Portuguese.
+
+nls codepage 861
+CONFIG_NLS_CODEPAGE_861
+  This is the DOS codepage that is used for Icelandic.
+
+nls codepage 862
+CONFIG_NLS_CODEPAGE_862
+  This is the DOS codepage that is used for Hebrew.
+
+nls codepage 863
+CONFIG_NLS_CODEPAGE_863
+  This is the DOS codepage that is used for Canadian French.
+
+nls codepage 864
+CONFIG_NLS_CODEPAGE_864
+  This is the DOS codepage that is used for Arabic.
+
+nls codepage 865
+CONFIG_NLS_CODEPAGE_865
+  This is the DOS codepage that is used in the Nordic European countries.
+
+nls codepage 866
+CONFIG_NLS_CODEPAGE_866
+  This is the DOS codepage that is used for Cyrillic/Russian.
+
+nls codepage 869
+CONFIG_NLS_CODEPAGE_869
+  This is the DOS codepage that is used for Greek.
+
+nls codepage 874
+CONFIG_NLS_CODEPAGE_874
+  This is the DOS codepage that is used for Thai.
+
 /proc filesystem support
 CONFIG_PROC_FS
   This is a virtual filesystem providing information about the status
index 36a1dfa..7290361 100644 (file)
@@ -4,6+4,8 @@ affs.txt
        - info and mount options for the Amiga Fast File System.
 hpfs.txt
        - info and mount options for the OS/2 HPFS.
+isofs.txt
+       - info and mount options for the ISO9660 (CDROM) filesystem.
 ncpfs.txt
        - info on Novell Netware(tm) filesystem using NCP protocol.
 romfs.txt
index 6f03cc7..050a430 100644 (file)
@@ -8,7+8,20 @@ if you want to format from within Linux.
 
 VFAT MOUNT OPTIONS
 ----------------------------------------------------------------------
-uni_xlate     -- Translate unhandled Unicode characters to special
+codepage=###  -- Sets the codepage for converting to shortname characters
+                on FAT and VFAT filesystems.  By default, codepage 437
+                is used.  This is the default for the U.S. and some
+                European countries.
+iocharset=name -- Character set to use for converting between 8 bit characters
+                and 16 bit Unicode characters. Long filenames are stored on
+                disk in Unicode format, but Unix for the most part doesn't
+                know how to deal with Unicode. There is also an option of
+                doing UTF8 translations with the utf8 option.
+utf8=<bool>   -- UTF8 is the filesystem safe version of Unicode that
+                is used by the console.  It can be be enabled for the
+                filesystem with this option. If 'uni_xlate' gets set,
+                UTF8 gets disabled.
+uni_xlate=<bool> -- Translate unhandled Unicode characters to special
                 escaped sequences.  This would let you backup and
                 restore filenames that are created with any Unicode
                 characters.  Until Linux supports Unicode for real,
@@ -18,11+31,11 @@ uni_xlate     -- Translate unhandled Unicode characters to special
                 illegal on the vfat filesystem.  The escape sequence
                 that gets used, where u is the unicode character, is:
                        ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12),
-posix         -- Allow names of same letters, different case such as
+posix=<bool>  -- Allow names of same letters, different case such as
                  'LongFileName' and 'longfilename' to coexist.  This has some
                  problems currently because 8.3 conflicts are not handled
                  correctly for Posix filesystem compliance.
-nonumtail     -- When creating 8.3 aliases, normally the alias will
+nonumtail=<bool> -- When creating 8.3 aliases, normally the alias will
                  end in '~1' or tilde followed by some number.  If this
                  option is set, then if the filename is 
                  "longfilename.txt" and "longfile.txt" does not
@@ -31,19+44,19 @@ nonumtail     -- When creating 8.3 aliases, normally the alias will
                   
 quiet         -- Stops printing certain warning messages.
 
+<bool>: 0,1,yes,no,true,false
 
 TODO
 ----------------------------------------------------------------------
+* When only shortnames exist, translate them from the codepage character
+  set to the iocharset.  Currently, translations only occur when longnames
+  exist.  To translate, first convert from codepage to Unicode and then
+  to the output character set.
+
 * Need to get rid of the raw scanning stuff.  Instead, always use
   a get next directory entry approach.  The only thing left that uses
   raw scanning is the directory renaming code.
 
-* Need to add dcache_lookup code msdos filesystem.  This means the
-  directories need to be versioned like the vfat filesystem.
-
-* Add support for different codepages.  Right now, we only support
-  the a single English codepage.
-
 * Fix the Posix filesystem support to work in 8.3 space.  This involves
   renaming aliases if a conflict occurs between a new filename and
   an old alias.  This is quite a mess.
@@ -55,11+68,12 @@ POSSIBLE PROBLEMS
 * When a volume name is the same as a directory name in the root
   directory of the filesystem, the directory name sometimes shows
   up empty an empty file.
+* autoconv option does not work correctly.
 
 BUG REPORTS
 ----------------------------------------------------------------------
 If you have trouble with the VFAT filesystem, mail bug reports to
-chaffee@bugs-bunny.cs.berkeley.edu.  Please specify the filename
+chaffee@bmrc.cs.berkeley.edu.  Please specify the filename
 and the operation that gave you trouble.
 
 TEST SUITE
@@ -67,7+81,7 @@ TEST SUITE
 If you plan to make any modifications to the vfat filesystem, please
 get the test suite that comes with the vfat distribution at
 
-  http://www-plateau.cs.berkeley.edu/people/chaffee/vfat.html
+  http://bmrc.berkeley.edu/people/chaffee/vfat.html
 
 This tests quite a few parts of the vfat filesystem and additional
 tests for new features or untested features would be appreciated.
@@ -194,271+208,3 @@ the following:
 
 Finally, note that the extended name is stored in Unicode.  Each Unicode
 character takes two bytes.
-
-
-NOTES ON UNICODE TRANSLATION IN VFAT FILESYSTEM
-----------------------------------------------------------------------
-(Information provided by Steve Searle <steve@mgu.bath.ac.uk>)
-
-Char used as   Char(s) used   Char(s) used in     Entries which have
-filename       in shortname   longname slot       been corrected
-0x80 (128)     0x80           0xC7                   
-0x81 (129)     0x9A           0xFC
-0x82 (130)     0x90           0xE9                     E
-0x83 (131)     0xB6           0xE2                     E
-0x84 (132)     0x8E           0xE4                     E
-0x85 (133)     0xB7           0xE0                     E
-0x86 (134)     0x8F           0xE5                     E
-0x87 (135)     0x80           0xE7                     E
-0x88 (136)     0xD2           0xEA                     E
-0x89 (137)     0xD3           0xEB                     E
-0x8A (138)     0xD4           0xE8                     E
-0x8B (139)     0xD8           0xEF                     E
-0x8C (140)     0xD7           0xEE                     E
-0x8D (141)     0xDE           0xEC                     E
-0x8E (142)     0x8E           0xC4                     E
-0x8F (143)     0x8F           0xC5                     E
-0x90 (144)     0x90           0xC9                     E
-0x91 (145)     0x92           0xE6                     E
-0x92 (146)     0x92           0xC6                     E
-0x93 (147)     0xE2           0xF4                     E
-0x94 (148)     0x99           0xF6
-0x95 (149)     0xE3           0xF2
-0x96 (150)     0xEA           0xFB
-0x97 (151)     0xEB           0xF9
-0x98 (152)     "_~1"          0xFF
-0x99 (153)     0x99           0xD6
-0x9A (154)     0x9A           0xDC
-0x9B (155)     0x9D           0xF8
-0x9C (156)     0x9C           0xA3
-0x9D (157)     0x9D           0xD8
-0x9E (158)     0x9E           0xD7
-0x9F (159)     0x9F           0x92
-0xA0 (160)     0xB5           0xE1
-0xA1 (161)     0xD6           0xE0
-0xA2 (162)     0xE0           0xF3
-0xA3 (163)     0xE9           0xFA
-0xA4 (164)     0xA5           0xF1
-0xA5 (165)     0xA5           0xD1
-0xA6 (166)     0xA6           0xAA
-0xA7 (167)     0xA7           0xBA
-0xA8 (168)     0xA8           0xBF
-0xA9 (169)     0xA9           0xAE
-0xAA (170)     0xAA           0xAC
-0xAB (171)     0xAB           0xBD
-0xAC (172)     0xAC           0xBC
-0xAD (173)     0xAD           0xA1
-0xAE (174)     0xAE           0xAB
-0xAF (175)     0xAF           0xBB
-0xB0 (176)     0xB0           0x91 0x25
-0xB1 (177)     0xB1           0x92 0x25
-0xB2 (178)     0xB2           0x93 0x25
-0xB3 (179)     0xB3           0x02 0x25
-0xB4 (180)     0xB4           0x24 0x25
-0xB5 (181)     0xB5           0xC1
-0xB6 (182)     0xB6           0xC2
-0xB7 (183)     0xB7           0xC0
-0xB8 (184)     0xB8           0xA9
-0xB9 (185)     0xB9           0x63 0x25
-0xBA (186)     0xBA           0x51 0x25
-0xBB (187)     0xBB           0x57 0x25
-0xBC (188)     0xBC           0x5D 0x25
-0xBD (189)     0xBD           0xA2
-0xBE (190)     0xBE           0xA5
-0xBF (191)     0xBF           0x10 0x25
-0xC0 (192)     0xC0           0x14 0x25
-0xC1 (193)     0xC1           0x34 0x25
-0xC2 (194)     0xC2           0x2C 0x25
-0xC3 (195)     0xC3           0x1C 0x25
-0xC4 (196)     0xC4           0x00 0x25
-0xC5 (197)     0xC5           0x3C 0x25
-0xC6 (198)     0xC7           0xE3                     E
-0xC7 (199)     0xC7           0xC3
-0xC8 (200)     0xC8           0x5A 0x25                E
-0xC9 (201)     0xC9           0x54 0x25                E
-0xCA (202)     0xCA           0x69 0x25                E
-0xCB (203)     0xCB           0x66 0x25                E
-0xCC (204)     0xCC           0x60 0x25                E
-0xCD (205)     0xCD           0x50 0x25                E
-0xCE (206)     0xCE           0x6C 0x25                E
-0xCF (207)     0xCF           0xA4                     E
-0xD0 (208)     0xD1           0xF0
-0xD1 (209)     0xD1           0xD0
-0xD2 (210)     0xD2           0xCA
-0xD3 (211)     0xD3           0xCB
-0xD4 (212)     0xD4           0xC8
-0xD5 (213)     0x49           0x31 0x01
-0xD6 (214)     0xD6           0xCD
-0xD7 (215)     0xD7           0xCE
-0xD8 (216)     0xD8           0xCF
-0xD9 (217)     0xD9           0x18 0x25
-0xDA (218)     0xDA           0x0C 0x25
-0xDB (219)     0xDB           0x88 0x25
-0xDC (220)     0xDC           0x84 0x25
-0xDD (221)     0xDD           0xA6
-0xDE (222)     0xDE           0xCC
-0xDF (223)     0xDF           0x80 0x25
-0xE0 (224)     0xE0           0xD3
-0xE1 (225)     0xE1           0xDF
-0xE2 (226)     0xE2           0xD4
-0xE3 (227)     0xE3           0xD2
-0xE4 (228)     0x05           0xF5
-0xE5 (229)     0x05           0xD5
-0xE6 (230)     0xE6           0xB5
-0xE7 (231)     0xE8           0xFE
-0xE8 (232)     0xE8           0xDE
-0xE9 (233)     0xE9           0xDA
-0xEA (234)     0xEA           0xDB
-0xEB (235)     0xEB           0xD9
-0xEC (236)     0xED           0xFD
-0xED (237)     0xED           0xDD
-0xEE (238)     0xEE           0xAF
-0xEF (239)     0xEF           0xB4
-0xF0 (240)     0xF0           0xAD
-0xF1 (241)     0xF1           0xB1
-0xF2 (242)     0xF2           0x17 0x20
-0xF3 (243)     0xF3           0xBE
-0xF4 (244)     0xF4           0xB6
-0xF5 (245)     0xF5           0xA7
-0xF6 (246)     0xF6           0xF7
-0xF7 (247)     0xF7           0xB8
-0xF8 (248)     0xF8           0xB0
-0xF9 (249)     0xF9           0xA8
-0xFA (250)     0xFA           0xB7
-0xFB (251)     0xFB           0xB9
-0xFC (252)     0xFC           0xB3
-0xFD (253)     0xFD           0xB2
-0xFE (254)     0xFE           0xA0 0x25
-0xFF (255)     0xFF           0xA0
-
-
-Page 0
-0x80 (128)     0x00
-0x81 (129)     0x00
-0x82 (130)     0x00
-0x83 (131)     0x00
-0x84 (132)     0x00
-0x85 (133)     0x00
-0x86 (134)     0x00
-0x87 (135)     0x00
-0x88 (136)     0x00
-0x89 (137)     0x00
-0x8A (138)     0x00
-0x8B (139)     0x00
-0x8C (140)     0x00
-0x8D (141)     0x00
-0x8E (142)     0x00
-0x8F (143)     0x00
-0x90 (144)     0x00
-0x91 (145)     0x00
-0x92 (146)     0x00
-0x93 (147)     0x00
-0x94 (148)     0x00
-0x95 (149)     0x00
-0x96 (150)     0x00
-0x97 (151)     0x00
-0x98 (152)     0x00
-0x99 (153)     0x00
-0x9A (154)     0x00
-0x9B (155)     0x00
-0x9C (156)     0x00
-0x9D (157)     0x00
-0x9E (158)     0x00
-0x9F (159)     0x92
-0xA0 (160)     0xFF
-0xA1 (161)     0xAD
-0xA2 (162)     0xBD
-0xA3 (163)     0x9C
-0xA4 (164)     0xCF
-0xA5 (165)     0xBE
-0xA6 (166)     0xDD
-0xA7 (167)     0xF5
-0xA8 (168)     0xF9
-0xA9 (169)     0xB8
-0xAA (170)     0x00
-0xAB (171)     0xAE
-0xAC (172)     0xAA
-0xAD (173)     0xF0
-0xAE (174)     0x00
-0xAF (175)     0xEE
-0xB0 (176)     0xF8
-0xB1 (177)     0xF1
-0xB2 (178)     0xFD
-0xB3 (179)     0xFC
-0xB4 (180)     0xEF
-0xB5 (181)     0xE6
-0xB6 (182)     0xF4
-0xB7 (183)     0xFA
-0xB8 (184)     0xF7
-0xB9 (185)     0xFB
-0xBA (186)     0x00
-0xBB (187)     0xAF
-0xBC (188)     0xAC
-0xBD (189)     0xAB
-0xBE (190)     0xF3
-0xBF (191)     0x00
-0xC0 (192)     0xB7
-0xC1 (193)     0xB5
-0xC2 (194)     0xB6
-0xC3 (195)     0xC7
-0xC4 (196)     0x8E
-0xC5 (197)     0x8F
-0xC6 (198)     0x92
-0xC7 (199)     0x80
-0xC8 (200)     0xD4
-0xC9 (201)     0x90
-0xCA (202)     0xD2
-0xCB (203)     0xD3
-0xCC (204)     0xDE
-0xCD (205)     0xD6
-0xCE (206)     0xD7
-0xCF (207)     0xD8
-0xD0 (208)     0x00
-0xD1 (209)     0xA5
-0xD2 (210)     0xE3
-0xD3 (211)     0xE0
-0xD4 (212)     0xE2
-0xD5 (213)     0xE5
-0xD6 (214)     0x99
-0xD7 (215)     0x9E
-0xD8 (216)     0x9D
-0xD9 (217)     0xEB
-0xDA (218)     0xE9
-0xDB (219)     0xEA
-0xDC (220)     0x9A
-0xDD (221)     0xED
-0xDE (222)     0xE8
-0xDF (223)     0xE1
-0xE0 (224)     0x85, 0xA1
-0xE1 (225)     0xA0
-0xE2 (226)     0x83
-0xE3 (227)     0xC6
-0xE4 (228)     0x84
-0xE5 (229)     0x86
-0xE6 (230)     0x91
-0xE7 (231)     0x87
-0xE8 (232)     0x8A
-0xE9 (233)     0x82
-0xEA (234)     0x88
-0xEB (235)     0x89
-0xEC (236)     0x8D
-0xED (237)     0x00
-0xEE (238)     0x8C
-0xEF (239)     0x8B
-0xF0 (240)     0xD0
-0xF1 (241)     0xA4
-0xF2 (242)     0x95
-0xF3 (243)     0xA2
-0xF4 (244)     0x93
-0xF5 (245)     0xE4
-0xF6 (246)     0x94
-0xF7 (247)     0xF6
-0xF8 (248)     0x9B
-0xF9 (249)     0x97
-0xFA (250)     0xA3
-0xFB (251)     0x96
-0xFC (252)     0x81
-0xFD (253)     0xEC
-0xFE (254)     0xE7
-0xFF (255)     0x98
-
index 93763f0..f2eb76c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6+1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 59
+SUBLEVEL = 60
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
 
@@ -308,6+308,7 @@ modules_install:
        if [ -f IPV6_MODULES  ]; then inst_mod IPV6_MODULES  ipv6;  fi; \
        if [ -f SCSI_MODULES  ]; then inst_mod SCSI_MODULES  scsi;  fi; \
        if [ -f FS_MODULES    ]; then inst_mod FS_MODULES    fs;    fi; \
+       if [ -f NLS_MODULES   ]; then inst_mod NLS_MODULES   fs;    fi; \
        if [ -f CDROM_MODULES ]; then inst_mod CDROM_MODULES cdrom; fi; \
        \
        ls *.o > .allmods; \
index 71c310a..9c74cc0 100644 (file)
@@ -154,6+154,8 @@ endmenu
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 source drivers/char/Config.in
 if [ "$CONFIG_RTC" != "n" ]; then
   bool '  ARC console time' CONFIG_RTC_ARC y
index 5ba5506..75c0665 100644 (file)
 #define rti    .long PAL_rti
 #define SIGCHLD        20
 
-#define NR_SYSCALLS 350
+#define NR_SYSCALLS 352
 #define osf_vfork sys_fork
 
 /*
@@ -771,5+771,5 @@ sys_call_table:
        .quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname
        .quad sys_nanosleep, sys_mremap, sys_nfsservctl, sys_setresuid, sys_getresuid
        .quad sys_pciconfig_read, sys_pciconfig_write, sys_query_module
-       .quad sys_prctl
+       .quad sys_prctl, sys_pread, sys_pwrite
        .quad do_entSys, do_entSys
index 50d9de2..f7042fa 100644 (file)
@@ -104,6+104,8 @@ endmenu
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 source drivers/char/Config.in
 
 mainmenu_option next_comment
index 25d6ded..569da18 100644 (file)
@@ -209,6+209,8 @@ fi
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 mainmenu_option next_comment
 comment 'Character devices'
 
index d08548d..b1e325f 100644 (file)
@@ -181,6+181,8 @@ fi
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 if [ "$CONFIG_SGI" != "y" ]; then
   source drivers/char/Config.in
 
index dabd917..ea607aa 100644 (file)
@@ -683,9+683,12 @@ static inline int do_load_irix_binary(struct linux_binprm * bprm,
                }
        }
        
-       /* OK, This is the point of no return. */
-       flush_old_exec(bprm);
+       /* Flush all traces of the currently running executable */
+       retval = flush_old_exec(bprm);
+       if (retval)
+               return retval;
 
+       /* OK, This is the point of no return */
        current->mm->end_data = 0;
        current->mm->end_code = 0;
        current->mm->start_mmap = ELF_START_MMAP;
index 1cea7ce..cdd5c4a 100644 (file)
@@ -108,6+108,8 @@ endmenu
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 source drivers/char/Config.in
 
 mainmenu_option next_comment
index fa8267d..7b88b03 100644 (file)
@@ -145,6+145,8 @@ fi
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 mainmenu_option next_comment
 comment 'Watchdog'
 
index c3c438d..13f0560 100644 (file)
@@ -183,6+183,8 @@ fi
 
 source fs/Config.in
 
+source fs/nls/Config.in
+
 mainmenu_option next_comment
 comment 'Kernel hacking'
 
index 215aaf0..98066a3 100644 (file)
@@ -256,6+256,7 @@ static inline int do_load_aout32_binary(struct linux_binprm * bprm,
        unsigned long p = bprm->p;
        unsigned long fd_offset;
        unsigned long rlim;
+       int retval;
 
        ex = *((struct exec *) bprm->buf);              /* exec-header */
        if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
@@ -278,8+279,12 @@ static inline int do_load_aout32_binary(struct linux_binprm * bprm,
        if (ex.a_data + ex.a_bss > rlim)
                return -ENOMEM;
 
+       /* Flush all traces of the currently running executable */
+       retval = flush_old_exec(bprm);
+       if (retval)
+               return retval;
+
        /* OK, This is the point of no return */
-       flush_old_exec(bprm);
        memcpy(&current->tss.core_exec, &ex, sizeof(struct exec));
 
        current->mm->end_code = ex.a_text +
index fcecad8..28b9d02 100644 (file)
@@ -3463,20+3463,22 @@ static void config_types(void)
                printk("\n");
 }
 
-static long floppy_read(struct inode * inode, struct file * filp,
-                      char * buf, unsigned long count)
+static ssize_t floppy_read(struct file * filp, char *buf,
+                          size_t count, loff_t *ppos)
 {
+       struct inode *inode = filp->f_dentry->d_inode;
        int drive = DRIVE(inode->i_rdev);
 
        check_disk_change(inode->i_rdev);
        if (UTESTF(FD_DISK_CHANGED))
                return -ENXIO;
-       return block_read(inode, filp, buf, count);
+       return block_read(filp, buf, count, ppos);
 }
 
-static long floppy_write(struct inode * inode, struct file * filp,
-                       const char * buf, unsigned long count)
+static ssize_t floppy_write(struct file * filp, const char * buf,
+                           size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        int block;
        int ret;
        int drive = DRIVE(inode->i_rdev);
@@ -3488,9+3490,9 @@ static long floppy_write(struct inode * inode, struct file * filp,
                return -ENXIO;
        if (!UTESTF(FD_DISK_WRITABLE))
                return -EROFS;
-       block = (filp->f_pos + count) >> 9;
+       block = (*ppos + count) >> 9;
        INFBOUND(UDRS->maxblock, block);
-       ret= block_write(inode, filp, buf, count);
+       ret= block_write(filp, buf, count, ppos);
        return ret;
 }
 
index 2fc5f0b..4df3551 100644 (file)
@@ -2883,11+2883,18 @@ static int idetape_space_over_filemarks (ide_drive_t *drive,short mt_op,int mt_c
  *     size will only result in a (slightly) increased driver overhead, but
  *     will no longer hit performance.
  */
-static long idetape_chrdev_read (struct inode *inode, struct file *file, char *buf, unsigned long count)
+static ssize_t idetape_chrdev_read (struct file *file, char *buf,
+                                   size_t count, loff_t *ppos)
 {
+       struct inode *inode = file->f_dentry->d_inode;
        ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
        idetape_tape_t *tape = drive->driver_data;
-       int bytes_read,temp,actually_read=0;
+       ssize_t bytes_read,temp,actually_read=0;
+
+       if (ppos != &file->f_pos) {
+               /* "A request was outside the capabilities of the device." */
+               return -ENXIO;
+       }
 
 #if IDETAPE_DEBUG_LOG
        printk (KERN_INFO "Reached idetape_chrdev_read\n");
@@ -2953,11+2960,18 @@ finish:
        return (actually_read);
 }
  
-static long idetape_chrdev_write (struct inode *inode, struct file *file, const char *buf, unsigned long count)
+static ssize_t idetape_chrdev_write (struct file *file, const char *buf,
+                                    size_t count, loff_t *ppos)
 {
+       struct inode *inode = file->f_dentry->d_inode;
        ide_drive_t *drive = get_drive_ptr (inode->i_rdev);
        idetape_tape_t *tape = drive->driver_data;
-       int retval,actually_written=0;
+       ssize_t retval,actually_written=0;
+
+       if (ppos != &file->f_pos) {
+               /* "A request was outside the capabilities of the device." */
+               return -ENXIO;
+       }
 
 #if IDETAPE_DEBUG_LOG
        printk (KERN_INFO "Reached idetape_chrdev_write\n");
index 8f8ba19..9a64e1c 100644 (file)
@@ -374,26+374,26 @@ static int md_release (struct inode *inode, struct file *file)
 }
 
 
-static long md_read (struct inode *inode, struct file *file,
-                   char *buf, unsigned long count)
+static ssize_t md_read (struct file *file, char *buf, size_t count,
+                       loff_t *ppos)
 {
-  int minor=MINOR(inode->i_rdev);
+  int minor=MINOR(file->f_dentry->d_inode->i_rdev);
 
   if (!md_dev[minor].pers)     /* Check if device is being run */
     return -ENXIO;
 
-  return block_read (inode, file, buf, count);
+  return block_read(file, buf, count, ppos);
 }
 
-static long md_write (struct inode *inode, struct file *file,
-                    const char *buf, unsigned long count)
+static ssize_t md_write (struct file *file, const char *buf,
+                        size_t count, loff_t *ppos)
 {
-  int minor=MINOR(inode->i_rdev);
+  int minor=MINOR(file->f_dentry->d_inode->i_rdev);
 
   if (!md_dev[minor].pers)     /* Check if device is being run */
     return -ENXIO;
 
-  return block_write (inode, file, buf, count);
+  return block_write(file, buf, count, ppos);
 }
 
 static struct file_operations md_fops=
index 759dbbc..b57fc79 100644 (file)
@@ -184,16+184,16 @@ static int rd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 
 #ifdef CONFIG_BLK_DEV_INITRD
 
-static long initrd_read(struct inode *inode,struct file *file,
-       char *buf, unsigned long count)
+static ssize_t initrd_read(struct file *file, char *buf,
+                          size_t count, loff_t *ppos)
 {
        int left;
 
-       left = initrd_end-initrd_start-file->f_pos;
+       left = initrd_end - initrd_start - *ppos;
        if (count > left) count = left;
        if (count == 0) return 0;
-       copy_to_user(buf,(char *) initrd_start+file->f_pos,count);
-       file->f_pos += count;
+       copy_to_user(buf, (char *)initrd_start + *ppos, count);
+       *ppos += count;
        return count;
 }
 
@@ -363,7+363,7 @@ identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
                fp->f_op->llseek(fp, start_block * BLOCK_SIZE, 0);
        fp->f_pos = start_block * BLOCK_SIZE;
        
-       fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size);
+       fp->f_op->read(fp, buf, size, &fp->f_pos);
 
        /*
         * If it matches the gzip magic numbers, return -1
@@ -393,7+393,7 @@ identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
                fp->f_op->llseek(fp, (start_block+1) * BLOCK_SIZE, 0);
        fp->f_pos = (start_block+1) * BLOCK_SIZE;
 
-       fp->f_op->read(fp->f_dentry->d_inode, fp, buf, size);
+       fp->f_op->read(fp, buf, size, &fp->f_pos);
                
        /* Try minix */
        if (minixsb->s_magic == MINIX_SUPER_MAGIC ||
@@ -510,10+510,8 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
 
        printk(KERN_NOTICE "RAMDISK: Loading %d blocks into ram disk... ", nblocks);
        for (i=0; i < nblocks; i++) {
-               infile.f_op->read(infile.f_dentry->d_inode, &infile, buf,
-                                 BLOCK_SIZE);
-               outfile.f_op->write(outfile.f_dentry->d_inode, &outfile, buf,
-                                   BLOCK_SIZE);
+               infile.f_op->read(&infile, buf, BLOCK_SIZE, &infile.f_pos);
+               outfile.f_op->write(&outfile, buf, BLOCK_SIZE, &outfile.f_pos);
                if (!(i % 16)) {
                        printk("%c\b", rotator[rotate & 0x3]);
                        rotate++;
@@ -641,8+639,8 @@ __initfunc(static int fill_inbuf(void))
 {
        if (exit_code) return -1;
        
-       insize = crd_infp->f_op->read(crd_infp->f_dentry->d_inode, crd_infp,
-                                     inbuf, INBUFSIZ);
+       insize = crd_infp->f_op->read(crd_infp, inbuf, INBUFSIZ,
+                                     &crd_infp->f_pos);
        if (insize == 0) return -1;
 
        inptr = 1;
@@ -660,8+658,7 @@ __initfunc(static void flush_window(void))
     unsigned n;
     uch *in, ch;
     
-    crd_outfp->f_op->write(crd_outfp->f_dentry->d_inode, crd_outfp, window,
-                          outcnt);
+    crd_outfp->f_op->write(crd_outfp, window, outcnt, &crd_outfp->f_pos);
     in = window;
     for (n = 0; n < outcnt; n++) {
            ch = *in++;
index 94c207e..177862c 100644 (file)
@@ -36,11+36,10 @@ void isdn_init(void);
 void pcwatchdog_init(void);
 #endif
 
-static long do_write_mem(struct file * file,
-       void *p, unsigned long realp,                                    
-       const char * buf, unsigned long count)
+static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp,
+                           const char * buf, size_t count, loff_t *ppos)
 {
-       unsigned long written;
+       ssize_t written;
 
        written = 0;
 #if defined(__sparc__) || defined(__mc68000__)
@@ -58,8+57,8 @@ static long do_write_mem(struct file * file,
        if (copy_from_user(p, buf, count) < 0) 
                return -EFAULT;
        written += count;
-       file->f_pos += written;
-       return count;
+       *ppos += written;
+       return written;
 }
 
 
@@ -67,12+66,12 @@ static long do_write_mem(struct file * file,
  * This funcion reads the *physical* memory. The f_pos points directly to the 
  * memory location. 
  */
-static long read_mem(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t read_mem(struct file * file, char * buf,
+                       size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos;
+       unsigned long p = *ppos;
        unsigned long end_mem;
-       unsigned long read;
+       ssize_t read;
        
        end_mem = __pa(high_memory);
        if (p >= end_mem)
@@ -99,14+98,14 @@ static long read_mem(struct inode * inode, struct file * file,
        if (copy_to_user(buf, __va(p), count) < 0)
                return -EFAULT;
        read += count;
-       file->f_pos += read;
+       *ppos += read;
        return read;
 }
 
-static long write_mem(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_mem(struct file * file, const char * buf, 
+                        size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos;
+       unsigned long p = *ppos;
        unsigned long end_mem;
 
        end_mem = __pa(high_memory);
@@ -114,7+113,7 @@ static long write_mem(struct inode * inode, struct file * file,
                return 0;
        if (count > end_mem - p)
                count = end_mem - p;
-       return do_write_mem(file,__va(p),p,buf,count);
+       return do_write_mem(file, __va(p), p, buf, count, ppos);
 }
 
 static int mmap_mem(struct file * file, struct vm_area_struct * vma)
@@ -135,9+134,10 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
 #endif
 #ifdef __powerpc__
        if (offset >= __pa(high_memory))
-               pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE | _PAGE_GUARDED;
+               pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE|_PAGE_GUARDED;
 #endif
-       if (remap_page_range(vma->vm_start, offset, vma->vm_end - vma->vm_start, vma->vm_page_prot))
+       if (remap_page_range(vma->vm_start, offset, vma->vm_end-vma->vm_start,
+                            vma->vm_page_prot))
                return -EAGAIN;
        vma->vm_dentry = dget(file->f_dentry);
        return 0;
@@ -146,61+146,63 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
 /*
  * This function reads the *virtual* memory as seen by the kernel.
  */
-static long read_kmem(struct inode *inode, struct file *file,
-       char *buf, unsigned long count)
+static ssize_t read_kmem(struct file *file, char *buf, 
+                        size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos;
-       unsigned long read = 0;
-       long virtr;
+       unsigned long p = *ppos;
+       ssize_t read = 0;
+       ssize_t virtr;
                
        if (p < (unsigned long) high_memory) { 
-               unsigned long tmp;
-               
+               read = count;
                if (count > (unsigned long) high_memory - p)
-                       tmp = (unsigned long) high_memory - p;
-               else
-                       tmp = count;
-               read = tmp;
+                       read = (unsigned long) high_memory - p;
+
 #if defined(__sparc__) || defined(__mc68000__)
                /* we don't have page 0 mapped on sparc and m68k.. */
-               while (p < PAGE_SIZE && tmp > 0) {
-                       put_user(0,buf);
-                       buf++;
-                       p++;
-                       tmp--;
+               if (p < PAGE_SIZE && read > 0) {
+                       size_t tmp = PAGE_SIZE - p;
+                       if (tmp > read) tmp = read;
+                       clear_user(buf, tmp);
+                       buf += tmp;
+                       p += tmp;
+                       read -= tmp;
+                       count -= tmp;
                }
 #endif
-               copy_to_user(buf, (char *) p, tmp);
-               buf += tmp;
+               copy_to_user(buf, (char *)p, read);
+               p += read;
+               buf += read;
+               count -= read;
        }
 
-       virtr = vread(buf, (char *) (unsigned long) file->f_pos, count - read);
+       virtr = vread(buf, (char *)p, count);
        if (virtr < 0)
                return virtr;
-       file->f_pos += virtr + read;
+       *ppos += p + virtr;
        return virtr + read;
 }
 
 /*
  * This function writes to the *virtual* memory as seen by the kernel.
  */
-static long write_kmem(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_kmem(struct file * file, const char * buf, 
+                         size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos;
+       unsigned long p = *ppos;
 
        if (p >= (unsigned long) high_memory)
                return 0;
        if (count > (unsigned long) high_memory - p)
                count = (unsigned long) high_memory - p;
-       return do_write_mem(file,(void*)p,p,buf,count);
+       return do_write_mem(file, (void*)p, p, buf, count, ppos);
 }
 
-static long read_port(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t read_port(struct file * file, char * buf,
+                        size_t count, loff_t *ppos)
 {
-       unsigned int i = file->f_pos;
-       char * tmp = buf;
+       unsigned long i = *ppos;
+       char *tmp = buf;
 
        if (verify_area(VERIFY_WRITE,buf,count))
                return -EFAULT; 
@@ -210,14+212,14 @@ static long read_port(struct inode * inode, struct file * file,
                i++;
                tmp++;
        }
-       file->f_pos = i;
+       *ppos = i;
        return tmp-buf;
 }
 
-static long write_port(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_port(struct file * file, const char * buf,
+                         size_t count, loff_t *ppos)
 {
-       unsigned int i = file->f_pos;
+       unsigned long i = *ppos;
        const char * tmp = buf;
 
        if (verify_area(VERIFY_READ,buf,count))
@@ -230,18+232,18 @@ static long write_port(struct inode * inode, struct file * file,
                i++;
                tmp++;
        }
-       file->f_pos = i;
+       *ppos = i;
        return tmp-buf;
 }
 
-static long read_null(struct inode * node, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t read_null(struct file * file, char * buf,
+                        size_t count, loff_t *ppos)
 {
        return 0;
 }
 
-static long write_null(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_null(struct file * file, const char * buf,
+                         size_t count, loff_t *ppos)
 {
        return count;
 }
@@ -249,7+251,7 @@ static long write_null(struct inode * inode, struct file * file,
 /*
  * For fun, we are using the MMU for this.
  */
-static inline unsigned long read_zero_pagealigned(char * buf, unsigned long size)
+static inline size_t read_zero_pagealigned(char * buf, size_t size)
 {
        struct vm_area_struct * vma;
        unsigned long addr=(unsigned long)buf;
@@ -292,8+294,8 @@ static inline unsigned long read_zero_pagealigned(char * buf, unsigned long size
        return size;
 }
 
-static long read_zero(struct inode * node, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t read_zero(struct file * file, char * buf, 
+                        size_t count, loff_t *ppos)
 {
        unsigned long left, unwritten, written = 0;
 
@@ -339,21+341,23 @@ static int mmap_zero(struct file * file, struct vm_area_struct * vma)
        return 0;
 }
 
-static long write_full(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_full(struct file * file, const char * buf,
+                         size_t count, loff_t *ppos)
 {
        return -ENOSPC;
 }
 
 /*
- * Special lseek() function for /dev/null and /dev/zero.  Most notably, you can fopen()
- * both devices with "a" now.  This was previously impossible.  SRB.
+ * Special lseek() function for /dev/null and /dev/zero.  Most notably, you
+ * can fopen() both devices with "a" now.  This was previously impossible.
+ * -- SRB.
  */
 
-static long long null_lseek(struct file * file, long long offset, int orig)
+static loff_t null_lseek(struct file * file, loff_t offset, int orig)
 {
-       return file->f_pos=0;
+       return file->f_pos = 0;
 }
+
 /*
  * The memory devices use the full 32/64 bits of the offset, and so we cannot
  * check against negative addresses: they are ok. The return value is weird,
@@ -362,7+366,7 @@ static long long null_lseek(struct file * file, long long offset, int orig)
  * also note that seeking relative to the "end of file" isn't supported:
  * it has no meaning, so it returns -EINVAL.
  */
-static long long memory_lseek(struct file * file, long long offset, int orig)
+static loff_t memory_lseek(struct file * file, loff_t offset, int orig)
 {
        switch (orig) {
                case 0:
index f6a02b7..3581b81 100644 (file)
@@ -88,9+88,8 @@ void n_tty_flush_buffer(struct tty_struct * tty)
 
 /*
  * Return number of characters buffered to be delivered to user
- * 
  */
-int n_tty_chars_in_buffer(struct tty_struct *tty)
+ssize_t n_tty_chars_in_buffer(struct tty_struct *tty)
 {
        if (tty->icanon) {
                if (!tty->canon_data) return 0;
@@ -817,10+816,10 @@ static inline int input_available_p(struct tty_struct *tty, int amt)
  */
 static inline void copy_from_read_buf(struct tty_struct *tty,
                                      unsigned char **b,
-                                     unsigned int *nr)
+                                     size_t *nr)
 
 {
-       int     n;
+       ssize_t n;
 
        n = MIN(*nr, MIN(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail));
        if (!n)
@@ -832,15+831,15 @@ static inline void copy_from_read_buf(struct tty_struct *tty,
        *nr -= n;
 }
 
-static int read_chan(struct tty_struct *tty, struct file *file,
-                    unsigned char *buf, unsigned int nr)
+static ssize_t read_chan(struct tty_struct *tty, struct file *file,
+                        unsigned char *buf, size_t nr)
 {
        struct wait_queue wait = { current, NULL };
        int c;
        unsigned char *b = buf;
        int minimum, time;
-       int retval = 0;
-       int size;
+       ssize_t retval = 0;
+       ssize_t size;
 
 do_it_again:
 
@@ -1004,13+1003,13 @@ do_it_again:
        return (size ? size : retval);
 }
 
-static int write_chan(struct tty_struct * tty, struct file * file,
-                     const unsigned char * buf, unsigned int nr)
+static ssize_t write_chan(struct tty_struct * tty, struct file * file,
+                         const unsigned char * buf, size_t nr)
 {
        struct wait_queue wait = { current, NULL };
-       int c, num;
+       int c;
        const unsigned char *b = buf;
-       int retval = 0;
+       ssize_t retval = 0, num;
 
        /* Job control check -- must be done at start (POSIX.1 7.1.1.4). */
        if (L_TOSTOP(tty) && file->f_dentry->d_inode->i_rdev != CONSOLE_DEV) {
index 9a90ffc..a769cee 100644 (file)
@@ -302,13+302,13 @@ static int open_aux(struct inode * inode, struct file * file)
  * Write to the aux device.
  */
 
-static long write_aux(struct inode * inode, struct file * file,
-       const char * buffer, unsigned long count)
+static ssize_t write_aux(struct file * file, const char * buffer,
+                        size_t count, loff_t *ppos)
 {
-       int retval = 0;
+       ssize_t retval = 0;
 
        if (count) {
-               int written = 0;
+               ssize_t written = 0;
 
                aux_start_atomic();
                do {
@@ -326,7+326,7 @@ static long write_aux(struct inode * inode, struct file * file,
                retval = -EIO;
                if (written) {
                        retval = written;
-                       inode->i_mtime = CURRENT_TIME;
+                       file->f_dentry->d_inode->i_mtime = CURRENT_TIME;
                }
        }
 
@@ -449,10+449,10 @@ static int open_qp(struct inode * inode, struct file * file)
  * Write to the 82C710 mouse device.
  */
 
-static long write_qp(struct inode * inode, struct file * file,
-       const char * buffer, unsigned long count)
+static ssize_t write_qp(struct file * file, const char * buffer,
+                       size_t count, loff_t *ppos)
 {
-       int i = count;
+       ssize_t i = count;
 
        while (i--) {
                char c;
@@ -461,7+461,7 @@ static long write_qp(struct inode * inode, struct file * file,
                get_user(c, buffer++);
                outb_p(c, qp_data);
        }
-       inode->i_mtime = CURRENT_TIME;
+       file->f_dentry->d_inode->i_mtime = CURRENT_TIME;
        return count;
 }
 
@@ -527,11+527,11 @@ __initfunc(static int probe_qp(void))
  * Put bytes from input queue to buffer.
  */
 
-static long read_aux(struct inode * inode, struct file * file,
-       char * buffer, unsigned long count)
+static ssize_t read_aux(struct file * file, char * buffer,
+                       size_t count, loff_t *ppos)
 {
        struct wait_queue wait = { current, NULL };
-       int i = count;
+       ssize_t i = count;
        unsigned char c;
 
        if (queue_empty()) {
@@ -554,7+554,7 @@ repeat:
        }
        aux_ready = !queue_empty();
        if (count-i) {
-               inode->i_atime = CURRENT_TIME;
+               file->f_dentry->d_inode->i_atime = CURRENT_TIME;
                return count-i;
        }
        if (signal_pending(current))
index e5ecf0c..6b8a2f1 100644 (file)
@@ -346,13+346,13 @@ static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV];
 static struct wait_queue *random_read_wait;
 static struct wait_queue *random_write_wait;
 
-static long random_read(struct inode * inode, struct file * file,
-                      char * buf, unsigned long nbytes);
-static long random_read_unlimited(struct inode * inode, struct file * file,
-                                char * buf, unsigned long nbytes);
+static ssize_t random_read(struct file * file, char * buf,
+                          size_t nbytes, loff_t *ppos);
+static ssize_t random_read_unlimited(struct file * file, char * buf,
+                                    size_t nbytes, loff_t *ppos);
 static unsigned int random_poll(struct file *file, poll_table * wait);
-static long random_write(struct inode * inode, struct file * file,
-                       const char * buffer, unsigned long count);
+static ssize_t random_write(struct file * file, const char * buffer,
+                           size_t count, loff_t *ppos);
 static int random_ioctl(struct inode * inode, struct file * file,
                        unsigned int cmd, unsigned long arg);
 
@@ -983,10+983,10 @@ static void MD5Transform(__u32 buf[4],
  * bits of entropy are left in the pool, but it does not restrict the
  * number of bytes that are actually obtained.
  */
-static int extract_entropy(struct random_bucket *r, char * buf,
-                                 int nbytes, int to_user)
+static ssize_t extract_entropy(struct random_bucket *r, char * buf,
+                              size_t nbytes, int to_user)
 {
-       int ret, i;
+       ssize_t ret, i;
        __u32 tmp[HASH_BUFFER_SIZE];
        char *cp,*dp;
 
@@ -1075,13+1075,11 @@ void get_random_bytes(void *buf, int nbytes)
        extract_entropy(&random_state, (char *) buf, nbytes, 0);
 }
 
-static long
-random_read(struct inode * inode, struct file * file, char * buf, unsigned long nbytes)
+static ssize_t
+random_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
 {
        struct wait_queue       wait = { current, NULL };
-       int                     n;
-       int                     retval = 0;
-       int                     count = 0;
+       ssize_t                 n, retval = 0, count = 0;
        
        if (nbytes == 0)
                return 0;
@@ -1121,19+1119,18 @@ random_read(struct inode * inode, struct file * file, char * buf, unsigned long
        remove_wait_queue(&random_read_wait, &wait);
 
        /*
-        * If we gave the user some bytes and we have an inode pointer,
-        * update the access time.
+        * If we gave the user some bytes, update the access time.
         */
-       if (inode && count != 0) {
-               UPDATE_ATIME(inode);
+       if (count != 0) {
+               UPDATE_ATIME(file->f_dentry->d_inode);
        }
        
        return (count ? count : retval);
 }
 
-static long
-random_read_unlimited(struct inode * inode, struct file * file,
-                     char * buf, unsigned long nbytes)
+static ssize_t
+random_read_unlimited(struct file * file, char * buf,
+                     size_t nbytes, loff_t *ppos)
 {
        return extract_entropy(&random_state, buf, nbytes, 1);
 }
@@ -1153,14+1150,14 @@ random_poll(struct file *file, poll_table * wait)
        return mask;
 }
 
-static long
-random_write(struct inode * inode, struct file * file,
-            const char * buffer, unsigned long count)
+static ssize_t
+random_write(struct file * file, const char * buffer,
+            size_t count, loff_t *ppos)
 {
-       int             i, bytes, ret = 0;
+       ssize_t         i, bytes, ret = 0;
        __u32           buf[16];
        const char      *p = buffer;
-       int             c = count;
+       ssize_t         c = count;
 
        while (c > 0) {
                bytes = MIN(c, sizeof(buf));
@@ -1179,9+1176,9 @@ random_write(struct inode * inode, struct file * file,
                while (i--)
                        add_entropy_word(&random_state, buf[i]);
        }
-       if ((ret > 0) && inode) {
-               inode->i_mtime = CURRENT_TIME;
-               mark_inode_dirty(inode);
+       if (ret > 0) {
+               file->f_dentry->d_inode->i_mtime = CURRENT_TIME;
+               mark_inode_dirty(file->f_dentry->d_inode);
        }
        return ret;
 }
@@ -1265,7+1262,8 @@ random_ioctl(struct inode * inode, struct file * file,
                retval = verify_area(VERIFY_READ, (void *) p, size);
                if (retval)
                        return retval;
-               retval = random_write(0, file, (const char *) p, size);
+               retval = random_write(file, (const char *) p,
+                                     size, &file->f_pos);
                if (retval < 0)
                        return retval;
                /*
index c310fe9..26cfa47 100644 (file)
@@ -78,8+78,8 @@ static struct timer_list rtc_irq_timer;
 
 static long long rtc_llseek(struct file *file, loff_t offset, int origin);
 
-static long rtc_read(struct inode *inode, struct file *file,
-                       char *buf, unsigned long count);
+static ssize_t rtc_read(struct file *file, char *buf,
+                       size_t count, loff_t *ppos);
 
 static int rtc_ioctl(struct inode *inode, struct file *file,
                        unsigned int cmd, unsigned long arg);
@@ -146,11+146,12 @@ static long long rtc_llseek(struct file *file, loff_t offset, int origin)
        return -ESPIPE;
 }
 
-static long rtc_read(struct inode *inode, struct file *file, char *buf,
-                    unsigned long count)
+static ssize_t rtc_read(struct file *file, char *buf,
+                       size_t count, loff_t *ppos)
 {
        struct wait_queue wait = { current, NULL };
-       int retval = 0;
+       unsigned long data;
+       ssize_t retval;
        
        if (count < sizeof(unsigned long))
                return -EINVAL;
@@ -159,30+160,22 @@ static long rtc_read(struct inode *inode, struct file *file, char *buf,
 
        current->state = TASK_INTERRUPTIBLE;
                
-       while (rtc_irq_data == 0) {
+       while ((data = xchg(&rtc_irq_data, 0)) == 0) {
                if (file->f_flags & O_NONBLOCK) {
                        retval = -EAGAIN;
-                       break;
+                       goto out;
                }
                if (signal_pending(current)) {
                        retval = -ERESTARTSYS;
-                       break;
+                       goto out;
                }
                schedule();
        }
 
-       if (retval == 0) {
-               unsigned long data, flags;
-               save_flags(flags);
-               cli();
-               data = rtc_irq_data;
-               rtc_irq_data = 0;
-               restore_flags(flags);
-               retval = put_user(data, (unsigned long *)buf); 
-               if (!retval)
-                       retval = sizeof(unsigned long); 
-       }
-
+       retval = put_user(data, (unsigned long *)buf); 
+       if (!retval)
+               retval = sizeof(unsigned long); 
+out:
        current->state = TASK_RUNNING;
        remove_wait_queue(&rtc_wait, &wait);
 
index c6aa9ff..7fdbdf7 100644 (file)
@@ -108,8+108,8 @@ struct tty_struct * redirect = NULL;
 
 static void initialize_tty_struct(struct tty_struct *tty);
 
-static long tty_read(struct inode *, struct file *, char *, unsigned long);
-static long tty_write(struct inode *, struct file *, const char *, unsigned long);
+static ssize_t tty_read(struct file *, char *, size_t, loff_t *);
+static ssize_t tty_write(struct file *, const char *, size_t, loff_t *);
 static unsigned int tty_poll(struct file *, poll_table *);
 static int tty_open(struct inode *, struct file *);
 static int tty_release(struct inode *, struct file *);
@@ -304,15+304,21 @@ int tty_check_change(struct tty_struct * tty)
        return -ERESTARTSYS;
 }
 
-static long hung_up_tty_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t hung_up_tty_read(struct file * file, char * buf,
+                               size_t count, loff_t *ppos)
 {
+       /* Can't seek (pread) on ttys.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
        return 0;
 }
 
-static long hung_up_tty_write(struct inode * inode,
-       struct file * file, const char * buf, unsigned long count)
+static ssize_t hung_up_tty_write(struct file * file, const char * buf,
+                                size_t count, loff_t *ppos)
 {
+       /* Can't seek (pwrite) on ttys.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
        return -EIO;
 }
 
@@ -543,13+549,19 @@ void start_tty(struct tty_struct *tty)
        wake_up_interruptible(&tty->write_wait);
 }
 
-static long tty_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t tty_read(struct file * file, char * buf, size_t count, 
+                       loff_t *ppos)
 {
        int i;
        struct tty_struct * tty;
+       struct inode *inode;
+
+       /* Can't seek (pread) on ttys.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
 
        tty = (struct tty_struct *)file->private_data;
+       inode = file->f_dentry->d_inode;
        if (tty_paranoia_check(tty, inode->i_rdev, "tty_read"))
                return -EIO;
        if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
@@ -584,15+596,14 @@ static long tty_read(struct inode * inode, struct file * file,
  * Split writes up in sane blocksizes to avoid
  * denial-of-service type attacks
  */
-static inline int do_tty_write(
-       int (*write)(struct tty_struct *, struct file *, const unsigned char *, unsigned int),
-       struct inode *inode,
+static inline ssize_t do_tty_write(
+       ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t),
        struct tty_struct *tty,
        struct file *file,
        const unsigned char *buf,
-       unsigned int count)
+       size_t count)
 {
-       int ret = 0, written = 0;
+       ssize_t ret = 0, written = 0;
 
        for (;;) {
                unsigned long size = PAGE_SIZE*2;
@@ -613,19+624,25 @@ static inline int do_tty_write(
                        schedule();
        }
        if (written) {
-               inode->i_mtime = CURRENT_TIME;
+               file->f_dentry->d_inode->i_mtime = CURRENT_TIME;
                ret = written;
        }
        return ret;
 }
 
 
-static long tty_write(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t tty_write(struct file * file, const char * buf, size_t count,
+                        loff_t *ppos)
 {
        int is_console;
        struct tty_struct * tty;
+       struct inode *inode;
+
+       /* Can't seek (pwrite) on ttys.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
 
+       inode = file->f_dentry->d_inode;
        is_console = (inode->i_rdev == CONSOLE_DEV);
 
        if (is_console && redirect)
@@ -649,22+666,23 @@ static long tty_write(struct inode * inode, struct file * file,
 #endif
        if (!tty->ldisc.write)
                return -EIO;
-       return do_tty_write(tty->ldisc.write,
-               inode, tty, file,
-               (const unsigned char *)buf,
-               (unsigned int)count);
+       return do_tty_write(tty->ldisc.write, tty, file,
+                           (const unsigned char *)buf, count);
 }
 
 /* Semaphore to protect creating and releasing a tty */
 static struct semaphore tty_sem = MUTEX;
+
 static void down_tty_sem(int index)
 {
        down(&tty_sem);
 }
+
 static void up_tty_sem(int index)
 {
        up(&tty_sem);
 }
+
 static void release_mem(struct tty_struct *tty, int idx);
 
 /*
index 9d2ecda..77fb908 100644 (file)
@@ -103,12+103,13 @@ static long long vcs_lseek(struct file *file, long long offset, int orig)
 }
 
 #define RETURN( x ) { enable_bh( CONSOLE_BH ); return x; }
-static long
-vcs_read(struct inode *inode, struct file *file, char *buf, unsigned long count)
+static ssize_t
+vcs_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-       int p = file->f_pos;
+       struct inode *inode = file->f_dentry->d_inode;
        unsigned int currcons = MINOR(inode->i_rdev);
-       int viewed, attr, size, read;
+       long p = *ppos;
+       long viewed, attr, size, read;
        char *buf0;
        unsigned short *org = NULL;
 
@@ -160,16+161,17 @@ vcs_read(struct inode *inode, struct file *file, char *buf, unsigned long count)
                        put_user(func_scr_readw(org) & 0xff, buf++);
        }
        read = buf - buf0;
-       file->f_pos += read;
+       *ppos += read;
        RETURN( read );
 }
 
-static long
-vcs_write(struct inode *inode, struct file *file, const char *buf, unsigned long count)
+static ssize_t
+vcs_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
-       int p = file->f_pos;
+       struct inode *inode = file->f_dentry->d_inode;
        unsigned int currcons = MINOR(inode->i_rdev);
-       int viewed, attr, size, written;
+       long p = *ppos;
+       long viewed, attr, size, written;
        const char *buf0;
        unsigned short *org = NULL;
 
@@ -242,7+244,7 @@ vcs_write(struct inode *inode, struct file *file, const char *buf, unsigned long
                update_screen(currcons);
 #endif
        written = buf - buf0;
-       file->f_pos += written;
+       *ppos += written;
        RETURN( written );
 }
 
index 77a5e30..ef5abd2 100644 (file)
@@ -357,10+357,9 @@ static int el_open(struct device *dev)
        if (el_debug > 2)
                printk("%s: Doing el_open()...", dev->name);
 
-       if (request_irq(dev->irq, &el_interrupt, 0, "3c501", NULL))
+       if (request_irq(dev->irq, &el_interrupt, 0, "3c501", dev))
                return -EAGAIN;
 
-       irq2dev_map[dev->irq] = dev;
        el_reset(dev);
 
        dev->start = 1;
@@ -483,7+482,7 @@ load_it_again_sam:
 
 static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr;
        int axsr;                       /* Aux. status reg. */
@@ -761,7+760,6 @@ static int el1_close(struct device *dev)
 
        free_irq(dev->irq, NULL);
        outb(AX_RESET, AX_CMD);         /* Reset the chip */
-       irq2dev_map[dev->irq] = 0;
 
        MOD_DEC_USE_COUNT;
        return 0;
index aa69a74..774ac32 100644 (file)
@@ -340,13+340,13 @@ el2_open(struct device *dev)
 
        outb(EGACFR_NORM, E33G_GACFR);  /* Enable RAM and interrupts. */
        do {
-           if (request_irq (*irqp, NULL, 0, "bogus", NULL) != -EBUSY) {
+           if (request_irq (*irqp, NULL, 0, "bogus", dev) != -EBUSY) {
                /* Twinkle the interrupt, and check if it's seen. */
                autoirq_setup(0);
                outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
                outb_p(0x00, E33G_IDCFR);
                if (*irqp == autoirq_report(0)   /* It's a good IRQ line! */
-                   && request_irq (dev->irq = *irqp, &ei_interrupt, 0, ei_status.name, NULL) == 0)
+                   && request_irq (dev->irq = *irqp, &ei_interrupt, 0, ei_status.name, dev) == 0)
                    break;
            }
        } while (*++irqp);
@@ -355,7+355,7 @@ el2_open(struct device *dev)
            return -EAGAIN;
        }
     } else {
-       if (request_irq(dev->irq, &ei_interrupt, 0, ei_status.name, NULL)) {
+       if (request_irq(dev->irq, &ei_interrupt, 0, ei_status.name, dev)) {
            return -EAGAIN;
        }
     }
@@ -371,7+371,6 @@ el2_close(struct device *dev)
 {
     free_irq(dev->irq, NULL);
     dev->irq = ei_status.saved_irq;
-    irq2dev_map[dev->irq] = NULL;
     outb(EGACFR_IRQOFF, E33G_GACFR);   /* disable interrupts. */
 
     ei_close(dev);
@@ -675,7+674,7 @@ cleanup_module(void)
        for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) {
                struct device *dev = &dev_el2[this_dev];
                if (dev->priv != NULL) {
-                       /* NB: el2_close() handles free_irq + irq2dev map */
+                       /* NB: el2_close() handles free_irq */
                        kfree(dev->priv);
                        dev->priv = NULL;
                        release_region(dev->base_addr, EL2_IO_EXTENT);
index d8a7b33..20c3e6a 100644 (file)
@@ -669,7+669,7 @@ static void elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
                printk("elp_interrupt(): illegal IRQ number found in interrupt routine (%i)\n", irq);
                return;
        }
-       dev = irq2dev_map[irq];
+       dev = dev_id;
 
        if (dev == NULL) {
                printk("elp_interrupt(): irq %d for unknown device.\n", irq);
@@ -926,15+926,9 @@ static int elp_open(struct device *dev)
        adapter->rx_backlog.out = 0;
 
        /*
-        * make sure we can find the device header given the interrupt number
-        */
-       irq2dev_map[dev->irq] = dev;
-
-       /*
         * install our interrupt service routine
         */
-       if (request_irq(dev->irq, &elp_interrupt, 0, "3c505", NULL)) {
-               irq2dev_map[dev->irq] = NULL;
+       if (request_irq(dev->irq, &elp_interrupt, 0, "3c505", dev)) {
                return -EAGAIN;
        }
        if (request_dma(dev->dma, "3c505")) {
@@ -1224,11+1218,6 @@ static int elp_close(struct device *dev)
         */
        free_irq(dev->irq, NULL);
 
-       /*
-        * and we no longer have to map irq to dev either
-        */
-       irq2dev_map[dev->irq] = 0;
-
        free_dma(dev->dma);
        free_pages((unsigned long) adapter->dma_buffer, __get_order(DMA_BUFFER_SIZE));
 
index c12d6ee..5981e29 100644 (file)
@@ -362,7+362,7 @@ __initfunc(int el16_probe1(struct device *dev, int ioaddr))
 
        irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
 
-       irqval = request_irq(irq, &el16_interrupt, 0, "3c507", NULL);
+       irqval = request_irq(irq, &el16_interrupt, 0, "3c507", dev);
        if (irqval) {
                printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval);
                return EAGAIN;
@@ -431,8+431,6 @@ __initfunc(int el16_probe1(struct device *dev, int ioaddr))
 
 static int el16_open(struct device *dev)
 {
-       irq2dev_map[dev->irq] = dev;
-
        /* Initialize the 82586 memory and start it. */
        init_82586_mem(dev);
 
@@ -506,7+504,7 @@ static int el16_send_packet(struct sk_buff *skb, struct device *dev)
        Handle the network interface interrupts. */
 static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status, boguscount = 0;
        ushort ack_cmd = 0;
@@ -619,10+617,7 @@ static int el16_close(struct device *dev)
        /* Disable the 82586's input to the interrupt line. */
        outb(0x80, ioaddr + MISC_CTRL);
 
-       /* We always physically use the IRQ line, so we don't do free_irq().
-          We do remove ourselves from the map. */
-
-       irq2dev_map[dev->irq] = 0;
+       /* We always physically use the IRQ line, so we don't do free_irq(). */
 
        /* Update the statistics here. */
 
index 6765615..965cd27 100644 (file)
@@ -418,7+418,6 @@ el3_open(struct device *dev)
        outw(SetStatusEnb | 0x00, ioaddr + EL3_CMD);
 
        if (request_irq(dev->irq, &el3_interrupt, 0, "3c509", dev)) {
-               irq2dev_map[dev->irq] = NULL;
                return -EAGAIN;
        }
 
@@ -868,7+867,6 @@ cleanup_module(void)
                        kfree_s(dev->priv,sizeof(struct el3_private));
                        dev->priv = NULL;
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(dev->base_addr, EL3_IO_EXTENT);
                        unregister_netdev(dev);
                }
index 4623128..597566c 100644 (file)
@@ -121,7+121,6 @@ int ei_open(struct device *dev)
        return -ENXIO;
     }
     
-    irq2dev_map[dev->irq] = dev;
     NS8390_init(dev, 1);
     dev->start = 1;
     ei_local->irqlock = 0;
@@ -284,7+283,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
    Handle the ether interface interrupts. */
 void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-    struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
     int e8390_base;
     int interrupts, nr_serviced = 0;
     struct ei_device *ei_local;
@@ -296,12+295,14 @@ void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
     e8390_base = dev->base_addr;
     ei_local = (struct ei_device *) dev->priv;
     if (dev->interrupt || ei_local->irqlock) {
+#if 1 /* This might just be an interrupt for a PCI device sharing this line */
                /* The "irqlock" check is only for testing. */
                printk(ei_local->irqlock
                           ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n"
                           : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n",
                           dev->name, inb_p(e8390_base + EN0_ISR),
                           inb_p(e8390_base + EN0_IMR));
+#endif
                return;
     }
     
index bf0754c..5032e9b 100644 (file)
@@ -45,7+45,6 @@ extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
 #ifndef HAVE_AUTOIRQ
 /* From auto_irq.c */
-extern struct device *irq2dev_map[16];
 extern void autoirq_setup(int waittime);
 extern unsigned long autoirq_report(int waittime);
 #endif
index 63af649..8208de6 100644 (file)
@@ -165,7+165,7 @@ __initfunc(static int ac_probe1(int ioaddr, struct device *dev))
        else if (dev->irq == 2)
                dev->irq = 9;
 
-       if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", NULL)) {
+       if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", dev)) {
                printk (" unable to get IRQ %d.\n", dev->irq);
                return EAGAIN;
        }
@@ -228,7+228,7 @@ static int ac_open(struct device *dev)
        /* Someday we may enable the IRQ and shared memory here. */
        int ioaddr = dev->base_addr;
 
-       if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", NULL))
+       if (request_irq(dev->irq, ei_interrupt, 0, "ac3200", dev))
                return -EAGAIN;
 #endif
 
@@ -304,7+304,6 @@ static int ac_close_card(struct device *dev)
        /* We should someday disable shared memory and interrupts. */
        outb(0x00, ioaddr + 6); /* Disable interrupts. */
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = 0;
 #endif
 
        ei_close(dev);
@@ -369,9+368,8 @@ cleanup_module(void)
                if (dev->priv != NULL) {
                        kfree(dev->priv);
                        dev->priv = NULL;
-                       /* Someday free_irq + irq2dev may be in ac_close_card() */
+                       /* Someday free_irq may be in ac_close_card() */
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(dev->base_addr, AC_IO_EXTENT);
                        unregister_netdev(dev);
                }
index e15d779..0cedcac 100644 (file)
@@ -537,11+537,9 @@ i596_open(struct device *dev)
     if (i596_debug > 1)
        printk("%s: i596_open() irq %d.\n", dev->name, dev->irq);
 
-    if (request_irq(dev->irq, &i596_interrupt, 0, "apricot", NULL))
+    if (request_irq(dev->irq, &i596_interrupt, 0, "apricot", dev))
        return -EAGAIN;
 
-    irq2dev_map[dev->irq] = dev;
-
     i = init_rx_bufs(dev, RX_RING_SIZE);
 
     if ((i = init_rx_bufs(dev, RX_RING_SIZE)) < RX_RING_SIZE)
@@ -550,7+548,6 @@ i596_open(struct device *dev)
     if (i < 4)
     {
         free_irq(dev->irq, NULL);
-        irq2dev_map[dev->irq] = 0;
         return -EAGAIN;
     }
 
@@ -746,7+743,7 @@ __initfunc(int apricot_probe(struct device *dev))
 static void
 i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-    struct device *dev = (struct device *)(irq2dev_map[irq]);
+    struct device *dev = dev_id;
     struct i596_private *lp;
     short ioaddr;
     int boguscnt = 200;
@@ -934,7+931,6 @@ i596_close(struct device *dev)
            break;
        }
     free_irq(dev->irq, NULL);
-    irq2dev_map[dev->irq] = 0;
     remove_rx_bufs(dev);
     MOD_DEC_USE_COUNT;
 
index c5ab225..c018163 100644 (file)
@@ -178,12+178,11 @@ __initfunc(int arcrimi_found(struct device *dev,int node,int airq, u_long shmem)
   int mirror_size;
 
   /* reserve the irq */
-  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (RIM I)",NULL))
+  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (RIM I)",dev))
     {
       BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq);
       return -ENODEV;
     }
-  irq2dev_map[airq]=dev;
   dev->irq=airq;
 
   dev->base_addr=0;
@@ -221,7+220,6 @@ __initfunc(int arcrimi_found(struct device *dev,int node,int airq, u_long shmem)
   dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
   if (dev->priv == NULL)
     {
-      irq2dev_map[airq] = NULL;
       free_irq(airq,NULL);
       return -ENOMEM;
     }
@@ -792,7+790,6 @@ void cleanup_module(void)
 
   if (dev->irq)
     {
-      irq2dev_map[dev->irq] = NULL;
       free_irq(dev->irq,NULL);
     }
 
index 7669b59..45fc94e 100644 (file)
@@ -919,7+919,7 @@ int arcnet_go_tx(struct device *dev,int enable_irq)
 void
 arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct arcnet_local *lp;
 
        if (dev==NULL)
index c75274c..e1a989f 100644 (file)
@@ -193,7+193,7 @@ __initfunc(int at1700_probe1(struct device *dev, short ioaddr))
                                 | (read_eeprom(ioaddr, 0)>>14)];
 
        /* Snarf the interrupt vector now. */
-       if (request_irq(irq, &net_interrupt, 0, "at1700", NULL)) {
+       if (request_irq(irq, &net_interrupt, 0, "at1700", dev)) {
                printk ("AT1700 found at %#3x, but it's unusable due to a conflict on"
                                "IRQ %d.\n", ioaddr, irq);
                return EAGAIN;
@@ -212,7+212,6 @@ __initfunc(int at1700_probe1(struct device *dev, short ioaddr))
 
        dev->base_addr = ioaddr;
        dev->irq = irq;
-       irq2dev_map[irq] = dev;
 
        for(i = 0; i < 3; i++) {
                unsigned short eeprom_val = read_eeprom(ioaddr, 4+i);
@@ -435,7+434,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev)
 static void
 net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status;
 
@@ -656,7+655,6 @@ cleanup_module(void)
 
        /* If we don't do this, we can't re-insmod it later. */
        free_irq(dev_at1700.irq, NULL);
-       irq2dev_map[dev_at1700.irq] = NULL;
        release_region(dev_at1700.base_addr, AT1700_IO_EXTENT);
 }
 #endif /* MODULE */
index 997368e..c135d69 100644 (file)
@@ -327,9+327,7 @@ static int net_open(struct device *dev)
        /* The interrupt line is turned off (tri-stated) when the device isn't in
           use.  That's especially important for "attached" interfaces where the
           port or interrupt may be shared. */
-       if (irq2dev_map[dev->irq] != 0
-               || (irq2dev_map[dev->irq] = dev) == 0
-               || request_irq(dev->irq, &net_interrupt, 0, "ATP", NULL)) {
+       if (request_irq(dev->irq, &net_interrupt, 0, "ATP", dev)) {
                return -EAGAIN;
        }
 
@@ -479,7+477,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev)
 static void
 net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status, boguscount = 20;
        static int num_tx_since_rx = 0;
@@ -730,7+728,6 @@ net_close(struct device *dev)
        /* Free the IRQ line. */
        outb(0x00, ioaddr + PAR_CONTROL);
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = 0;
 
        /* Leave the hardware in a reset state. */
     write_reg_high(ioaddr, CMR1, CMR1h_RESET);
index 2a3b99d..2735454 100644 (file)
@@ -39,8+39,6 @@ static const char *version=
 #include <asm/irq.h>
 #include <linux/netdevice.h>
 
-struct device *irq2dev_map[NR_IRQS] = {0, 0, /* ... zeroed */};
-
 static unsigned long irqs;
 
 void autoirq_setup(int waittime)
index 1fb3a08..e9ea440 100644 (file)
@@ -336,12+336,11 @@ __initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
   struct arcnet_local *lp;
   
   /* reserve the irq */
-  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM20020)",NULL))
+  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM20020)",dev))
     {
       BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq);
       return -ENODEV;
     }
-  irq2dev_map[airq]=dev;
   dev->irq=airq;
   
   /* reserve the I/O region - guaranteed to work by check_region */
@@ -355,7+354,6 @@ __initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
   dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
   if (dev->priv == NULL)
     {
-      irq2dev_map[airq] = NULL;
       free_irq(airq,NULL);
       release_region(ioaddr,ARCNET_TOTAL_SIZE);
       return -ENOMEM;
@@ -1026,7+1024,6 @@ void cleanup_module(void)
 
   if (dev->irq)
     {
-      irq2dev_map[dev->irq] = NULL;
       free_irq(dev->irq,NULL);
     }
 
index 9bd9021..2378fe4 100644 (file)
@@ -296,12+296,11 @@ __initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
   struct arcnet_local *lp;
 
   /* reserve the irq */
-  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM90xx-IO)",NULL))
+  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (COM90xx-IO)",dev))
     {
       BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq);
       return -ENODEV;
     }
-  irq2dev_map[airq]=dev;
   dev->irq=airq;
 
   /* reserve the I/O region - guaranteed to work by check_region */
@@ -315,7+314,6 @@ __initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
   dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
   if (dev->priv == NULL)
     {
-      irq2dev_map[airq] = NULL;
       free_irq(airq,NULL);
       release_region(ioaddr,ARCNET_TOTAL_SIZE);
       return -ENOMEM;
@@ -905,7+903,6 @@ void cleanup_module(void)
 
   if (dev->irq)
     {
-      irq2dev_map[dev->irq] = NULL;
       free_irq(dev->irq,NULL);
     }
 
index ec88b73..245fa80 100644 (file)
@@ -542,12+542,11 @@ __initfunc(static int arc90xx_found(struct device *dev,int ioaddr,int airq, u_lo
   int mirror_size;
 
   /* reserve the irq */
-  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (90xx)",NULL))
+  if (request_irq(airq,&arcnet_interrupt,0,"arcnet (90xx)",dev))
     {
       BUGMSG(D_NORMAL,"Can't get IRQ %d!\n",airq);
       return -ENODEV;
     }
-  irq2dev_map[airq]=dev;
   dev->irq=airq;
 
   /* reserve the I/O region - guaranteed to work by check_region */
@@ -585,7+584,6 @@ __initfunc(static int arc90xx_found(struct device *dev,int ioaddr,int airq, u_lo
   dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
   if (dev->priv == NULL)
     {
-      irq2dev_map[airq] = NULL;
       free_irq(airq,NULL);
       release_region(ioaddr,ARCNET_TOTAL_SIZE);
       return -ENOMEM;
@@ -1203,7+1201,6 @@ void cleanup_module(void)
 
   if (dev->irq)
     {
-      irq2dev_map[dev->irq] = NULL;
       free_irq(dev->irq,NULL);
     }
 
index 66e3c5f..607c8fe 100644 (file)
@@ -302,7+302,7 @@ static int cops_probe1(struct device *dev, int ioaddr)
                dev->irq = 9;
 
        /* Snarf the interrupt now. */
-        irqval = request_irq(dev->irq, &cops_interrupt, 0, cardname, NULL);
+        irqval = request_irq(dev->irq, &cops_interrupt, 0, cardname, dev);
         if (irqval)
        {       
                printk(KERN_WARNING "%s: Unable to get IRQ %d (irqval=%d).\n", dev->name, dev->irq, irqval);
@@ -398,8+398,6 @@ static int cops_irq (int ioaddr, int board)
  */
 static int cops_open(struct device *dev)
 {
-        irq2dev_map[dev->irq] = dev;
-
        cops_jumpstart(dev);    /* Start the card up. */
 
         dev->tbusy = 0;
@@ -666,7+664,7 @@ static int cops_nodeid (struct device *dev, int nodeid)
  */
 static void cops_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-        struct device *dev = (struct device *) irq2dev_map[irq];
+        struct device *dev = dev_id;
         struct cops_local *lp;
         int ioaddr, status;
         int boguscount = 0;
@@ -954,7+952,6 @@ static int cops_close(struct device *dev)
 {
         dev->tbusy = 1;
         dev->start = 0;
-        irq2dev_map[dev->irq] = 0;
 
 #ifdef MODULE
         MOD_DEC_USE_COUNT;
index 66852e3..9093e65 100644 (file)
@@ -605,10+605,10 @@ net_open(struct device *dev)
                /* Allow interrupts to be generated by the chip */
                writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
                for (i = 2; i < CS8920_NO_INTS; i++) if ((1 << dev->irq) & lp->irq_map) {
-                       if (request_irq (i, NULL, 0, "cs8920", NULL) != -EBUSY) {
+                       if (request_irq (i, NULL, 0, "cs8920", dev) != -EBUSY) {
                                write_irq(dev, lp->chip_type, i);
                                writereg(dev, PP_BufCFG, GENERATE_SW_INTERRUPT);
-                               if (request_irq (dev->irq = i, &net_interrupt, 0, "cs89x0", NULL) == 0)
+                               if (request_irq (dev->irq = i, &net_interrupt, 0, "cs89x0", dev) == 0)
                                        break;
                        }
                }
@@ -626,13+626,11 @@ net_open(struct device *dev)
                }
                writereg(dev, PP_BusCTL, ENABLE_IRQ | MEMORY_ON);
                write_irq(dev, lp->chip_type, dev->irq);
-               if (request_irq(dev->irq, &net_interrupt, 0, "cs89x0", NULL)) {
+               if (request_irq(dev->irq, &net_interrupt, 0, "cs89x0", dev)) {
                        return -EAGAIN;
                }
        }
 
-       irq2dev_map[dev->irq] = dev;
-
        /* set the Ethernet address */
        for (i=0; i < ETH_ALEN/2; i++)
                writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
@@ -658,7+656,6 @@ net_open(struct device *dev)
         release_irq:
                 writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) & ~(SERIAL_TX_ON | SERIAL_RX_ON));
                 free_irq(dev->irq, NULL);
-                irq2dev_map[dev->irq] = 0;
                return -EAGAIN;
        }
 
@@ -794,7+791,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev)
    Handle the network interface interrupts. */
 static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status;
 
@@ -923,8+920,6 @@ net_close(struct device *dev)
 
        free_irq(dev->irq, NULL);
 
-       irq2dev_map[dev->irq] = 0;
-
        /* Update the statistics here. */
 
         MOD_DEC_USE_COUNT;
index 700c95a..2fdee46 100644 (file)
@@ -338,11+338,10 @@ de600_read_byte(unsigned char type, struct device *dev) { /* dev used by macros
 static int
 de600_open(struct device *dev)
 {
-       if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600", NULL)) {
+       if (request_irq(DE600_IRQ, de600_interrupt, 0, "de600", dev)) {
                printk ("%s: unable to get IRQ %d\n", dev->name, DE600_IRQ);
                return 1;
        }
-       irq2dev_map[DE600_IRQ] = dev;
 
        MOD_INC_USE_COUNT;
        dev->start = 1;
@@ -368,7+367,6 @@ de600_close(struct device *dev)
 
        if (dev->start) {
                free_irq(DE600_IRQ, NULL);
-               irq2dev_map[DE600_IRQ] = NULL;
                dev->start = 0;
                MOD_DEC_USE_COUNT;
        }
@@ -481,7+479,7 @@ de600_start_xmit(struct sk_buff *skb, struct device *dev)
 static void
 de600_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device   *dev = irq2dev_map[irq];
+       struct device   *dev = dev_id;
        byte            irq_status;
        int             retrig = 0;
        int             boguscount = 0;
index 60bc922..3ac90a8 100644 (file)
@@ -439,11+439,10 @@ de620_get_register(struct device *dev, byte reg)
 static int
 de620_open(struct device *dev)
 {
-       if (request_irq(dev->irq, de620_interrupt, 0, "de620", NULL)) {
+       if (request_irq(dev->irq, de620_interrupt, 0, "de620", dev)) {
                printk ("%s: unable to get IRQ %d\n", dev->name, dev->irq);
                return 1;
        }
-       irq2dev_map[dev->irq] = dev;
 
        MOD_INC_USE_COUNT;
        if (adapter_init(dev)) {
@@ -465,7+464,6 @@ de620_close(struct device *dev)
        de620_set_register(dev, W_TCR, RXOFF);
 
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = NULL;
 
        dev->start = 0;
        MOD_DEC_USE_COUNT;
@@ -595,7+593,7 @@ de620_start_xmit(struct sk_buff *skb, struct device *dev)
 static void
 de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = irq2dev_map[irq_in];
+       struct device *dev = dev_id;
        byte irq_status;
        int bogus_count = 0;
        int again = 0;
index 74246fa..40841b8 100644 (file)
@@ -687,7+687,6 @@ depca_open(struct device *dev)
   s16 nicsr;
   int status = 0;
 
-  irq2dev_map[dev->irq] = dev;
   STOP_DEPCA;
   nicsr = inb(DEPCA_NICSR);
 
@@ -703,7+702,7 @@ depca_open(struct device *dev)
 
   depca_dbg_open(dev);
 
-  if (request_irq(dev->irq, &depca_interrupt, 0, lp->adapter_name, NULL)) {
+  if (request_irq(dev->irq, &depca_interrupt, 0, lp->adapter_name, dev)) {
     printk("depca_open(): Requested IRQ%d is busy\n",dev->irq);
     status = -EAGAIN;
   } else {
@@ -837,7+836,7 @@ depca_start_xmit(struct sk_buff *skb, struct device *dev)
 static void
 depca_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-  struct device *dev = (struct device *)(irq2dev_map[irq]);
+  struct device *dev =dev_id;
   struct depca_private *lp;
   s16 csr0, nicsr;
   u_long ioaddr;
@@ -1059,7+1058,6 @@ depca_close(struct device *dev)
   ** Free the associated irq
   */
   free_irq(dev->irq, NULL);
-  irq2dev_map[dev->irq] = NULL;
 
   MOD_DEC_USE_COUNT;
 
@@ -1133,25+1131,23 @@ set_multicast_list(struct device *dev)
   struct depca_private *lp = (struct depca_private *)dev->priv;
   u_long ioaddr = dev->base_addr;
 
-  if (irq2dev_map[dev->irq] != NULL) {
-    while(dev->tbusy);                /* Stop ring access */
-    set_bit(0, (void*)&dev->tbusy);
-    while(lp->tx_old != lp->tx_new);  /* Wait for the ring to empty */
+  while(dev->tbusy);                /* Stop ring access */
+  set_bit(0, (void*)&dev->tbusy);
+  while(lp->tx_old != lp->tx_new);  /* Wait for the ring to empty */
 
-    STOP_DEPCA;                       /* Temporarily stop the depca.  */
-    depca_init_ring(dev);             /* Initialize the descriptor rings */
+  STOP_DEPCA;                       /* Temporarily stop the depca.  */
+  depca_init_ring(dev);             /* Initialize the descriptor rings */
 
-    if (dev->flags & IFF_PROMISC) {   /* Set promiscuous mode */
-      lp->init_block.mode |= PROM;
-    } else {
-      SetMulticastFilter(dev);
-      lp->init_block.mode &= ~PROM;   /* Unset promiscuous mode */
-    }
-
-    LoadCSRs(dev);                    /* Reload CSR3 */
-    InitRestartDepca(dev);            /* Resume normal operation. */
-    dev->tbusy = 0;                   /* Unlock the TX ring */
+  if (dev->flags & IFF_PROMISC) {   /* Set promiscuous mode */
+    lp->init_block.mode |= PROM;
+  } else {
+    SetMulticastFilter(dev);
+    lp->init_block.mode &= ~PROM;   /* Unset promiscuous mode */
   }
+
+  LoadCSRs(dev);                    /* Reload CSR3 */
+  InitRestartDepca(dev);            /* Resume normal operation. */
+  dev->tbusy = 0;                   /* Unlock the TX ring */
 }
 
 /*
index 4b6e67d..ab39f79 100644 (file)
@@ -254,10+254,9 @@ e21_open(struct device *dev)
 {
        short ioaddr = dev->base_addr;
 
-       if (request_irq(dev->irq, ei_interrupt, 0, "e2100", NULL)) {
+       if (request_irq(dev->irq, ei_interrupt, 0, "e2100", dev)) {
                return EBUSY;
        }
-       irq2dev_map[dev->irq] = dev;
 
        /* Set the interrupt line and memory base on the hardware. */
        inb(ioaddr + E21_IRQ_LOW);
@@ -362,8+361,6 @@ e21_close(struct device *dev)
        inb(ioaddr + E21_IRQ_HIGH);                     /* High IRQ bit, and if_port. */
        outb(0, ioaddr + E21_ASIC);
 
-       irq2dev_map[dev->irq] = NULL;
-
        ei_close(dev);
 
        /* Double-check that the memory has been turned off, because really
@@ -442,7+439,7 @@ cleanup_module(void)
        for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
                struct device *dev = &dev_e21[this_dev];
                if (dev->priv != NULL) {
-                       /* NB: e21_close() handles free_irq + irq2dev map */
+                       /* NB: e21_close() handles free_irq */
                        kfree(dev->priv);
                        dev->priv = NULL;
                        release_region(dev->base_addr, E21_IO_EXTENT);
index 25167fa..a5e5521 100644 (file)
@@ -420,7+420,7 @@ __initfunc(int eepro_probe1(struct device *dev, short ioaddr))
                        if (dev->irq > 2) {
                                printk(", IRQ %d, %s.\n", dev->irq,
                                                ifmap[dev->if_port]);
-                               if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", NULL)) {
+                               if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", dev)) {
                                        printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
                                        return -EAGAIN;
                                }
@@ -513,7+513,7 @@ static int  eepro_grab_irq(struct device *dev)
                        outb(DIAGNOSE_CMD, ioaddr); /* RESET the 82595 */
 
                        if (*irqp == autoirq_report(2) &&  /* It's a good IRQ line */
-                               (request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", NULL) == 0))
+                               (request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", dev) == 0))
                                        break;
 
                        /* clear all interrupts */
@@ -560,10+560,6 @@ eepro_open(struct device *dev)
                return -EAGAIN;
        }
 
-       if (irq2dev_map[dev->irq] != 0
-               || (irq2dev_map[dev->irq] = dev) == 0)
-               return -EAGAIN;
-
        /* Initialize the 82595. */
 
        outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */
@@ -741,7+737,7 @@ eepro_send_packet(struct sk_buff *skb, struct device *dev)
 static void
 eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        int ioaddr, status, boguscount = 20;
 
        if (net_debug > 5)
@@ -825,8+821,6 @@ eepro_close(struct device *dev)
        /* release the interrupt */
        free_irq(dev->irq, NULL);
 
-       irq2dev_map[dev->irq] = 0;
-
        /* Update the statistics here. What statistics? */
 
        /* We are supposed to wait for 200 us after a RESET */
index ce89c7b..1c63c00 100644 (file)
@@ -447,11+447,7 @@ static void speedo_timer(unsigned long data);
 static void speedo_init_rx_ring(struct device *dev);
 static int speedo_start_xmit(struct sk_buff *skb, struct device *dev);
 static int speedo_rx(struct device *dev);
-#ifdef SA_SHIRQ
 static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-#else
-static void speedo_interrupt(int irq, struct pt_regs *regs);
-#endif
 static int speedo_close(struct device *dev);
 static struct enet_statistics *speedo_get_stats(struct device *dev);
 static void set_rx_mode(struct device *dev);
@@ -823,26+819,10 @@ speedo_open(struct device *dev)
                SLOW_DOWN_IO;                   /* At least 250ns */
 #endif
 
-#ifdef SA_SHIRQ
        if (request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ,
                                        "Intel EtherExpress Pro 10/100 Ethernet", dev)) {
                return -EAGAIN;
        }
-#else
-#ifdef USE_SHARED_IRQ
-       if (request_shared_irq(dev->irq, &speedo_interrupt, dev,
-                                                  "Intel EtherExpress Pro 10/100 Ethernet"))
-               return -EAGAIN;
-#else
-       if (dev->irq < 2  ||  dev->irq > 15  ||  irq2dev_map[dev->irq] != NULL)
-               return -EAGAIN;
-       irq2dev_map[dev->irq] = dev;
-       if (request_irq(dev->irq, &speedo_interrupt, 0, "Intel EtherExpress Pro 10/100 Ethernet")) {
-               irq2dev_map[dev->irq] = NULL;
-               return -EAGAIN;
-       }
-#endif
-#endif
 
        if (speedo_debug > 1)
                printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", dev->name, dev->irq);
@@ -1116,21+1096,9 @@ speedo_start_xmit(struct sk_buff *skb, struct device *dev)
 
 /* The interrupt handler does all of the Rx thread work and cleans up
    after the Tx thread. */
-#ifdef SA_SHIRQ
 static void speedo_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
-#else
-static void speedo_interrupt(int irq, struct pt_regs *regs)
-#endif
 {
-#ifdef SA_SHIRQ
        struct device *dev = (struct device *)dev_instance;
-#else
-#ifdef USE_SHARED_IRQ
-       struct device *dev = (struct device *)(irq == 0 ? regs : irq2dev_map[irq]);
-#else
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
-#endif
-#endif
        struct speedo_private *sp;
        int ioaddr, boguscnt = INTR_WORK;
        unsigned short status;
@@ -1254,11+1222,7 @@ static void speedo_interrupt(int irq, struct pt_regs *regs)
                if (dev->start == 0  &&  --stopit < 0) {
                        printk(KERN_ALERT "%s: Emergency stop, interrupt is stuck.\n",
                                   dev->name);
-#ifdef SA_SHIRQ
                        free_irq(irq, dev);
-#else
-                       free_irq(irq);
-#endif
                }
        }
 #endif
@@ -1438,12+1402,7 @@ speedo_close(struct device *dev)
        outw(INT_MASK, ioaddr + SCBCmd);
        outw(INT_MASK | RX_ABORT, ioaddr + SCBCmd);
 
-#ifdef SA_SHIRQ
        free_irq(dev->irq, dev);
-#else
-       free_irq(dev->irq);
-       irq2dev_map[dev->irq] = 0;
-#endif
 
        /* Free all the skbuffs in the Rx and Tx queues. */
        for (i = 0; i < RX_RING_SIZE; i++) {
index eb0117e..d92fbea 100644 (file)
@@ -346,9+346,7 @@ static int eexp_open(struct device *dev)
        if (!irq || !irqrmap[irq])
                return -ENXIO;
 
-       if (irq2dev_map[irq] ||
-          ((irq2dev_map[irq]=dev),0) ||
-            request_irq(irq,&eexp_irq,0,"EtherExpress",NULL))
+       if (request_irq(irq,&eexp_irq,0,"EtherExpress",dev))
                return -EAGAIN;
 
        request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress");
@@ -391,7+389,6 @@ static int eexp_close(struct device *dev)
        scb_command(dev, SCB_CUsuspend|SCB_RUsuspend);
        outb(0,ioaddr+SIGNAL_CA);
        free_irq(irq,NULL);
-       irq2dev_map[irq] = NULL;
        outb(i586_RST,ioaddr+EEPROM_Ctrl);
        release_region(ioaddr,16);
 
@@ -628,7+625,7 @@ static void eexp_cmd_clear(struct device *dev)
        
 static void eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
 {
-       struct device *dev = irq2dev_map[irq];
+       struct device *dev = dev_info;
        struct net_local *lp;
        unsigned short ioaddr,status,ack_cmd;
        unsigned short old_read_ptr, old_write_ptr;
index 96ffd43..de03aa7 100644 (file)
@@ -214,7+214,7 @@ __initfunc(int es_probe1(struct device *dev, int ioaddr))
                printk(" assigning IRQ %d", dev->irq);
        }
 
-       if (request_irq(dev->irq, ei_interrupt, 0, "es3210", NULL)) {
+       if (request_irq(dev->irq, ei_interrupt, 0, "es3210", dev)) {
                printk (" unable to get IRQ %d.\n", dev->irq);
                return EAGAIN;
        }
@@ -433,7+433,6 @@ cleanup_module(void)
                        kfree(dev->priv);
                        dev->priv = NULL;
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(dev->base_addr, ES_IO_EXTENT);
                        unregister_netdev(dev);
                }
index 74cf38d..1c25f0c 100644 (file)
@@ -434,7+434,7 @@ __initfunc(static int eth16i_probe1(struct device *dev, short ioaddr))
        dev->irq = irq;
 
        /* Try to obtain interrupt vector */
-       if(request_irq(dev->irq, &eth16i_interrupt, 0, "eth16i", NULL)) {
+       if(request_irq(dev->irq, &eth16i_interrupt, 0, "eth16i", dev)) {
                printk("%s: %s at %#3x, but is unusable due
                       conflict on IRQ %d.\n", dev->name, cardname, ioaddr, irq);
                return EAGAIN;
@@ -807,8+807,6 @@ static int eth16i_open(struct device *dev)
        struct eth16i_local *lp = (struct eth16i_local *)dev->priv;
        int ioaddr = dev->base_addr;
 
-       irq2dev_map[dev->irq] = dev;
-
        /* Powerup the chip */
        outb(0xc0 | POWERUP, ioaddr + CONFIG_REG_1);
 
@@ -1106,7+1104,7 @@ static void eth16i_rx(struct device *dev)
 
 static void eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct eth16i_local *lp;
        int ioaddr = 0,
                        status;
@@ -1228,7+1226,6 @@ void cleanup_module(void)
 {
        unregister_netdev( &dev_eth16i );
        free_irq( dev_eth16i.irq, NULL );
-       irq2dev_map[ dev_eth16i.irq ] = NULL;
        release_region( dev_eth16i.base_addr, ETH16I_IO_EXTENT );
 }
 
index 75492e1..ed9ff5e 100644 (file)
@@ -628,9+628,7 @@ ewrk3_open(struct device *dev)
   STOP_EWRK3;
 
   if (!lp->hard_strapped) {
-    irq2dev_map[dev->irq] = dev;                   /* For latched interrupts */
-
-    if (request_irq(dev->irq, (void *)ewrk3_interrupt, 0, "ewrk3", NULL)) {
+    if (request_irq(dev->irq, (void *)ewrk3_interrupt, 0, "ewrk3", dev)) {
       printk("ewrk3_open(): Requested IRQ%d is busy\n",dev->irq);
       status = -EAGAIN;
     } else {
@@ -877,7+875,7 @@ ewrk3_queue_pkt(struct sk_buff *skb, struct device *dev)
 static void
 ewrk3_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-    struct device *dev = (struct device *)(irq2dev_map[irq]);
+    struct device *dev = dev_id;
     struct ewrk3_private *lp;
     u_long iobase;
     u_char icr, cr, csr;
@@ -1151,8+1149,6 @@ ewrk3_close(struct device *dev)
 
   if (!lp->hard_strapped) {
     free_irq(dev->irq, NULL);
-
-    irq2dev_map[dev->irq] = 0;
   }
 
   MOD_DEC_USE_COUNT;
@@ -1177,24+1173,22 @@ static void set_multicast_list(struct device *dev)
   u_long iobase = dev->base_addr;
   u_char csr;
 
-  if (irq2dev_map[dev->irq] != NULL) {
-    csr = inb(EWRK3_CSR);
+  csr = inb(EWRK3_CSR);
 
-    if (lp->shmem_length == IO_ONLY) {
-      lp->mctbl = (char *) PAGE0_HTE;
-    } else {
-      lp->mctbl = (char *)(lp->shmem_base + PAGE0_HTE);
-    }
+  if (lp->shmem_length == IO_ONLY) {
+    lp->mctbl = (char *) PAGE0_HTE;
+  } else {
+    lp->mctbl = (char *)(lp->shmem_base + PAGE0_HTE);
+  }
 
-    csr &= ~(CSR_PME | CSR_MCE);
-    if (dev->flags & IFF_PROMISC) {         /* set promiscuous mode */
-      csr |= CSR_PME;
-      outb(csr, EWRK3_CSR);
-    } else {
-      SetMulticastFilter(dev);
-      csr |= CSR_MCE;
-      outb(csr, EWRK3_CSR);
-    }
+  csr &= ~(CSR_PME | CSR_MCE);
+  if (dev->flags & IFF_PROMISC) {         /* set promiscuous mode */
+    csr |= CSR_PME;
+    outb(csr, EWRK3_CSR);
+  } else {
+    SetMulticastFilter(dev);
+    csr |= CSR_MCE;
+    outb(csr, EWRK3_CSR);
   }
 }
 
index 59362c8..a123a11 100644 (file)
@@ -180,7+180,7 @@ __initfunc(int fmv18x_probe1(struct device *dev, short ioaddr))
        irq = irqmap[(inb(ioaddr + FJ_CONFIG0)>>6) & 0x03];
 
        /* Snarf the interrupt vector now. */
-       if (request_irq(irq, &net_interrupt, 0, "fmv18x", NULL)) {
+       if (request_irq(irq, &net_interrupt, 0, "fmv18x", dev)) {
                printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on"
                                "IRQ %d.\n", ioaddr, irq);
                return EAGAIN;
@@ -199,7+199,6 @@ __initfunc(int fmv18x_probe1(struct device *dev, short ioaddr))
 
        dev->base_addr = ioaddr;
        dev->irq = irq;
-       irq2dev_map[irq] = dev;
 
        for(i = 0; i < 6; i++) {
                unsigned char val = inb(ioaddr + FJ_MACADDR + i);
@@ -399,7+398,7 @@ net_send_packet(struct sk_buff *skb, struct device *dev)
 static void
 net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status;
 
@@ -643,7+642,6 @@ cleanup_module(void)
 
        /* If we don't do this, we can't re-insmod it later. */
        free_irq(dev_fmv18x.irq, NULL);
-       irq2dev_map[dev_fmv18x.irq] = NULL;
        release_region(dev_fmv18x.base_addr, FMV18X_IO_EXTENT);
 }
 #endif /* MODULE */
index b7f85f7..b76161a 100644 (file)
@@ -259,7+259,7 @@ hpp_open(struct device *dev)
        int ioaddr = dev->base_addr - NIC_OFFSET;
        int option_reg;
 
-       if (request_irq(dev->irq, &ei_interrupt, 0, "hp-plus", NULL)) {
+       if (request_irq(dev->irq, &ei_interrupt, 0, "hp-plus", dev)) {
            return -EAGAIN;
        }
 
@@ -289,7+289,6 @@ hpp_close(struct device *dev)
        int option_reg = inw(ioaddr + HPP_OPTION);
 
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = NULL;
        ei_close(dev);
        outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset,
                 ioaddr + HPP_OPTION);
@@ -465,7+464,7 @@ cleanup_module(void)
        for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
                struct device *dev = &dev_hpp[this_dev];
                if (dev->priv != NULL) {
-                       /* NB: hpp_close() handles free_irq + irq2dev map */
+                       /* NB: hpp_close() handles free_irq */
                        int ioaddr = dev->base_addr - NIC_OFFSET;
                        kfree(dev->priv);
                        dev->priv = NULL;
index d57763e..a4e68ac 100644 (file)
@@ -157,7+157,7 @@ __initfunc(int hp_probe1(struct device *dev, int ioaddr))
                                outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
                                outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
                                if (irq == autoirq_report(0)             /* It's a good IRQ line! */
-                                       && request_irq (irq, &ei_interrupt, 0, "hp", NULL) == 0) {
+                                       && request_irq (irq, &ei_interrupt, 0, "hp", dev) == 0) {
                                        printk(" selecting IRQ %d.\n", irq);
                                        dev->irq = *irqp;
                                        break;
@@ -171,7+171,7 @@ __initfunc(int hp_probe1(struct device *dev, int ioaddr))
        } else {
                if (dev->irq == 2)
                        dev->irq = 9;
-               if (request_irq(dev->irq, ei_interrupt, 0, "hp", NULL)) {
+               if (request_irq(dev->irq, ei_interrupt, 0, "hp", dev)) {
                        printk (" unable to get IRQ %d.\n", dev->irq);
                        return EBUSY;
                }
@@ -436,7+436,6 @@ cleanup_module(void)
                        kfree(dev->priv);
                        dev->priv = NULL;
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(ioaddr, HP_IO_EXTENT);
                        unregister_netdev(dev);
                }
index 0780e03..8c0dc2c 100644 (file)
@@ -1022,14+1022,12 @@ static int hp100_open( struct device *dev )
        }
     }
   else
-    if(request_irq(dev->irq, hp100_interrupt, SA_INTERRUPT, lp->id->name, NULL))
+    if(request_irq(dev->irq, hp100_interrupt, SA_INTERRUPT, lp->id->name, dev))
       {
        printk( "%s: unable to get IRQ %d\n", dev->name, dev->irq );
        return -EAGAIN;
       }
 
-  irq2dev_map[ dev->irq ] = dev;
-               
   MOD_INC_USE_COUNT;
 
   dev->tbusy = 0;
@@ -1077,7+1075,6 @@ static int hp100_close( struct device *dev )
     free_irq( dev->irq, dev );
   else
     free_irq( dev->irq, NULL );
-  irq2dev_map[ dev->irq ] = NULL;
   MOD_DEC_USE_COUNT;
   return 0;
 }
@@ -2104,7+2101,7 @@ static void hp100_set_multicast_list( struct device *dev)
 
 static void hp100_interrupt( int irq, void *dev_id, struct pt_regs *regs )
 {
-  struct device *dev = (struct device *)irq2dev_map[ irq ];
+  struct device *dev = dev_id;
   struct hp100_private *lp = (struct hp100_private *)dev->priv;
 
   int ioaddr;
index 2beae46..d8ea39e 100644 (file)
@@ -567,12+567,11 @@ __initfunc(static int ibmtr_probe1(struct device *dev, int PIOaddr))
        DPRINTK("Using %dK shared RAM\n",ti->mapped_ram_size/2);
 #endif
 
-       if (request_irq (dev->irq = irq, &tok_interrupt,0,"ibmtr", NULL) != 0) {
+       if (request_irq (dev->irq = irq, &tok_interrupt,0,"ibmtr", dev) != 0) {
                DPRINTK("Could not grab irq %d.  Halting Token Ring driver.\n",irq);
                kfree_s(ti, sizeof(struct tok_info));
                return -ENODEV;
        }
-       irq2dev_map[irq]=dev;
 
  /*?? Now, allocate some of the PIO PORTs for this driver.. */
        request_region(PIOaddr,IBMTR_IO_EXTENT,"ibmtr");  /* record PIOaddr range
@@ -701,7+700,7 @@ void tok_interrupt (int irq, void *dev_id, struct pt_regs *regs)
 #if TR_VERBOSE
        DPRINTK("Int from tok_driver, dev : %p\n",dev);
 #endif
-       dev = (struct device *)(irq2dev_map[irq]);
+       dev = dev_id;
        ti  = (struct tok_info *) dev->priv;
 
        /* Disable interrupts till processing is finished */
@@ -1579,7+1578,6 @@ void cleanup_module(void)
                if (dev_ibmtr[i]) {
                         unregister_trdev(dev_ibmtr[i]);
                         free_irq(dev_ibmtr[i]->irq, NULL);
-                        irq2dev_map[dev_ibmtr[i]->irq] = NULL;
                         release_region(dev_ibmtr[i]->base_addr, IBMTR_IO_EXTENT);
                         kfree_s(dev_ibmtr[i]->priv, sizeof(struct tok_info));
                         kfree_s(dev_ibmtr[i], sizeof(struct device));
index c827a95..f623a9d 100644 (file)
@@ -643,15+643,13 @@ lance_open(struct device *dev)
        int i;
 
        if (dev->irq == 0 ||
-               request_irq(dev->irq, &lance_interrupt, 0, lp->name, NULL)) {
+               request_irq(dev->irq, &lance_interrupt, 0, lp->name, dev)) {
                return -EAGAIN;
        }
 
        /* We used to allocate DMA here, but that was silly.
           DMA lines can't be shared!  We now permanently allocate them. */
 
-       irq2dev_map[dev->irq] = dev;
-
        /* Reset the LANCE */
        inw(ioaddr+LANCE_RESET);
 
@@ -902,7+900,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct device *dev)
 static void
 lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct lance_private *lp;
        int csr0, ioaddr, boguscnt=10;
        int must_restart;
@@ -1133,8+1131,6 @@ lance_close(struct device *dev)
 
        free_irq(dev->irq, NULL);
 
-       irq2dev_map[dev->irq] = 0;
-
        return 0;
 }
 
index 1da2ee6..8309d44 100644 (file)
@@ -755,7+755,7 @@ static int sendup_buffer (struct device *dev)
  
 static void ltpc_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
 {
-       struct device *dev = (struct device *) irq2dev_map[irq];
+       struct device *dev = dev_id;
 
        if (dev==NULL) {
                printk("ltpc_interrupt: unknown device.\n");
@@ -984,9+984,9 @@ __initfunc(int ltpc_probe(struct device *dev))
        save_flags(flags);
        cli();
 
-       probe3 = request_irq( 3, &lt_probe_handler, 0, "ltpc_probe",NULL);
-       probe4 = request_irq( 4, &lt_probe_handler, 0, "ltpc_probe",NULL);
-       probe9 = request_irq( 9, &lt_probe_handler, 0, "ltpc_probe",NULL);
+       probe3 = request_irq( 3, &lt_probe_handler, 0, "ltpc_probe",dev);
+       probe4 = request_irq( 4, &lt_probe_handler, 0, "ltpc_probe",dev);
+       probe9 = request_irq( 9, &lt_probe_handler, 0, "ltpc_probe",dev);
 
        irqhitmask = 0;
 
@@ -1193,8+1193,7 @@ __initfunc(int ltpc_probe(struct device *dev))
        ltpc_timer.data = (unsigned long) dev;
 
        if (irq) {
-               irq2dev_map[irq] = dev;
-               (void) request_irq( irq, &ltpc_interrupt, 0, "ltpc",NULL);
+               (void) request_irq( irq, &ltpc_interrupt, 0, "ltpc", dev);
                (void) inb_p(base+7);  /* enable interrupts from board */
                (void) inb_p(base+7);  /* and reset irq line */
                ltpc_timer.expires = 100;
index f431375..2550613 100644 (file)
@@ -427,7+427,8 @@ __initfunc(static int ne_probe1(struct device *dev, int ioaddr))
     /* Snarf the interrupt now.  There's no point in waiting since we cannot
        share and the board will usually be enabled. */
     {
-       int irqval = request_irq(dev->irq, ei_interrupt, SA_INTERRUPT, name, NULL);
+       int irqval = request_irq(dev->irq, ei_interrupt,
+                                pci_irq_line ? SA_SHIRQ : 0, name, dev);
        if (irqval) {
            printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);
            return EAGAIN;
@@ -785,7+786,6 @@ cleanup_module(void)
                        kfree(dev->priv);
                        dev->priv = NULL;
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(dev->base_addr, NE_IO_EXTENT);
                        unregister_netdev(dev);
                }
index 0935f4f..41f150a 100644 (file)
@@ -241,7+241,6 @@ struct priv
 static int ni52_close(struct device *dev)
 {
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = NULL;
 
        ni_reset586(); /* the hard way to stop the receiver */
 
@@ -264,12+263,11 @@ static int ni52_open(struct device *dev)
        startrecv586(dev);
        ni_enaint();
 
-       if(request_irq(dev->irq, &ni52_interrupt,0,"ni5210",NULL))
+       if(request_irq(dev->irq, &ni52_interrupt,0,"ni5210",dev))
        {
                ni_reset586();
                return -EAGAIN;
        }
-       irq2dev_map[dev->irq] = dev;
 
        dev->interrupt = 0;
        dev->tbusy = 0;
@@ -819,7+817,7 @@ static void *alloc_rfa(struct device *dev,void *ptr)
 
 static void ni52_interrupt(int irq,void *dev_id,struct pt_regs *reg_ptr)
 {
-       struct device *dev = (struct device *) irq2dev_map[irq];
+       struct device *dev = dev_id;
        unsigned short stat;
        int cnt=0;
        struct priv *p;
index a008a3e..d95d9ea 100644 (file)
@@ -268,13+268,12 @@ static int ni65_open(struct device *dev)
 {
        struct priv *p = (struct priv *) dev->priv;
        int irqval = request_irq(dev->irq, &ni65_interrupt,0,
-                        cards[p->cardno].cardname,NULL);
+                        cards[p->cardno].cardname,dev);
        if (irqval) {
                printk ("%s: unable to get IRQ %d (irqval=%d).\n",
                          dev->name,dev->irq, irqval);
                return -EAGAIN;
        }
-       irq2dev_map[dev->irq] = dev;
 
        if(ni65_lance_reinit(dev))
        {
@@ -286,7+285,6 @@ static int ni65_open(struct device *dev)
        }
        else
        {
-               irq2dev_map[dev->irq] = NULL;
                free_irq(dev->irq,NULL);
                dev->start = 0;
                return -EAGAIN;
@@ -314,7+312,6 @@ static int ni65_close(struct device *dev)
                }
        }
 #endif
-       irq2dev_map[dev->irq] = NULL;
        free_irq(dev->irq,NULL);
        dev->tbusy = 1;
        dev->start = 0;
@@ -795,7+792,7 @@ static int ni65_lance_reinit(struct device *dev)
 static void ni65_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 {
        int csr0;
-       struct device *dev = (struct device *) irq2dev_map[irq];
+       struct device *dev = dev_id;
        struct priv *p;
        int bcnt = 32;
 
index 6a2b4f1..3153f18 100644 (file)
@@ -1374,7+1374,7 @@ static int pi_probe(struct device *dev, int card_type)
                   now.  There is no point in waiting since no other device can use
                   the interrupt, and this marks the 'irqaction' as busy. */
        {
-           int irqval = request_irq(dev->irq, &pi_interrupt,0, "pi2", NULL);
+           int irqval = request_irq(dev->irq, &pi_interrupt,0, "pi2", dev);
            if (irqval) {
                printk(KERN_ERR "PI: unable to get IRQ %d (irqval=%d).\n",
                       dev->irq, irqval);
@@ -1442,7+1442,6 @@ static int pi_open(struct device *dev)
                free_irq(dev->irq, NULL);
                return -EAGAIN;
            }
-           irq2dev_map[dev->irq] = dev;
        }
        /* Reset the hardware here. */
        chipset_init(dev);
@@ -1672,7+1671,6 @@ void cleanup_module(void)
 {
     free_irq(pi0a.irq, NULL);  /* IRQs and IO Ports are shared */
     release_region(pi0a.base_addr & 0x3f0, PI_TOTAL_SIZE);
-    irq2dev_map[pi0a.irq] = NULL;
 
     kfree(pi0a.priv);
     pi0a.priv = NULL;
index 223210e..ffec545 100644 (file)
@@ -797,7+797,7 @@ plip_error(struct device *dev, struct net_local *nl,
 static void
 plip_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *) irq2dev_map[irq];
+       struct device *dev = dev_id;
        struct net_local *nl;
        struct plip_local *rcv;
        unsigned char c0;
@@ -981,7+981,6 @@ plip_open(struct device *dev)
        dev->interrupt = 0;
        dev->start = 1;
        dev->tbusy = 0;
-       irq2dev_map[dev->irq] = dev;
 
        MOD_INC_USE_COUNT;
        return 0;
@@ -998,7+997,6 @@ plip_close(struct device *dev)
        dev->tbusy = 1;
        dev->start = 0;
        cli();
-       irq2dev_map[dev->irq] = NULL;
        sti();
 #ifdef NOTDEF
        outb(0x00, PAR_DATA(dev));
@@ -1067,7+1065,6 @@ plip_wakeup(void *handle)
 
        if (!parport_claim(nl->pardev)) {
                nl->port_owner = 1;
-               irq2dev_map[dev->irq] = dev;
                /* Clear the data port. */
                outb (0x00, PAR_DATA(dev));
        }
index dcdc266..5b3ff37 100644 (file)
@@ -190,10+190,10 @@ static struct net_device_stats *ppp_dev_stats (struct device *);
  * TTY callbacks
  */
 
-static int ppp_tty_read (struct tty_struct *, struct file *, __u8 *,
-                        unsigned int);
-static int ppp_tty_write (struct tty_struct *, struct file *, const __u8 *,
-                         unsigned int);
+static ssize_t ppp_tty_read (struct tty_struct *, struct file *, __u8 *,
+                            size_t);
+static ssize_t ppp_tty_write (struct tty_struct *, struct file *,
+                             const __u8 *, size_t);
 static int ppp_tty_ioctl (struct tty_struct *, struct file *, unsigned int,
                           unsigned long);
 static unsigned int ppp_tty_poll (struct tty_struct *tty, struct file *filp, poll_table * wait);
@@ -1665,13+1665,12 @@ ppp_doframe (struct ppp *ppp)
    waiting if necessary
 */
 
-static int
-ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf,
-             unsigned int nr)
+static ssize_t
+ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf, size_t nr)
 {
        struct ppp *ppp = tty2ppp (tty);
        __u8 c;
-       int len, indx;
+       ssize_t len, indx;
 
 #define GETC(c)                                                \
 {                                                      \
@@ -1692,8+1691,8 @@ ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf,
 
        if (ppp->flags & SC_DEBUG)
                printk (KERN_DEBUG
-                       "ppp_tty_read: called buf=%p nr=%u\n",
-                       buf, nr);
+                       "ppp_tty_read: called buf=%p nr=%lu\n",
+                       buf, (unsigned long)nr);
 /*
  * Acquire the read lock.
  */
@@ -1761,7+1760,8 @@ ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf,
  * Reset the time of the last read operation.
  */
                if (ppp->flags & SC_DEBUG)
-                       printk (KERN_DEBUG "ppp_tty_read: len = %d\n", len);
+                       printk (KERN_DEBUG "ppp_tty_read: len = %ld\n",
+                               (long)len);
 /*
  * Ensure that the frame will fit within the caller's buffer. If not, then
  * discard the frame from the input buffer.
@@ -1771,8+1771,8 @@ ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf,
 
                        if (ppp->flags & SC_DEBUG)
                                printk (KERN_DEBUG
-                               "ppp: read of %u bytes too small for %d "
-                               "frame\n", nr, len + 2);
+                               "ppp: read of %lu bytes too small for %ld "
+                               "frame\n", (unsigned long)nr, (long)len + 2);
                        ppp->ubuf->tail += len;
                        ppp->ubuf->tail &= ppp->ubuf->size;
                        clear_bit (0, &ppp->ubuf->locked);
@@ -1811,7+1811,8 @@ ppp_tty_read (struct tty_struct *tty, struct file *file, __u8 * buf,
                len += 2; /* Account for ADDRESS and CONTROL bytes */
                if (ppp->flags & SC_DEBUG)
                        printk (KERN_DEBUG
-                               "ppp_tty_read: passing %d bytes up\n", len);
+                               "ppp_tty_read: passing %ld bytes up\n",
+                               (long) len);
                return len;
        }
 #undef GETC
@@ -2051,13+2052,13 @@ send_revise_frame (register struct ppp *ppp, __u8 *data, int len)
  * we have to put the FCS field on ourselves
  */
 
-static int
+static ssize_t
 ppp_tty_write (struct tty_struct *tty, struct file *file, const __u8 * data,
-              unsigned int count)
+              size_t count)
 {
        struct ppp *ppp = tty2ppp (tty);
        __u8 *new_data;
-       int status;
+       ssize_t status;
 /*
  * Verify the pointers.
  */
@@ -2075,7+2076,8 @@ ppp_tty_write (struct tty_struct *tty, struct file *file, const __u8 * data,
                if (ppp->flags & SC_DEBUG)
                        printk (KERN_WARNING
                                "ppp_tty_write: truncating user packet "
-                               "from %u to mtu %d\n", count, PPP_MTU);
+                               "from %lu to mtu %d\n",
+                               (unsigned long) count, PPP_MTU);
                count = PPP_MTU;
        }
 /*
@@ -2129,7+2131,7 @@ ppp_tty_write (struct tty_struct *tty, struct file *file, const __u8 * data,
  */
        ppp_dev_xmit_frame (ppp, ppp->tbuf, new_data, count);
        kfree (new_data);
-       return (int) count;
+       return count;
 }
 
 /*
index bdef589..a8cbceb 100644 (file)
@@ -830,7+830,7 @@ static int pt_probe(struct device *dev)
          * the interrupt, and this marks the 'irqaction' as busy.
          */
         {
-            int irqval = request_irq(dev->irq, &pt_interrupt,0, "pt", NULL);
+            int irqval = request_irq(dev->irq, &pt_interrupt,0, "pt", dev);
             if (irqval) {
                 printk(KERN_ERR "PT: ERROR: Unable to get IRQ %d (irqval = %d).\n",
                     dev->irq, irqval);
@@ -900,7+900,6 @@ static int pt_open(struct device *dev)
                 return -EAGAIN;
             }
         }
-       irq2dev_map[dev->irq] = dev;
 
          /* Reset hardware */
          chipset_init(dev);
@@ -1772,7+1771,6 @@ void cleanup_module(void)
 {
        free_irq(pt0a.irq, NULL);       /* IRQs and IO Ports are shared */
        release_region(pt0a.base_addr & 0x3f0, PT_TOTAL_SIZE);
-       irq2dev_map[pt0a.irq] = NULL;
 
        kfree(pt0a.priv);
        pt0a.priv = NULL;
index feaeef4..46c3e5c 100644 (file)
@@ -872,7+872,7 @@ static void sdla_isr(int irq, void *dev_id, struct pt_regs * regs)
        struct frad_local *flp;
        char              byte;
 
-       dev = irq2dev_map[irq];
+       dev = dev_id;
 
        if (dev == NULL)
        {
@@ -1475,11+1475,9 @@ int sdla_set_config(struct device *dev, struct ifmap *map)
        }
        dev->irq = map->irq;
 
-       if (request_irq(dev->irq, &sdla_isr, 0, dev->name, NULL)) 
+       if (request_irq(dev->irq, &sdla_isr, 0, dev->name, dev)) 
                return(-EAGAIN);
 
-       irq2dev_map[dev->irq] = dev;
-
        if (flp->type == SDLA_S507)
        {
                switch(dev->irq)
index 1a41960..7fdf711 100644 (file)
@@ -305,7+305,7 @@ __initfunc(static int seeq8005_probe1(struct device *dev, int ioaddr))
 
 #if 0
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", NULL);
+                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
@@ -351,14+351,13 @@ seeq8005_open(struct device *dev)
        struct net_local *lp = (struct net_local *)dev->priv;
 
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", NULL);
+                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
                         return EAGAIN;
                 }
        }
-       irq2dev_map[dev->irq] = dev;
 
        /* Reset the hardware here.  Don't forget to set the station address. */
        seeq8005_init(dev, 1);
@@ -413,7+412,7 @@ seeq8005_send_packet(struct sk_buff *skb, struct device *dev)
 static void
 seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status, boguscount = 0;
 
@@ -576,8+575,6 @@ seeq8005_close(struct device *dev)
 
        free_irq(dev->irq, NULL);
 
-       irq2dev_map[dev->irq] = 0;
-
        /* Update the statistics here. */
 
        return 0;
index 51e8fe8..d2bfb2e 100644 (file)
@@ -451,8+451,6 @@ struct priv
 
 /* IRQ map used to reserve a IRQ (see SK_open()) */
 
-/* extern void *irq2dev_map[16]; */ /* Declared in <linux/ioport.h> */
-
 /* static variables */
 
 static SK_RAM *board;  /* pointer to our memory mapped board components */
@@ -610,8+608,7 @@ __initfunc(int SK_init(struct device *dev))
  * Return Value   : 0 = Initialization done             
  * Errors         : ENODEV - No SK_G16 found
  *                  -1     - Configuration problem
- * Globals        : irq2dev_map - Which device uses which IRQ
- *                : board       - pointer to SK_RAM
+ * Globals        : board       - pointer to SK_RAM
  * Update History :
  *     YY/MM/DD  uid  Description
  *     94/06/30  pwe  SK_ADDR now checked and at the correct place
@@ -838,7+835,6 @@ __initfunc(int SK_probe(struct device *dev, short ioaddr))
  * Parameters     : I : struct device *dev - SK_G16 device structure
  * Return Value   : 0 - Device opened
  * Errors         : -EAGAIN - Open failed
- * Globals        : irq2dev_map - which device uses which irq
  * Side Effects   : None
  * Update History :
  *     YY/MM/DD  uid  Description
@@ -872,7+868,7 @@ static int SK_open(struct device *dev)
 
        do
        {
-         irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16", NULL);
+         irqval = request_irq(irqtab[i], &SK_interrupt, 0, "sk_g16", dev);
          i++;
        } while (irqval && irqtab[i]);
 
@@ -889,7+885,7 @@ static int SK_open(struct device *dev)
     }
     else if (dev->irq == 2) /* IRQ2 is always IRQ9 */
     {
-       if (request_irq(9, &SK_interrupt, 0, "sk_g16", NULL))
+       if (request_irq(9, &SK_interrupt, 0, "sk_g16", dev))
        {
            printk("%s: unable to get IRQ 9\n", dev->name);
            return -EAGAIN;
@@ -910,7+906,7 @@ static int SK_open(struct device *dev)
 
        /* check if IRQ free and valid. Then install Interrupt handler */
 
-       if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16", NULL))
+       if (request_irq(dev->irq, &SK_interrupt, 0, "sk_g16", dev))
        {
            printk("%s: unable to get selected IRQ\n", dev->name);
            return -EAGAIN;
@@ -937,8+933,6 @@ static int SK_open(struct device *dev)
        outb(i<<2, SK_POS4);           /* Set IRQ on card */
     }
 
-    irq2dev_map[dev->irq] = dev;       /* Set IRQ as used by us */
-    
     printk("%s: Schneider & Koch G16 at %#3x, IRQ %d, shared mem at %#08x\n",
            dev->name, (unsigned int)dev->base_addr, 
            (int) dev->irq, (unsigned int) p->ram);
@@ -1282,7+1276,7 @@ static int SK_send_packet(struct sk_buff *skb, struct device *dev)
 static void SK_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
     int csr0;
-    struct device *dev = (struct device *) irq2dev_map[irq];
+    struct device *dev = dev_id;
     struct priv *p = (struct priv *) dev->priv;
 
 
@@ -1637,7+1631,6 @@ static int SK_close(struct device *dev)
     SK_write_reg(CSR0, CSR0_STOP); /* STOP the LANCE */
 
     free_irq(dev->irq, NULL);      /* Free IRQ */
-    irq2dev_map[dev->irq] = 0;     /* Mark IRQ as unused */
 
     return 0; /* always succeed */
     
index 0df5fea..76a44ac 100644 (file)
@@ -221,7+221,7 @@ __initfunc(static int netcard_probe1(struct device *dev, int ioaddr))
                dev->irq = 9;
 
        {
-               int irqval = request_irq(dev->irq, &net_interrupt, 0, cardname, NULL);
+               int irqval = request_irq(dev->irq, &net_interrupt, 0, cardname, dev);
                if (irqval) {
                        printk("%s: unable to get IRQ %d (irqval=%d).\n",
                                   dev->name, dev->irq, irqval);
@@ -314,7+314,7 @@ net_open(struct device *dev)
         * This is used if the interrupt line can turned off (shared).
         * See 3c503.c for an example of selecting the IRQ at config-time.
         */
-       if (request_irq(dev->irq, &net_interrupt, 0, cardname, NULL)) {
+       if (request_irq(dev->irq, &net_interrupt, 0, cardname, dev)) {
                return -EAGAIN;
        }
        /*
@@ -325,7+325,6 @@ net_open(struct device *dev)
                free_irq(dev->irq, NULL);
                return -EAGAIN;
        }
-       irq2dev_map[dev->irq] = dev;
 
        /* Reset the hardware here. Don't forget to set the station address. */
        /*chipset_init(dev, 1);*/
@@ -390,7+389,7 @@ static int net_send_packet(struct sk_buff *skb, struct device *dev)
  */
 static void net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = (struct device *)(irq2dev_map[irq]);
+       struct device *dev = dev_id;
        struct net_local *lp;
        int ioaddr, status, boguscount = 0;
 
@@ -501,8+500,6 @@ net_close(struct device *dev)
        free_irq(dev->irq, NULL);
        free_dma(dev->dma);
 
-       irq2dev_map[dev->irq] = 0;
-
        /* Update the statistics here. */
 
        MOD_DEC_USE_COUNT;
index 43872c5..76d0bd4 100644 (file)
@@ -192,7+192,7 @@ static int ultramca_open(struct device *dev)
 {
        int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
 
-       if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, NULL))
+       if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, dev))
        return -EAGAIN;
 
        outb(ULTRA_MEMENB, ioaddr); /* Enable memory */
@@ -290,7+290,6 @@ static int ultramca_close_card(struct device *dev)
 
        outb(0x00, ioaddr + 6);     /* Disable interrupts. */
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = 0;
 
        NS8390_init(dev, 0);
        /* We should someday disable shared memory and change to 8-bit mode
@@ -366,7+365,7 @@ void cleanup_module(void)
                struct device *dev = &dev_ultra[this_dev];
                if (dev->priv != NULL)
                {
-                       /* NB: ultra_close_card() does free_irq + irq2dev */
+                       /* NB: ultra_close_card() does free_irq */
                        int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
                        kfree(dev->priv);
                        dev->priv = NULL;
index 30c6b49..d8dd263 100644 (file)
@@ -253,7+253,7 @@ ultra_open(struct device *dev)
 {
        int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
 
-       if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, NULL))
+       if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, dev))
                return -EAGAIN;
 
        outb(0x00, ioaddr);     /* Disable shared memory for safety. */
@@ -406,7+406,6 @@ ultra_close_card(struct device *dev)
 
        outb(0x00, ioaddr + 6);         /* Disable interrupts. */
        free_irq(dev->irq, NULL);
-       irq2dev_map[dev->irq] = 0;
 
        NS8390_init(dev, 0);
 
@@ -474,7+473,7 @@ cleanup_module(void)
        for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) {
                struct device *dev = &dev_ultra[this_dev];
                if (dev->priv != NULL) {
-                       /* NB: ultra_close_card() does free_irq + irq2dev */
+                       /* NB: ultra_close_card() does free_irq */
                        int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
                        kfree(dev->priv);
                        dev->priv = NULL;
index 55f0412..305e9f0 100644 (file)
@@ -1102,13+1102,12 @@ __initfunc(static int  smc_initcard(struct device *dev, int ioaddr))
        ether_setup(dev);
 
        /* Grab the IRQ */
-       irqval = request_irq(dev->irq, &smc_interrupt, 0, CARDNAME, NULL);
+       irqval = request_irq(dev->irq, &smc_interrupt, 0, CARDNAME, dev);
        if (irqval) {
                  printk(CARDNAME": unable to get IRQ %d (irqval=%d).\n",
                dev->irq, irqval);
                  return -EAGAIN;
        }
-       irq2dev_map[dev->irq] = dev;
 
        /* Grab the region so that no one else tries to probe our ioports. */
        request_region(ioaddr, SMC_IO_EXTENT, CARDNAME);
@@ -1274,7+1273,7 @@ static void smc_interrupt(int irq, void * dev_id,  struct pt_regs * regs)
 static void smc_interrupt(int irq, struct pt_regs * regs)
 #endif
 {
-       struct device *dev      = (struct device *)(irq2dev_map[irq]);
+       struct device *dev      = dev_id;
        int ioaddr              = dev->base_addr;
        struct smc_local *lp    = (struct smc_local *)dev->priv;
 
@@ -1765,7+1764,6 @@ void cleanup_module(void)
        unregister_netdev(&devSMC9194);
 
        free_irq(devSMC9194.irq, NULL );
-       irq2dev_map[devSMC9194.irq] = NULL;
        release_region(devSMC9194.base_addr, SMC_IO_EXTENT);
 
        if (devSMC9194.priv)
index 336283d..e68ebf2 100644 (file)
@@ -3666,14+3666,7 @@ wavelan_interrupt(int                    irq,
   u_short      status;
   u_short      ack_cmd;
 
-  if((dev = (device *) (irq2dev_map[irq])) == (device *) NULL)
-    {
-#ifdef DEBUG_INTERRUPT_ERROR
-      printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
-            irq);
-#endif
-      return;
-    }
+  dev = dev_id;
 
 #ifdef DEBUG_INTERRUPT_TRACE
   printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
@@ -3913,12+3906,8 @@ wavelan_open(device *    dev)
       return -ENXIO;
     }
 
-  if((irq2dev_map[dev->irq] != (device *) NULL) ||
-     /* This is always true, but avoid the false IRQ. */
-     ((irq2dev_map[dev->irq] = dev) == (device *) NULL) ||
-     (request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", NULL) != 0))
+  if(request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", dev) != 0)
     {
-      irq2dev_map[dev->irq] = (device *) NULL;
 #ifdef DEBUG_CONFIG_ERRORS
       printk(KERN_WARNING "%s: wavelan_open(): invalid irq\n", dev->name);
 #endif
@@ -3934,7+3923,6 @@ wavelan_open(device *     dev)
   else
     {
       free_irq(dev->irq, NULL);
-      irq2dev_map[dev->irq] = (device *) NULL;
 #ifdef DEBUG_CONFIG_ERRORS
       printk(KERN_INFO "%s: wavelan_open(): impossible to start the card\n",
             dev->name);
@@ -3983,7+3971,6 @@ wavelan_close(device *    dev)
   wv_82586_stop(dev);
 
   free_irq(dev->irq, NULL);
-  irq2dev_map[dev->irq] = (device *) NULL;
 
   MOD_DEC_USE_COUNT;
 
index 56e8bd5..1970d5d 100644 (file)
@@ -254,7+254,7 @@ __initfunc(int wd_probe1(struct device *dev, int ioaddr))
 
        /* Snarf the interrupt now.  There's no point in waiting since we cannot
           share and the board will usually be enabled. */
-       if (request_irq(dev->irq, ei_interrupt, 0, model_name, NULL)) {
+       if (request_irq(dev->irq, ei_interrupt, 0, model_name, dev)) {
                printk (" unable to get IRQ %d.\n", dev->irq);
                return EAGAIN;
        }
@@ -500,7+500,6 @@ cleanup_module(void)
                        kfree(dev->priv);
                        dev->priv = NULL;
                        free_irq(dev->irq, NULL);
-                       irq2dev_map[dev->irq] = NULL;
                        release_region(ioaddr, WD_IO_EXTENT);
                        unregister_netdev(dev);
                }
index cb53120..ba14ff9 100644 (file)
@@ -247,13+247,12 @@ __initfunc(int znet_probe(struct device *dev))
        zn.tx_dma = netinfo->dma2;
 
        /* These should never fail.  You can't add devices to a sealed box! */
-       if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet", NULL)
+       if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet", dev)
                || request_dma(zn.rx_dma,"ZNet rx")
                || request_dma(zn.tx_dma,"ZNet tx")) {
                printk(KERN_WARNING "%s: Not opened -- resource busy?!?\n", dev->name);
                return EBUSY;
        }
-       irq2dev_map[dev->irq] = dev;
 
        /* Allocate buffer memory.      We can cross a 128K boundary, so we
           must be careful about the allocation.  It's easiest to waste 8K. */
@@ -403,7+402,7 @@ static int znet_send_packet(struct sk_buff *skb, struct device *dev)
 /* The ZNET interrupt handler. */
 static void    znet_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-       struct device *dev = irq2dev_map[irq];
+       struct device *dev = dev_id;
        int ioaddr;
        int boguscnt = 20;
 
index a0d7908..c9ea5a3 100644 (file)
@@ -42,10+42,15 @@ struct pci_dev *pci_devices = 0;
  */
 struct pci_dev_info dev_info[] = {
        DEVICE( COMPAQ,         COMPAQ_1280,    "QVision 1280/p"),
-       DEVICE( COMPAQ,         COMPAQ_NETELL100,"Netelligent 10/100"),
-       DEVICE( COMPAQ,         COMPAQ_NETELL10,"Netelligent 10"),
-       DEVICE( COMPAQ,         COMPAQ_NETFLEX3,"NetFlex 3"),
+       DEVICE( COMPAQ,         COMPAQ_SMART2P, "Smart-2/P RAID Controller"),
+       DEVICE( COMPAQ,         COMPAQ_NETEL100,"Netelligent 10/100"),
+       DEVICE( COMPAQ,         COMPAQ_NETEL10, "Netelligent 10"),
+       DEVICE( COMPAQ,         COMPAQ_NETFLEX3I,"NetFlex 3"),
+       DEVICE( COMPAQ,         COMPAQ_NETEL100D,"Netelligent 10/100 Dual"),
+       DEVICE( COMPAQ,         COMPAQ_NETEL100PI,"Netelligent 10/100 ProLiant"),
+       DEVICE( COMPAQ,         COMPAQ_NETEL100I,"Netelligent 10/100 Integrated"),
        DEVICE( COMPAQ,         COMPAQ_THUNDER, "ThunderLAN"),
+       DEVICE( COMPAQ,         COMPAQ_NETFLEX3B,"NetFlex 3 BNC"),
        DEVICE( NCR,            NCR_53C810,     "53c810"),
        DEVICE( NCR,            NCR_53C820,     "53c820"),
        DEVICE( NCR,            NCR_53C825,     "53c825"),
@@ -58,7+63,9 @@ struct pci_dev_info dev_info[] = {
        DEVICE( ATI,            ATI_68800,      "68800AX"),
        DEVICE( ATI,            ATI_215CT222,   "215CT222"),
        DEVICE( ATI,            ATI_210888CX,   "210888CX"),
+       DEVICE( ATI,            ATI_215GP,      "Mach64 GP (Rage Pro)"),
        DEVICE( ATI,            ATI_215GT,      "Mach64 GT (Rage II)"),
+       DEVICE( ATI,            ATI_215GTB,     "Mach64 GT (Rage II)"),
        DEVICE( ATI,            ATI_210888GX,   "210888GX"),
        DEVICE( ATI,            ATI_264VT,      "Mach64 VT"),
        DEVICE( VLSI,           VLSI_82C592,    "82C592-FC1"),
@@ -134,7+141,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( SI,             SI_5571,        "5571"),
        DEVICE( SI,             SI_7001,        "7001"),
        DEVICE( HP,             HP_J2585A,      "J2585A"),
-       DEVICE( HP,             HP_J2585B,      "J2585B"),
+       DEVICE( HP,             HP_J2585B,      "J2585B (Lassen)"),
        DEVICE( PCTECH,         PCTECH_RZ1000,  "RZ1000 (buggy)"),
        DEVICE( PCTECH,         PCTECH_RZ1001,  "RZ1001 (buggy?)"),
        DEVICE( DPT,            DPT,            "SmartCache/Raid"),
@@ -156,9+163,6 @@ struct pci_dev_info dev_info[] = {
        DEVICE( MOTOROLA,       MOTOROLA_MPC106,"MPC106 Grackle"),
        DEVICE( MOTOROLA,       MOTOROLA_RAVEN, "Raven"),
        DEVICE( PROMISE,        PROMISE_5300,   "DC5030"),
-       DEVICE( APPLE,          APPLE_BANDIT,   "Bandit"),
-       DEVICE( APPLE,          APPLE_GC,       "Grand Central"),
-       DEVICE( APPLE,          APPLE_HYDRA,    "Hydra"),
        DEVICE( N9,             N9_I128,        "Imagine 128"),
        DEVICE( N9,             N9_I128_2,      "Imagine 128v2"),
        DEVICE( UMC,            UMC_UM8673F,    "UM8673F"),
@@ -171,6+175,10 @@ struct pci_dev_info dev_info[] = {
        DEVICE( UMC,            UMC_UM8886N,    "UM8886N"),
        DEVICE( UMC,            UMC_UM8891N,    "UM8891N"),
        DEVICE( X,              X_AGX016,       "ITT AGX016"),
+       DEVICE( PICOP,          PICOP_PT86C52X, "PT86C52x Vesuvius"),
+       DEVICE( APPLE,          APPLE_BANDIT,   "Bandit"),
+       DEVICE( APPLE,          APPLE_GC,       "Grand Central"),
+       DEVICE( APPLE,          APPLE_HYDRA,    "Hydra"),
        DEVICE( NEXGEN,         NEXGEN_82C501,  "82C501"),
        DEVICE( QLOGIC,         QLOGIC_ISP1020, "ISP1020"),
        DEVICE( QLOGIC,         QLOGIC_ISP1022, "ISP1022"),
@@ -191,7+199,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( CMD,            CMD_670,        "670"),
        DEVICE( VISION,         VISION_QD8500,  "QD-8500"),
        DEVICE( VISION,         VISION_QD8580,  "QD-8580"),
-       DEVICE( BROOKTREE,      BT848,          "Brooktree 848"),
+       DEVICE( BROOKTREE,      BROOKTREE_848,  "Bt848"),
        DEVICE( SIERRA,         SIERRA_STB,     "STB Horizon 64"),
        DEVICE( ACC,            ACC_2056,       "2056"),
        DEVICE( WINBOND,        WINBOND_83769,  "W83769F"),
@@ -205,6+213,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( 3COM,           3COM_3C900TPO,  "3C900 10bTPO"),
        DEVICE( 3COM,           3COM_3C900COMBO,"3C900 10b Combo"),
        DEVICE( 3COM,           3COM_3C905TX,   "3C905 100bTX"),
+       DEVICE( SMC,            SMC_EPIC100,    "9432 TX"),
        DEVICE( AL,             AL_M1445,       "M1445"),
        DEVICE( AL,             AL_M1449,       "M1449"),
        DEVICE( AL,             AL_M1451,       "M1451"),
@@ -212,9+221,16 @@ struct pci_dev_info dev_info[] = {
        DEVICE( AL,             AL_M1489,       "M1489"),
        DEVICE( AL,             AL_M1511,       "M1511"),
        DEVICE( AL,             AL_M1513,       "M1513"),
+       DEVICE( AL,             AL_M1521,       "M1521"),
+       DEVICE( AL,             AL_M1523,       "M1523"),
+       DEVICE( AL,             AL_M1531,       "M1531 Aladdin IV"),
+       DEVICE( AL,             AL_M1533,       "M1533 Aladdin IV"),
        DEVICE( AL,             AL_M4803,       "M4803"),
+       DEVICE( AL,             AL_M5219,       "M5219"),
+       DEVICE( AL,             AL_M5229,       "M5229 TXpro"),
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_NM2070,     "Magicgraph NM2070"),
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128V, "MagicGraph 128V"),
+       DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128ZV, "MagicGraph 128ZV"),
        DEVICE( ASP,            ASP_ABP940,     "ABP940"),
        DEVICE( ASP,            ASP_ABP940U,    "ABP940U"),
        DEVICE( CERN,           CERN_SPSB_PMC,  "STAR/RD24 SCI-PCI (PMC)"),
@@ -232,12+248,16 @@ struct pci_dev_info dev_info[] = {
        DEVICE( INIT,           INIT_320P,      "320 P"),
        DEVICE( VIA,            VIA_82C505,     "VT 82C505"),
        DEVICE( VIA,            VIA_82C561,     "VT 82C561"),
-       DEVICE( VIA,            VIA_82C586_1,   "VT 82C586 Apollo VP-1"),
+       DEVICE( VIA,            VIA_82C586_1,   "VT 82C586 Apollo IDE"),
        DEVICE( VIA,            VIA_82C576,     "VT 82C576 3V"),
-       DEVICE( VIA,            VIA_82C585,     "VT 82C585VP Apollo VP-1"),
-       DEVICE( VIA,            VIA_82C586,     "VT 82C586 Apollo VP-1"),
+       DEVICE( VIA,            VIA_82C585,     "VT 82C585 Apollo VP1/VPX"),
+       DEVICE( VIA,            VIA_82C586_0,   "VT 82C586 Apollo ISA"),
+       DEVICE( VIA,            VIA_82C595,     "VT 82C595 Apollo VP2"),
        DEVICE( VIA,            VIA_82C416,     "VT 82C416MV"),
        DEVICE( VIA,            VIA_82C926,     "VT 82C926 Amazon"),
+       DEVICE( VIA,            VIA_82C595_97,  "VT 82C595 Apollo VP2/97"),
+       DEVICE( VIA,            VIA_82C586_2,   "VT 82C586 Apollo USB"),
+       DEVICE( VIA,            VIA_82C586_3,   "VT 82C586B Apollo ACPI"),
        DEVICE( VORTEX,         VORTEX_GDT60x0, "GDT 60x0"),
        DEVICE( VORTEX,         VORTEX_GDT6000B,"GDT 6000b"),
        DEVICE( VORTEX,         VORTEX_GDT6x10, "GDT 6110/6510"),
@@ -252,6+272,24 @@ struct pci_dev_info dev_info[] = {
        DEVICE( VORTEX,         VORTEX_GDT6x25, "GDT 6125/6525"),
        DEVICE( VORTEX,         VORTEX_GDT6535, "GDT 6535"),
        DEVICE( VORTEX,         VORTEX_GDT6555, "GDT 6555"),
+       DEVICE( VORTEX,         VORTEX_GDT6x17RP,"GDT 6117RP/6517RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6x27RP,"GDT 6127RP/6527RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6537RP,"GDT 6537RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6557RP,"GDT 6557RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6x11RP,"GDT 6111RP/6511RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6x21RP,"GDT 6121RP/6521RP"),
+       DEVICE( VORTEX,         VORTEX_GDT6x17RP1,"GDT 6117RP1/6517RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6x27RP1,"GDT 6127RP1/6527RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6537RP1,"GDT 6537RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6557RP1,"GDT 6557RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6x11RP1,"GDT 6111RP1/6511RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6x21RP1,"GDT 6121RP1/6521RP1"),
+       DEVICE( VORTEX,         VORTEX_GDT6x17RP2,"GDT 6117RP2/6517RP2"),
+       DEVICE( VORTEX,         VORTEX_GDT6x27RP2,"GDT 6127RP2/6527RP2"),
+       DEVICE( VORTEX,         VORTEX_GDT6537RP2,"GDT 6537RP2"),
+       DEVICE( VORTEX,         VORTEX_GDT6557RP2,"GDT 6557RP2"),
+       DEVICE( VORTEX,         VORTEX_GDT6x11RP2,"GDT 6111RP2/6511RP2"),
+       DEVICE( VORTEX,         VORTEX_GDT6x21RP2,"GDT 6121RP2/6521RP2"),
        DEVICE( EF,             EF_ATM_FPGA,            "155P-MF1 (FPGA)"),
        DEVICE( EF,             EF_ATM_ASIC,    "155P-MF1 (ASIC)"),
        DEVICE( FORE,           FORE_PCA200PC, "PCA-200PC"),
@@ -261,6+299,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( PLX,            PLX_9060,       "PCI9060 i960 bridge"),
        DEVICE( ALLIANCE,       ALLIANCE_PROMOTIO, "Promotion-6410"),
        DEVICE( ALLIANCE,       ALLIANCE_PROVIDEO, "Provideo"),
+       DEVICE( ALLIANCE,       ALLIANCE_AT24,  "AT24"),
        DEVICE( VMIC,           VMIC_VME,       "VMIVME-7587"),
        DEVICE( DIGI,           DIGI_RIGHTSWITCH, "RightSwitch SE-6"),
        DEVICE( MUTECH,         MUTECH_MV1000,  "MV-1000"),
@@ -277,6+316,7 @@ struct pci_dev_info dev_info[] = {
        DEVICE( IKON,           IKON_10117,     "10117 Greensheet"),
        DEVICE( ZORAN,          ZORAN_36057,    "ZR36057"),
        DEVICE( ZORAN,          ZORAN_36120,    "ZR36120"),
+       DEVICE( COMPEX,         COMPEX_ENET100VG4, "Readylink ENET100-VG4"),
        DEVICE( COMPEX,         COMPEX_RL2000,  "ReadyLink 2000"),
        DEVICE( RP,             RP8OCTA,        "RocketPort 8 Oct"),
        DEVICE( RP,             RP8INTF,        "RocketPort 8 Intf"),
@@ -293,6+333,9 @@ struct pci_dev_info dev_info[] = {
        DEVICE( OPTIBASE,       OPTIBASE_VPLEX, "VideoPlex"),
        DEVICE( OPTIBASE,       OPTIBASE_VPLEXCC,"VideoPlex CC"),
        DEVICE( OPTIBASE,       OPTIBASE_VQUEST,"VideoQuest"),
+       DEVICE( ENSONIQ,        ENSONIQ_AUDIOPCI,"AudioPCI"),
+       DEVICE( PICTUREL,       PICTUREL_PCIVST,"PCIVST"),
+       DEVICE( NVIDIA,         NVIDIA_RIVA128, "Riva 128"),
        DEVICE( SYMPHONY,       SYMPHONY_101,   "82C101"),
        DEVICE( TEKRAM,         TEKRAM_DC290,   "DC-290"),
        DEVICE( 3DLABS,         3DLABS_300SX,   "GLINT 300SX"),
@@ -301,6+344,8 @@ struct pci_dev_info dev_info[] = {
        DEVICE( 3DLABS,         3DLABS_PERMEDIA,"PERMEDIA"),
        DEVICE( AVANCE,         AVANCE_ALG2064, "ALG2064i"),
        DEVICE( AVANCE,         AVANCE_2302,    "ALG-2302"),
+       DEVICE( NETVIN,         NETVIN_NV5000SC,"NV5000"),
+       DEVICE( S3,             S3_PLATO_PXS,   "PLATO/PX (system)"),
        DEVICE( S3,             S3_ViRGE,       "ViRGE"),
        DEVICE( S3,             S3_TRIO,        "Trio32/Trio64"),
        DEVICE( S3,             S3_AURORA64VP,  "Aurora64V+"),
@@ -313,9+358,10 @@ struct pci_dev_info dev_info[] = {
        DEVICE( S3,             S3_964_1,       "Vision 964-P"),
        DEVICE( S3,             S3_964_2,       "Vision 964-P"),
        DEVICE( S3,             S3_968,         "Vision 968"),
-       DEVICE( S3,             S3_TRIO64V2,    "Trio64V2"),
-       DEVICE( S3,             S3_PLATO_PXG,   "Plato"),
-       DEVICE( S3,             S3_ViRGE_DXGX,  "ViRGE/DX"),
+       DEVICE( S3,             S3_TRIO64V2,    "Trio64V2/DX or /GX"),
+       DEVICE( S3,             S3_PLATO_PXG,   "PLATO/PX (graphics)"),
+       DEVICE( S3,             S3_ViRGE_DXGX,  "ViRGE/DX or /GX"),
+       DEVICE( S3,             S3_ViRGE_GX2,   "ViRGE/GX2"),
        DEVICE( INTEL,          INTEL_82375,    "82375EB"),
        BRIDGE( INTEL,          INTEL_82424,    "82424ZX Saturn",       0x00),
        DEVICE( INTEL,          INTEL_82378,    "82378IB"),
@@ -339,12+385,12 @@ struct pci_dev_info dev_info[] = {
        DEVICE( INTEL,          INTEL_82371SB_2,"82371SB Natoma/Triton II PIIX3"),
        DEVICE( INTEL,          INTEL_82437VX,  "82437VX Triton II"),
        DEVICE( INTEL,          INTEL_82439TX,  "82439TX"),
-       DEVICE( INTEL,          INTEL_82371AB_0,"82371AB PIIX4"),
-       DEVICE( INTEL,          INTEL_82371AB,  "82371AB 430TX PIIX4"),
-       DEVICE( INTEL,          INTEL_82371AB_2,"82371AB PIIX4"),
-       DEVICE( INTEL,          INTEL_82371AB_3,"82371AB PIIX4 Power Management"),
+       DEVICE( INTEL,          INTEL_82371AB_0,"82371AB PIIX4 ISA"),
+       DEVICE( INTEL,          INTEL_82371AB,  "82371AB PIIX4 IDE"),
+       DEVICE( INTEL,          INTEL_82371AB_2,"82371AB PIIX4 USB"),
+       DEVICE( INTEL,          INTEL_82371AB_3,"82371AB PIIX4 ACPI"),
        DEVICE( INTEL,          INTEL_P6,       "Orion P6"),
-       DEVICE( INTEL,          INTEL_P6_2,     "82450GX Orion P6"),
+       DEVICE( INTEL,          INTEL_82450GX,  "82450GX Orion P6"),
        DEVICE( KTI,            KTI_ET32P2,     "ET32P2"),
        DEVICE( ADAPTEC,        ADAPTEC_7850,   "AIC-7850"),
        DEVICE( ADAPTEC,        ADAPTEC_7855,   "AIC-7855"),
@@ -577,6+623,7 @@ const char *pci_strvendor(unsigned int vendor)
              case PCI_VENDOR_ID_MATROX:        return "Matrox";
              case PCI_VENDOR_ID_CT:            return "Chips & Technologies";
              case PCI_VENDOR_ID_MIRO:          return "Miro";
+             case PCI_VENDOR_ID_NEC:           return "NEC";
              case PCI_VENDOR_ID_FD:            return "Future Domain";
              case PCI_VENDOR_ID_SI:            return "Silicon Integrated Systems";
              case PCI_VENDOR_ID_HP:            return "Hewlett Packard";
@@ -590,10+637,11 @@ const char *pci_strvendor(unsigned int vendor)
              case PCI_VENDOR_ID_WINBOND2:      return "Winbond";
              case PCI_VENDOR_ID_MOTOROLA:      return "Motorola";
              case PCI_VENDOR_ID_PROMISE:       return "Promise Technology";
-             case PCI_VENDOR_ID_APPLE:         return "Apple";
              case PCI_VENDOR_ID_N9:            return "Number Nine";
              case PCI_VENDOR_ID_UMC:           return "UMC";
              case PCI_VENDOR_ID_X:             return "X TECHNOLOGY";
+             case PCI_VENDOR_ID_PICOP:         return "PicoPower";
+             case PCI_VENDOR_ID_APPLE:         return "Apple";
              case PCI_VENDOR_ID_NEXGEN:        return "Nexgen";
              case PCI_VENDOR_ID_QLOGIC:        return "Q Logic";
              case PCI_VENDOR_ID_LEADTEK:       return "Leadtek Research";
@@ -649,10+697,14 @@ const char *pci_strvendor(unsigned int vendor)
              case PCI_VENDOR_ID_3DFX:          return "3Dfx";
              case PCI_VENDOR_ID_SIGMADES:      return "Sigma Designs";
              case PCI_VENDOR_ID_OPTIBASE:      return "Optibase";
+             case PCI_VENDOR_ID_ENSONIQ:       return "Ensoniq";
+             case PCI_VENDOR_ID_PICTUREL:      return "Picture Elements";
+             case PCI_VENDOR_ID_NVIDIA:        return "NVidia/SGS Thomson";
              case PCI_VENDOR_ID_SYMPHONY:      return "Symphony";
              case PCI_VENDOR_ID_TEKRAM:        return "Tekram";
              case PCI_VENDOR_ID_3DLABS:        return "3Dlabs";
              case PCI_VENDOR_ID_AVANCE:        return "Avance";
+             case PCI_VENDOR_ID_NETVIN:        return "NetVin";
              case PCI_VENDOR_ID_S3:            return "S3 Inc.";
              case PCI_VENDOR_ID_INTEL:         return "Intel";
              case PCI_VENDOR_ID_KTI:           return "KTI";
@@ -691,10+743,10 @@ const char *pcibios_strerror(int error)
                case PCIBIOS_BAD_REGISTER_NUMBER:
                        return "BAD_REGISTER_NUMBER";
 
-                case PCIBIOS_SET_FAILED:          
+               case PCIBIOS_SET_FAILED:
                        return "SET_FAILED";
 
-                case PCIBIOS_BUFFER_TOO_SMALL:    
+               case PCIBIOS_BUFFER_TOO_SMALL:
                        return "BUFFER_TOO_SMALL";
 
                default:
index dcf0c02..a94fb56 100644 (file)
@@ -200,12+200,19 @@ static void sg_free(char *buff,int size)
  * complete semaphores to tell us whether the buffer is available for us
  * and whether the command is actually done.
  */
-static long sg_read(struct inode *inode,struct file *filp,char *buf,unsigned long count)
+static ssize_t sg_read(struct file *filp, char *buf,
+                       size_t count, loff_t *ppos)
 {
+    struct inode *inode = filp->f_dentry->d_inode;
     int dev=MINOR(inode->i_rdev);
     int i;
     unsigned long flags;
     struct scsi_generic *device=&scsi_generics[dev];
+
+    if (ppos != &filp->f_pos) {
+      /* FIXME: Hmm.  Seek to the right place, or fail?  */
+    }
+
     if ((i=verify_area(VERIFY_WRITE,buf,count)))
        return i;
 
@@ -322,8+329,10 @@ static void sg_command_done(Scsi_Cmnd * SCpnt)
     wake_up(&scsi_generics[dev].read_wait);
 }
 
-static long sg_write(struct inode *inode,struct file *filp,const char *buf,unsigned long count)
+static ssize_t sg_write(struct file *filp, const char *buf, 
+                        size_t count, loff_t *ppos)
 {
+    struct inode         *inode = filp->f_dentry->d_inode;
     int                          bsize,size,amt,i;
     unsigned char        cmnd[MAX_COMMAND_SIZE];
     kdev_t               devt = inode->i_rdev;
@@ -333,6+342,10 @@ static long sg_write(struct inode *inode,struct file *filp,const char *buf,unsig
     unsigned char        opcode;
     Scsi_Cmnd          * SCpnt;
 
+    if (ppos != &filp->f_pos) {
+      /* FIXME: Hmm.  Seek to the right place, or fail?  */
+    }
+
     if ((i=verify_area(VERIFY_READ,buf,count)))
        return i;
     /*
index 07fa2bf..3abf852 100644 (file)
@@ -955,12+955,12 @@ out:
 
 \f
 /* Write command */
-       static long
-st_write(struct inode * inode, struct file * filp, const char * buf,
-        unsigned long count)
+static ssize_t
+st_write(struct file * filp, const char * buf, size_t count, loff_t *ppos)
 {
-    long total;
-    int i, do_count, blks, retval, transfer;
+    struct inode *inode = filp->f_dentry->d_inode;
+    ssize_t total;
+    ssize_t i, do_count, blks, retval, transfer;
     int write_threshold;
     int doing_write = 0;
     static unsigned char cmd[10];
@@ -971,6+971,11 @@ st_write(struct inode * inode, struct file * filp, const char * buf,
     ST_partstat * STps;
     int dev = TAPE_NR(inode->i_rdev);
 
+    if (ppos != &filp->f_pos) {
+      /* "A request was outside the capabilities of the device." */
+      return -ENXIO;
+    }
+
     STp = &(scsi_tapes[dev]);
     if (STp->ready != ST_READY)
       return (-EIO);
@@ -1254,7+1259,7 @@ st_write(struct inode * inode, struct file * filp, const char * buf,
 /* Read data from the tape. Returns zero in the normal case, one if the
    eof status has changed, and the negative error code in case of a
    fatal error. Otherwise updates the buffer and the eof state. */
-       static long
+static long
 read_tape(struct inode *inode, long count, Scsi_Cmnd **aSCpnt)
 {
     int transfer, blks, bytes;
@@ -1441,11+1446,12 @@ read_tape(struct inode *inode, long count, Scsi_Cmnd **aSCpnt)
 
 \f
 /* Read command */
-       static long
-st_read(struct inode * inode, struct file * filp, char * buf, unsigned long count)
+static ssize_t
+st_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
 {
-    long total;
-    int i, transfer;
+    struct inode * inode = filp->f_dentry->d_inode;
+    ssize_t total;
+    ssize_t i, transfer;
     int special;
     Scsi_Cmnd * SCpnt = NULL;
     Scsi_Tape * STp;
@@ -1453,6+1459,11 @@ st_read(struct inode * inode, struct file * filp, char * buf, unsigned long coun
     ST_partstat * STps;
     int dev = TAPE_NR(inode->i_rdev);
 
+    if (ppos != &filp->f_pos) {
+      /* "A request was outside the capabilities of the device." */
+      return -ENXIO;
+    }
+
     STp = &(scsi_tapes[dev]);
     if (STp->ready != ST_READY)
       return (-EIO);
index bb5b843..88e9c56 100644 (file)
@@ -9,11+9,19 @@ bool   'Quota support' CONFIG_QUOTA
 tristate 'Minix fs support' CONFIG_MINIX_FS
 tristate 'Second extended fs support' CONFIG_EXT2_FS
 
-# msdos filesystems
-tristate 'DOS FAT fs support' CONFIG_FAT_FS
-dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS
-dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS
-dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
+tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
+tristate 'Native language support (Unicode, codepages)' CONFIG_NLS
+if [ "$CONFIG_NLS" = "y" -o "$CONFIG_NLS" = "m" ]; then
+  if [ "$CONFIG_ISO9660_FS" = "y" -o "$CONFIG_ISO9660_FS" = "m" ]; then
+    bool 'Microsoft Joliet cdrom extensions' CONFIG_JOLIET
+  fi
+
+  # msdos filesystems
+  dep_tristate 'DOS FAT fs support' CONFIG_FAT_FS $CONFIG_NLS
+  dep_tristate 'MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS
+  dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
+  dep_tristate 'VFAT (Windows-95) fs support' CONFIG_VFAT_FS $CONFIG_FAT_FS
+fi
 
 bool '/proc filesystem support' CONFIG_PROC_FS
 if [ "$CONFIG_INET" = "y" ]; then
@@ -46,7+54,6 @@ fi
 if [ "$CONFIG_IPX" != "n" ]; then
   tristate 'NCP filesystem support (to mount NetWare volumes)' CONFIG_NCP_FS
 fi
-tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
 tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
 tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
 tristate 'Amiga FFS filesystem support' CONFIG_AFFS_FS
index c4abd22..cbd49d3 100644 (file)
@@ -17,7+17,7 @@ O_OBJS    = open.o read_write.o devices.o file_table.o buffer.o \
 
 MOD_LIST_NAME := FS_MODULES
 ALL_SUB_DIRS = minix ext2 fat msdos vfat proc isofs nfs umsdos \
-               hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd
+               hpfs sysv smbfs ncpfs ufs affs romfs autofs lockd nfsd nls
 
 ifeq ($(CONFIG_QUOTA),y)
 O_OBJS += dquot.o
@@ -110,6+110,18 @@ else
   endif
 endif
 
+# Since CONFIG_NLS might be set to y while there are modules
+# to be build in the nls/ directory, we need to enter the nls
+# directory every time, but with different rules.
+ifeq ($(CONFIG_NLS),y)
+SUB_DIRS += nls
+MOD_IN_SUB_DIRS += nls
+else
+  ifeq ($(CONFIG_NLS),m)
+  MOD_SUB_DIRS += nls
+  endif
+endif
+
 ifeq ($(CONFIG_UMSDOS_FS),y)
 SUB_DIRS += umsdos
 else
index cfd0564..95bf308 100644 (file)
 #include <linux/amigaffs.h>
 
 static int affs_readdir(struct file *, void *, filldir_t);
-static long affs_dir_read(struct inode * inode, struct file * filp, char * buf,
-                         unsigned long count);
+static ssize_t affs_dir_read(struct file * filp, char * buf,
+                            size_t count, loff_t *ppos);
 
 static struct file_operations affs_dir_operations = {
        NULL,                   /* lseek - default */
@@ -62,8+62,8 @@ struct inode_operations affs_dir_inode_operations = {
        NULL                    /* permissions */
 };
 
-static long
-affs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count)
+static ssize_t
+affs_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index eb7bfbf..273de8e 100644 (file)
 
 static int affs_bmap(struct inode *inode, int block);
 static struct buffer_head * affs_getblock(struct inode *inode, s32 block);
-static long affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf,
-                              unsigned long count);
-static long affs_file_write(struct inode *inode, struct file *filp, const char *buf,
-                           unsigned long count);
-static long affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf,
-                               unsigned long count);
+static ssize_t affs_file_read_ofs(struct file *filp, char *buf,
+                                 size_t count, loff_t *ppos);
+static ssize_t affs_file_write(struct file *filp, const char *buf,
+                              size_t count, loff_t *ppos);
+static ssize_t affs_file_write_ofs(struct file *filp, const char *buf,
+                                  size_t count, loff_t *ppos);
 static int affs_release_file(struct inode *inode, struct file *filp);
 static int alloc_ext_cache(struct inode *inode);
 
@@ -496,16+496,17 @@ affs_getblock(struct inode *inode, s32 block)
        return affs_bread(inode->i_dev,key,AFFS_I2BSIZE(inode));
 }
 
-static long
-affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf, unsigned long count)
+static ssize_t
+affs_file_read_ofs(struct file *filp, char *buf, size_t count, loff_t *ppos)
 {
+       struct inode *inode = filp->f_dentry->d_inode;
        char *start;
-       int left, offset, size, sector;
-       int blocksize;
+       ssize_t left, offset, size, sector;
+       ssize_t blocksize;
        struct buffer_head *bh;
        void *data;
 
-       pr_debug("AFFS: file_read_ofs(ino=%lu,pos=%lu,%d)\n",inode->i_ino,(long)filp->f_pos,count);
+       pr_debug("AFFS: file_read_ofs(ino=%lu,pos=%lu,%d)\n",inode->i_ino,(long)*ppos,count);
 
        if (!inode) {
                affs_error(inode->i_sb,"file_read_ofs","Inode = NULL");
@@ -516,24+517,24 @@ affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf, unsigned l
                pr_debug("affs_file_read: mode = %07o",inode->i_mode);
                return -EINVAL;
        }
-       if (filp->f_pos >= inode->i_size || count <= 0)
+       if (*ppos >= inode->i_size || count <= 0)
                return 0;
 
        start = buf;
        for (;;) {
-               left = MIN (inode->i_size - filp->f_pos,count - (buf - start));
+               left = MIN (inode->i_size - *ppos,count - (buf - start));
                if (!left)
                        break;
-               sector = affs_bmap(inode,(u32)filp->f_pos / blocksize);
+               sector = affs_bmap(inode,(u32)*ppos / blocksize);
                if (!sector)
                        break;
-               offset = (u32)filp->f_pos % blocksize;
+               offset = (u32)*ppos % blocksize;
                bh = affs_bread(inode->i_dev,sector,AFFS_I2BSIZE(inode));
                if (!bh)
                        break;
                data = bh->b_data + 24;
                size = MIN(blocksize - offset,left);
-               filp->f_pos += size;
+               *ppos += size;
                copy_to_user(buf,data + offset,size);
                buf += size;
                affs_brelse(bh);
@@ -543,13+544,14 @@ affs_file_read_ofs(struct inode *inode, struct file *filp, char *buf, unsigned l
        return buf - start;
 }
 
-static long
-affs_file_write(struct inode *inode, struct file *filp, const char *buf, unsigned long count)
+static ssize_t
+affs_file_write(struct file *filp, const char *buf, size_t count, loff_t *ppos)
 {
+       struct inode            *inode = filp->f_dentry->d_inode;
        off_t                    pos;
-       int                      written;
-       int                      c;
-       int                      blocksize;
+       ssize_t                  written;
+       ssize_t                  c;
+       ssize_t                  blocksize;
        struct buffer_head      *bh;
        struct inode            *ino;
        char                    *p;
@@ -558,7+560,7 @@ affs_file_write(struct inode *inode, struct file *filp, const char *buf, unsigne
        if (!count)
                return 0;
        pr_debug("AFFS: file_write(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino,
-               (unsigned long)filp->f_pos,count);
+               (unsigned long)*ppos,count);
 
        ino = NULL;
        if (!inode) {
@@ -591,7+593,7 @@ affs_file_write(struct inode *inode, struct file *filp, const char *buf, unsigne
        if (filp->f_flags & O_APPEND) {
                pos = inode->i_size;
        } else
-               pos = filp->f_pos;
+               pos = *ppos;
        written   = 0;
        blocksize = AFFS_I2BSIZE(inode);
 
@@ -628,25+630,26 @@ affs_file_write(struct inode *inode, struct file *filp, const char *buf, unsigne
        if (pos > inode->i_size)
                inode->i_size = pos;
        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-       filp->f_pos    = pos;
+       *ppos = pos;
        mark_inode_dirty(inode);
        iput(ino);
        return written;
 }
 
-static long
-affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf, unsigned long count)
+static ssize_t
+affs_file_write_ofs(struct file *filp, const char *buf, size_t count, loff_t *ppos)
 {
+       struct inode            *inode = filp->f_dentry->d_inode; 
        off_t                    pos;
-       int                      written;
-       int                      c;
-       int                      blocksize;
+       ssize_t                  written;
+       ssize_t                  c;
+       ssize_t                  blocksize;
        struct buffer_head      *bh;
        struct inode            *ino;
        char                    *p;
 
        pr_debug("AFFS: file_write_ofs(ino=%lu,pos=%lu,count=%d)\n",inode->i_ino,
-               (unsigned long)filp->f_pos,count);
+               (unsigned long)*ppos,count);
 
        if (!count)
                return 0;
@@ -675,7+678,7 @@ affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf, uns
        if (filp->f_flags & O_APPEND)
                pos = inode->i_size;
        else
-               pos = filp->f_pos;
+               pos = *ppos;
 
        bh        = NULL;
        blocksize = AFFS_I2BSIZE(inode) - 24;
@@ -715,7+718,7 @@ affs_file_write_ofs(struct inode *inode, struct file *filp, const char *buf, uns
        }
        if (pos > inode->i_size)
                inode->i_size = pos;
-       filp->f_pos = pos;
+       *ppos = pos;
        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
        mark_inode_dirty(inode);
        iput(ino);
index e56825d..7e4558d 100644 (file)
@@ -55,7+55,7 @@ static int autofs_write(struct file *file, const void *addr, int bytes)
 
        old_signal = current->signal;
 
-       while ( bytes && (written = file->f_op->write(file->f_dentry->d_inode,file,data,bytes)) > 0 ) {
+       while ( bytes && (written = file->f_op->write(file,data,bytes,&file->f_pos)) > 0 ) {
                data += written;
                bytes -= written;
        }
index 2e97337..511dca0 100644 (file)
@@ -58,7+58,7 @@ static void set_brk(unsigned long start, unsigned long end)
  * macros to write out all the necessary info.
  */
 #define DUMP_WRITE(addr,nr) \
-while (file.f_op->write(inode,&file,(char *)(addr),(nr)) != (nr)) goto close_coredump
+while (file.f_op->write(&file,(char *)(addr),(nr),&file.f_pos) != (nr)) goto close_coredump
 
 #define DUMP_SEEK(offset) \
 if (file.f_op->llseek) { \
@@ -306,6+306,7 @@ static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs
        unsigned long p = bprm->p;
        unsigned long fd_offset;
        unsigned long rlim;
+       int retval;
 
        ex = *((struct exec *) bprm->buf);              /* exec-header */
        if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
@@ -341,8+342,12 @@ static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs
        if (ex.a_data + ex.a_bss > rlim)
                return -ENOMEM;
 
+       /* Flush all traces of the currently running executable */
+       retval = flush_old_exec(bprm);
+       if (retval)
+               return retval;
+
        /* OK, This is the point of no return */
-       flush_old_exec(bprm);
 #ifdef __sparc__
        memcpy(&current->tss.core_exec, &ex, sizeof(struct exec));
 #endif
@@ -498,7+503,7 @@ do_load_aout_library(int fd)
                file->f_pos = 0;
 
        set_fs(KERNEL_DS);
-       error = file->f_op->read(inode, file, (char *) &ex, sizeof(ex));
+       error = file->f_op->read(file, (char *) &ex, sizeof(ex), &file->f_pos);
        set_fs(USER_DS);
        if (error != sizeof(ex))
                return -ENOEXEC;
index 06804cb..5da1c6c 100644 (file)
@@ -584,9+584,12 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
                }
        }
 
-       /* OK, This is the point of no return */
-       flush_old_exec(bprm);
+       /* Flush all traces of the currently running executable */
+       retval = flush_old_exec(bprm);
+       if (retval)
+               return retval;
 
+       /* OK, This is the point of no return */
        current->mm->end_data = 0;
        current->mm->end_code = 0;
        current->mm->start_mmap = ELF_START_MMAP;
@@ -821,7+824,8 @@ do_load_elf_library(int fd){
                file->f_pos = 0;
 
        set_fs(KERNEL_DS);
-       error = file->f_op->read(inode, file, (char *) &elf_ex, sizeof(elf_ex));
+       error = file->f_op->read(file, (char *) &elf_ex,
+                                sizeof(elf_ex), &file->f_pos);
        set_fs(USER_DS);
        if (error != sizeof(elf_ex))
                return -ENOEXEC;
@@ -918,7+922,7 @@ static int load_elf_library(int fd)
  */
 static int dump_write(struct file *file, const void *addr, int nr)
 {
-       return file->f_op->write(file->f_dentry->d_inode, file, addr, nr) == nr;
+       return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
 }
 
 static int dump_seek(struct file *file, off_t off)
index dbb9d14..1598e3b 100644 (file)
@@ -20,16+20,17 @@ extern int *blksize_size[];
 #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
 #define NBUF 64
 
-long block_write(struct inode * inode, struct file * filp,
-       const char * buf, unsigned long count)
+ssize_t block_write(struct file * filp, const char * buf,
+                   size_t count, loff_t *ppos)
 {
-       int blocksize, blocksize_bits, i, buffercount,write_error;
-       int block, blocks;
+       struct inode * inode = filp->f_dentry->d_inode;
+       ssize_t blocksize, blocksize_bits, i, buffercount, write_error;
+       ssize_t block, blocks;
        loff_t offset;
-       int chars;
-       int written = 0;
+       ssize_t chars;
+       ssize_t written = 0;
        struct buffer_head * bhlist[NBUF];
-       unsigned int size;
+       size_t size;
        kdev_t dev;
        struct buffer_head * bh, *bufferlist[NBUF];
        register char * p;
@@ -49,8+50,8 @@ long block_write(struct inode * inode, struct file * filp,
                i >>= 1;
        }
 
-       block = filp->f_pos >> blocksize_bits;
-       offset = filp->f_pos & (blocksize-1);
+       block = *ppos >> blocksize_bits;
+       offset = *ppos & (blocksize-1);
 
        if (blk_size[MAJOR(dev)])
                size = ((loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS) >> blocksize_bits;
@@ -105,7+106,7 @@ long block_write(struct inode * inode, struct file * filp,
                        return written ? written : -EIO;
                p = offset + bh->b_data;
                offset = 0;
-               filp->f_pos += chars;
+               *ppos += chars;
                written += chars;
                count -= chars;
                copy_from_user(p,buf,chars);
@@ -145,14+146,14 @@ long block_write(struct inode * inode, struct file * filp,
        return written;
 }
 
-long block_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+ssize_t block_read(struct file * filp, char * buf, size_t count, loff_t *ppos)
 {
-       unsigned int block;
+       struct inode * inode = filp->f_dentry->d_inode;
+       size_t block;
        loff_t offset;
-       int blocksize;
-       int blocksize_bits, i;
-       unsigned int blocks, rblocks, left;
+       ssize_t blocksize;
+       ssize_t blocksize_bits, i;
+       size_t blocks, rblocks, left;
        int bhrequest, uptodate;
        struct buffer_head ** bhb, ** bhe;
        struct buffer_head * buflist[NBUF];
@@ -160,7+161,7 @@ long block_read(struct inode * inode, struct file * filp,
        unsigned int chars;
        loff_t size;
        kdev_t dev;
-       int read;
+       ssize_t read;
 
        dev = inode->i_rdev;
        blocksize = BLOCK_SIZE;
@@ -173,7+174,7 @@ long block_read(struct inode * inode, struct file * filp,
                i >>= 1;
        }
 
-       offset = filp->f_pos;
+       offset = *ppos;
        if (blk_size[MAJOR(dev)])
                size = (loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS;
        else
@@ -258,7+259,7 @@ long block_read(struct inode * inode, struct file * filp,
                                chars = left;
                        else
                                chars = blocksize - offset;
-                       filp->f_pos += chars;
+                       *ppos += chars;
                        left -= chars;
                        read += chars;
                        if (*bhe) {
index e661a4f..3887b6b 100644 (file)
 #include <linux/malloc.h>
 #include <linux/init.h>
 
+#define DCACHE_PARANOIA 1
+/* #define DCACHE_DEBUG 1 */
+
 /* For managing the dcache */
-extern int nr_free_pages, free_pages_low;
+extern unsigned long num_physpages, page_cache_size;
+extern int inodes_stat[];
+#define nr_inodes (inodes_stat[0])
 
 /*
  * This is the single most critical data structure when it comes
@@ -37,6+42,14 @@ extern int nr_free_pages, free_pages_low;
 static struct list_head dentry_hashtable[D_HASHSIZE];
 static LIST_HEAD(dentry_unused);
 
+struct {
+       int nr_dentry;
+       int nr_unused;
+       int age_limit;          /* age in seconds */
+       int want_pages;         /* pages requested by system */
+       int dummy[2];
+} dentry_stat = {0, 0, 45, 0,};
+
 static inline void d_free(struct dentry *dentry)
 {
        kfree(dentry->d_name.name);
@@ -84,12+97,16 @@ repeat:
                        goto out;
        }
 
+       if (!list_empty(&dentry->d_lru))
+               dentry_stat.nr_unused--;
        list_del(&dentry->d_lru);
        if (list_empty(&dentry->d_hash)) {
                struct inode *inode = dentry->d_inode;
                struct dentry * parent;
-               if (inode)
+               if (inode) {
+                       dentry->d_inode = NULL;
                        iput(inode);
+               }
                parent = dentry->d_parent;
                d_free(dentry);
                if (dentry == parent)
@@ -98,6+115,7 @@ repeat:
                goto repeat;
        }
        list_add(&dentry->d_lru, &dentry_unused);
+       dentry_stat.nr_unused++;
 out:
        if (count >= 0) {
                dentry->d_count = count;
@@ -132,6+150,94 @@ int d_invalidate(struct dentry * dentry)
 }
 
 /*
+ * Selects less valuable dentries to be pruned when
+ * we need inodes or memory. The selected dentries
+ * are moved to the old end of the list where
+ * prune_dcache() can find them.
+ */
+int select_dcache(int count, int page_count)
+{
+       struct list_head *tail = &dentry_unused;
+       struct list_head *next = dentry_unused.prev;
+       int forward = 0, young = 0, depth = dentry_stat.nr_unused >> 1;
+       int found = 0, pages = 0;
+
+#ifdef DCACHE_DEBUG
+printk("select_dcache: %d unused, count=%d, pages=%d\n",
+dentry_stat.nr_unused, count, page_count);
+#endif
+       while (next != &dentry_unused && depth--) {
+               struct list_head *tmp = next;
+               struct dentry *dentry = list_entry(tmp, struct dentry, d_lru);
+               struct inode *inode = dentry->d_inode;
+               unsigned long value = 0;
+
+               next = tmp->prev;
+               if (forward)
+                       next = tmp->next;
+               if (dentry->d_count) {
+                       dentry_stat.nr_unused--;
+                       list_del(tmp);
+                       INIT_LIST_HEAD(tmp);
+                       continue;
+               }
+               /*
+                * Select dentries based on the page cache count ...
+                * should factor in number of uses as well.
+                */
+               if (inode) {
+                       if (inode->i_state)
+                               continue;
+                       value = inode->i_nrpages;       
+               }
+               /*
+                * Consider various exemptions ...
+                */
+               if (!page_count) {
+                       if (!inode)
+                               continue;
+                       if (value >= 3)
+                               continue;
+               } else if (!forward) {
+                       if (inode) {
+                               int age = CURRENT_TIME - inode->i_atime;
+                               if (age < dentry_stat.age_limit) {
+                                       if (++young > 8) {
+                                               forward = 1;
+                                               next = dentry_unused.next;
+#ifdef DCACHE_DEBUG
+printk("select_dcache: age=%d, pages=%d, scanning forward\n", age, pages);
+#endif
+                                       }
+                                       continue;
+                               }
+                       }
+               } else {
+                       /*
+                        * If we're scanning from the front, don't take
+                        * files with only a trivial amount of memory.
+                        */
+                       if (value < 3 || value > 15)
+                               continue;
+               }
+               /*
+                * Move the dentry behind the tail
+                */
+               if (tmp != tail->prev) {
+                       list_del(tmp);
+                       list_add(tmp, tail->prev);
+               }
+               tail = tmp;
+               pages += value;
+               if (++found >= count)
+                       break;
+               if (page_count && pages >= page_count)
+                       break;
+       }
+       return found;
+}
+
+/*
  * Throw away a dentry - free the inode, dput the parent.
  * This requires that the LRU list has already been
  * removed.
@@ -166,6+272,7 @@ void prune_dcache(int count)
 
                if (tmp == &dentry_unused)
                        break;
+               dentry_stat.nr_unused--;
                list_del(tmp);
                INIT_LIST_HEAD(tmp);
                dentry = list_entry(tmp, struct dentry, d_lru);
@@ -222,6+329,7 @@ repeat:
                        continue;
                if (dentry->d_count)
                        continue;
+               dentry_stat.nr_unused--;
                list_del(tmp);
                INIT_LIST_HEAD(tmp);
                prune_one_dentry(dentry);
@@ -229,6+337,45 @@ repeat:
        }
 }
 
+/*
+ * This is called from do_try_to_free_page() to indicate
+ * that we should reduce the dcache and inode cache memory.
+ */
+void shrink_dcache_memory()
+{
+       dentry_stat.want_pages++;
+}
+
+/*
+ * This carries out the request received by the above routine.
+ */
+void check_dcache_memory()
+{
+       if (dentry_stat.want_pages) {
+               unsigned int count, goal = 0;
+               /*
+                * Set the page goal.  We don't necessarily need to trim
+                * the dcache just because the system needs memory ...
+                */
+               if (page_cache_size > (num_physpages >> 1))
+                       goal = (dentry_stat.want_pages * page_cache_size)
+                               / num_physpages;
+               dentry_stat.want_pages = 0;
+               if (goal) {
+                       if (goal > 50)
+                               goal = 50;
+                       count = select_dcache(128, goal);
+#ifdef DCACHE_DEBUG
+printk("check_dcache_memory: goal=%d, count=%d\n", goal, count);
+#endif
+                       if (count) {
+                               prune_dcache(count);
+                               free_inode_memory(count);
+                       }
+               }
+       }
+}
+
 #define NAME_ALLOC_LEN(len)    ((len+16) & ~15)
 
 struct dentry * d_alloc(struct dentry * parent, const struct qstr *name)
@@ -237,11+384,15 @@ struct dentry * d_alloc(struct dentry * parent, const struct qstr *name)
        struct dentry *dentry;
 
        /*
-        * Check whether to shrink the dcache ... this greatly reduces
-        * the likelyhood that kmalloc() will need additional memory.
+        * Prune the dcache if there are too many unused dentries.
         */
-       if (nr_free_pages < free_pages_low)
-               shrink_dcache();
+       if (dentry_stat.nr_unused > 3*(nr_inodes >> 1)) {
+#ifdef DCACHE_PARANOIA
+printk("d_alloc: %d unused, pruning dcache\n", dentry_stat.nr_unused);
+#endif
+               prune_dcache(8);
+               free_inode_memory(8);
+       }
 
        dentry = kmalloc(sizeof(struct dentry), GFP_KERNEL);
        if (!dentry)
index 3f26e4a..bb33528 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -372,13+372,13 @@ int read_exec(struct dentry *dentry, unsigned long offset,
        if (to_kmem) {
                unsigned long old_fs = get_fs();
                set_fs(get_ds());
-               result = file.f_op->read(inode, &file, addr, count);
+               result = file.f_op->read(&file, addr, count, &file.f_pos);
                set_fs(old_fs);
        } else {
                result = verify_area(VERIFY_WRITE, addr, count);
                if (result)
                        goto close_readexec;
-               result = file.f_op->read(inode, &file, addr, count);
+               result = file.f_op->read(&file, addr, count, &file.f_pos);
        }
 close_readexec:
        if (file.f_op->release)
@@ -427,16+427,34 @@ fail_restore:
        current->mm = old_mm;
        mmput(mm);
 
-       /*
-        * N.B. binfmt_xxx needs to handle the error instead of oom()
-        */
 fail_nomem:
-       /* this is wrong, I think. */
-       oom(current);
        return retval;
 }
 
 /*
+ * This function makes sure the current process has its own signal table,
+ * so that flush_old_signals can later reset the signals without disturbing
+ * other processes.  (Other processes might share the signal table via
+ * the CLONE_SIGHAND option to clone().)
+ */
+static inline int make_private_signals(void)
+{
+       struct signal_struct * newsig;
+
+       if (atomic_read(&current->sig->count) <= 1)
+               return 0;
+       newsig = kmalloc(sizeof(*newsig), GFP_KERNEL);
+       if (newsig == NULL)
+               return -ENOMEM;
+       spin_lock_init(&newsig->siglock);
+       atomic_set(&newsig->count, 1);
+       memcpy(newsig->action, current->sig->action, sizeof(newsig->action));
+       current->sig = newsig;
+       return 0;
+}
+       
+/*
  * These functions flushes out all traces of the currently running executable
  * so that a new one can be started
  */
@@ -476,18+494,24 @@ static inline void flush_old_files(struct files_struct * files)
        }
 }
 
-void flush_old_exec(struct linux_binprm * bprm)
+int flush_old_exec(struct linux_binprm * bprm)
 {
        char * name;
        int i, ch, retval;
+       struct signal_struct * oldsig;
+
+       /*
+        * Make sure we have a private signal table
+        */
+       oldsig = current->sig;
+       retval = make_private_signals();
+       if (retval) goto flush_failed;
 
        /* 
-        * Release all of the old mmap stuff ... do this first
-        * so we can bail out on failure.
+        * Release all of the old mmap stuff
         */
        retval = exec_mmap();
-       if (retval)
-               goto out;
+       if (retval) goto flush_failed;
 
        if (current->euid == current->uid && current->egid == current->gid)
                current->dumpable = 1;
@@ -509,8+533,12 @@ void flush_old_exec(struct linux_binprm * bprm)
 
        flush_old_signals(current->sig);
        flush_old_files(current->files);
-out:
-       return; /* retval; FIXME. */
+
+       return 0;
+
+flush_failed:
+       current->sig = oldsig;
+       return retval;
 }
 
 /* 
index 9f7af4e..6560d51 100644 (file)
 #include <linux/sched.h>
 #include <linux/stat.h>
 
-static long ext2_dir_read (struct inode * inode, struct file * filp,
-                           char * buf, unsigned long count)
+static ssize_t ext2_dir_read (struct file * filp, char * buf,
+                             size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index cbc863f..81072a5 100644 (file)
 #include <linux/ext2_fs.h>
 
 static long long ext2_file_lseek(struct file *, long long, int);
-static long ext2_file_write (struct inode *, struct file *, const char *, unsigned long);
+static ssize_t ext2_file_write (struct file *, const char *, size_t, loff_t *);
 static int ext2_release_file (struct inode *, struct file *);
 
 /*
@@ -127,9+127,10 @@ static inline void remove_suid(struct inode *inode)
        }
 }
 
-static long ext2_file_write (struct inode * inode, struct file * filp,
-                           const char * buf, unsigned long count)
+static ssize_t ext2_file_write (struct file * filp, const char * buf,
+                               size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        __u32 pos;
        long block;
        int offset;
@@ -163,8+164,12 @@ static long ext2_file_write (struct inode * inode, struct file * filp,
 
        if (filp->f_flags & O_APPEND)
                pos = inode->i_size;
-       else
-               pos = filp->f_pos;
+       else {
+               pos = *ppos;
+               if (pos != *ppos)
+                       return -EINVAL;
+       }
+
        /* Check for overflow.. */
        if (pos > (__u32) (pos + count)) {
                count = ~pos; /* == 0xFFFFFFFF - pos */
@@ -251,7+256,7 @@ static long ext2_file_write (struct inode * inode, struct file * filp,
        if (filp->f_flags & O_SYNC)
                inode->u.ext2_i.i_osync--;
        inode->i_ctime = inode->i_mtime = CURRENT_TIME;
-       filp->f_pos = pos;
+       *ppos = pos;
        mark_inode_dirty(inode);
        return written;
 }
index 2a6fc6b..4c82771 100644 (file)
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
 
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
+
 struct buffer_head *fat_bread (
        struct super_block *sb,
        int block)
 {
        struct buffer_head *ret = NULL;
 
-       /* Note that the blocksize is 512, 1024 or 2048, but the first read
-          is always of size 1024 (or 2048). Doing readahead may be counterproductive
-          or just plain wrong. */
+       PRINTK(("fat_bread: block=0x%x\n", block));
+       /*
+        * Note that the blocksize is 512, 1024 or 2048, but the first read
+        * is always of size 1024 (or 2048). Doing readahead may be
+        * counterproductive or just plain wrong.
+        */
        if (sb->s_blocksize == 512) {
                ret = bread (sb->s_dev,block,512);
        } else {
                struct buffer_head *real;
                if (sb->s_blocksize == 1024){
                        real = bread (sb->s_dev,block>>1,1024);
-               }else{
+               } else {
                        real = bread (sb->s_dev,block>>2,2048);
                }
 
@@ -82,6+91,7 @@ struct buffer_head *fat_getblk (
        int block)
 {
        struct buffer_head *ret = NULL;
+       PRINTK(("fat_getblk: block=0x%x\n", block));
        if (sb->s_blocksize == 512){
                ret = getblk (sb->s_dev,block,512);
        }else{
index 5fdcb77..c8551a2 100644 (file)
 
 #include "msbuffer.h"
 
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
 
 static struct fat_cache *fat_cache,cache[FAT_CACHE];
 
@@ -22,11+27,13 @@ int fat_access(struct super_block *sb,int nr,int new_value)
 {
        struct buffer_head *bh,*bh2,*c_bh,*c_bh2;
        unsigned char *p_first,*p_last;
-       int first,last,next,copy,b;
+       int copy,first,last,next,b;
 
        if ((unsigned) (nr-2) >= MSDOS_SB(sb)->clusters)
                return 0;
-       if (MSDOS_SB(sb)->fat_bits == 16) {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               first = last = nr*4;
+       } else if (MSDOS_SB(sb)->fat_bits == 16) {
                first = last = nr*2;
        } else {
                first = nr*3/2;
@@ -46,13+53,19 @@ int fat_access(struct super_block *sb,int nr,int new_value)
                        return 0;
                }
        }
-       if (MSDOS_SB(sb)->fat_bits == 16) {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               p_first = p_last = NULL; /* GCC needs that stuff */
+               next = CF_LE_L(((unsigned long *) bh->b_data)[(first &
+                   (SECTOR_SIZE-1)) >> 2]);
+               if (next >= 0xffffff7) next = -1;
+               PRINTK(("fat_bread: 0x%x, nr=0x%x, first=0x%x, next=0x%d\n", b, nr, first, next));
+
+       } else if (MSDOS_SB(sb)->fat_bits == 16) {
                p_first = p_last = NULL; /* GCC needs that stuff */
                next = CF_LE_W(((unsigned short *) bh->b_data)[(first &
                    (SECTOR_SIZE-1)) >> 1]);
                if (next >= 0xfff7) next = -1;
-       }
-       else {
+       } else {
                p_first = &((unsigned char *) bh->b_data)[first & (SECTOR_SIZE-1)];
                p_last = &((unsigned char *) bh2->b_data)[(first+1) &
                    (SECTOR_SIZE-1)];
@@ -61,10+74,13 @@ int fat_access(struct super_block *sb,int nr,int new_value)
                if (next >= 0xff7) next = -1;
        }
        if (new_value != -1) {
-               if (MSDOS_SB(sb)->fat_bits == 16)
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       ((unsigned long *) bh->b_data)[(first & (SECTOR_SIZE-1)) >>
+                           2] = CT_LE_L(new_value);
+               } else if (MSDOS_SB(sb)->fat_bits == 16) {
                        ((unsigned short *) bh->b_data)[(first & (SECTOR_SIZE-1)) >>
                            1] = CT_LE_W(new_value);
-               else {
+               else {
                        if (nr & 1) {
                                *p_first = (*p_first & 0xf) | (new_value << 4);
                                *p_last = new_value >> 4;
@@ -239,16+255,17 @@ int get_cluster(struct inode *inode,int cluster)
        return nr;
 }
 
-
 int fat_smap(struct inode *inode,int sector)
 {
        struct msdos_sb_info *sb;
        int cluster,offset;
 
        sb = MSDOS_SB(inode->i_sb);
-       if (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
-           !MSDOS_I(inode)->i_start)) {
-               if (sector >= sb->dir_entries >> MSDOS_DPS_BITS) return 0;
+       if ((sb->fat_bits != 32) &&
+           (inode->i_ino == MSDOS_ROOT_INO || (S_ISDIR(inode->i_mode) &&
+            !MSDOS_I(inode)->i_start))) {
+               if (sector >= sb->dir_entries >> MSDOS_DPS_BITS)
+                       return 0;
                return sector+sb->dir_start;
        }
        cluster = sector/sb->cluster_size;
@@ -279,6+296,7 @@ int fat_free(struct inode *inode,int skip)
                fat_access(inode->i_sb,last,EOF_FAT(inode->i_sb));
        else {
                MSDOS_I(inode)->i_start = 0;
+               MSDOS_I(inode)->i_logstart = 0;
                mark_inode_dirty(inode);
        }
        lock_fat(inode->i_sb);
@@ -287,8+305,12 @@ int fat_free(struct inode *inode,int skip)
                        fat_fs_panic(inode->i_sb,"fat_free: deleting beyond EOF");
                        break;
                }
-               if (MSDOS_SB(inode->i_sb)->free_clusters != -1)
+               if (MSDOS_SB(inode->i_sb)->free_clusters != -1) {
                        MSDOS_SB(inode->i_sb)->free_clusters++;
+                       if (MSDOS_SB(inode->i_sb)->fat_bits == 32) {
+                               fat_clusters_flush(inode->i_sb);
+                       }
+               }
                inode->i_blocks -= MSDOS_SB(inode->i_sb)->cluster_size;
        }
        unlock_fat(inode->i_sb);
index 494f778..0707c92 100644 (file)
  *  Merged with msdos fs by Henrik Storner <storner@osiris.ping.dk>
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+
+#include <linux/version.h>
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <asm/uaccess.h>
 
 #include "msbuffer.h"
-#include "tables.h"
-
 
 #define PRINTK(X)
 
-static long fat_dir_read(struct inode * inode,struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t fat_dir_read(struct file * filp, char * buf,
+                           size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
@@ -40,7+42,7 @@ struct file_operations fat_dir_operations = {
        fat_dir_read,           /* read */
        NULL,                   /* write - bad */
        fat_readdir,            /* readdir */
-       NULL,                   /* poll - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        fat_dir_ioctl,          /* ioctl - default */
        NULL,                   /* mmap */
        NULL,                   /* no special open code */
@@ -48,7+50,9 @@ struct file_operations fat_dir_operations = {
        file_fsync              /* fsync */
 };
 
-/* Convert Unicode string to ASCII.  If uni_xlate is enabled and we
+/*
+ * Convert Unicode 16 to UTF8, translated unicode, or ascii.
+ * If uni_xlate is enabled and we
  * can't get a 1:1 conversion, use a colon as an escape character since
  * it is normally invalid on the vfat filesystem.  The following three
  * characters are a sort of uuencoded 16 bit Unicode value.  This lets
@@ -56,10+60,11 @@ struct file_operations fat_dir_operations = {
  * into some trouble with long Unicode names, but ignore that right now.
  */
 static int
-uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
+uni16_to_x8(unsigned char *ascii, unsigned char *uni, int uni_xlate,
+           struct nls_table *nls)
 {
        unsigned char *ip, *op;
-       unsigned char page, pg_off;
+       unsigned char ch, cl;
        unsigned char *uni_page;
        unsigned short val;
 
@@ -67,21+72,21 @@ uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
        op = ascii;
 
        while (*ip || ip[1]) {
-               pg_off = *ip++;
-               page = *ip++;
-               
-               uni_page = fat_uni2asc_pg[page];
-               if (uni_page && uni_page[pg_off]) {
-                       *op++ = uni_page[pg_off];
+               cl = *ip++;
+               ch = *ip++;
+
+               uni_page = nls->page_uni2charset[ch];
+               if (uni_page && uni_page[cl]) {
+                       *op++ = uni_page[cl];
                } else {
                        if (uni_xlate == 1) {
                                *op++ = ':';
-                               val = (pg_off << 8) + page;
-                               op[2] = fat_uni2code[val & 0x3f];
+                               val = (cl << 8) + ch;
+                               op[2] = fat_uni2esc[val & 0x3f];
                                val >>= 6;
-                               op[1] = fat_uni2code[val & 0x3f];
+                               op[1] = fat_uni2esc[val & 0x3f];
                                val >>= 6;
-                               *op = fat_uni2code[val & 0x3f];
+                               *op = fat_uni2esc[val & 0x3f];
                                op += 3;
                        } else {
                                *op++ = '?';
@@ -92,6+97,19 @@ uni2ascii(unsigned char *uni, unsigned char *ascii, int uni_xlate)
        return (op - ascii);
 }
 
+
+static void dump_de(struct msdos_dir_entry *de)
+{
+       int i;
+       unsigned char *p = (unsigned char *) de;
+       printk("[");
+
+       for (i = 0; i < 32; i++, p++) {
+               printk("%02x ", *p);
+       }
+       printk("]\n");
+}
+
 int fat_readdirx(
        struct inode *inode,
        struct file *filp,
@@ -115,7+133,9 @@ int fat_readdirx(
        unsigned char alias_checksum = 0; /* Make compiler warning go away */
        unsigned char long_slots = 0;
        int uni_xlate = MSDOS_SB(sb)->options.unicode_xlate;
+       int utf8 = MSDOS_SB(sb)->options.utf8;
        unsigned char *unicode = NULL;
+       struct nls_table *nls = MSDOS_SB(sb)->nls_io;
 
        if (!inode || !S_ISDIR(inode->i_mode))
                return -EBADF;
@@ -138,6+158,9 @@ int fat_readdirx(
        is_long = 0;
        ino = fat_get_entry(inode,&filp->f_pos,&bh,&de);
        while (ino > -1) {
+#if 0
+               dump_de(de);
+#endif
                /* Check for long filename entry */
                if (MSDOS_SB(sb)->options.isvfat && (de->name[0] == (__s8) DELETED_FLAG)) {
                        is_long = 0;
@@ -217,7+240,6 @@ int fat_readdirx(
 
                        if (is_long) {
                                unsigned char sum;
-                               long_len = uni2ascii(unicode, longname, uni_xlate);
                                for (sum = 0, i = 0; i < 11; i++) {
                                        sum = (((sum&1)<<7)|((sum&0xfe)>>1)) + de->name[i];
                                }
@@ -226,6+248,11 @@ int fat_readdirx(
                                        PRINTK(("Checksums don't match %d != %d\n", sum, alias_checksum));
                                        is_long = 0;
                                }
+                               if (utf8) {
+                                       long_len = utf8_wcstombs(longname, (__u16 *) unicode, sizeof(longname));
+                               } else {
+                                       long_len = uni16_to_x8(longname, unicode, uni_xlate, nls);
+                               }
                        }
 
                        if ((de->attr & ATTR_HIDDEN) && MSDOS_SB(sb)->options.dotsOK) {
@@ -390,7+417,7 @@ int fat_dir_ioctl(struct inode * inode, struct file * filp,
        switch (cmd) {
        case VFAT_IOCTL_READDIR_BOTH: {
                struct dirent *d1 = (struct dirent *)arg;
-               err = verify_area(VERIFY_WRITE, d1, sizeof (*d1));
+               err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2]));
                if (err)
                        return err;
                put_user(0, &d1->d_reclen);
@@ -400,7+427,7 @@ int fat_dir_ioctl(struct inode * inode, struct file * filp,
        case VFAT_IOCTL_READDIR_SHORT: {
                struct dirent *d1 = (struct dirent *)arg;
                put_user(0, &d1->d_reclen);
-               err = verify_area(VERIFY_WRITE, d1, sizeof (*d1));
+               err = verify_area(VERIFY_WRITE, d1, sizeof(struct dirent[2]));
                if (err)
                        return err;
                return fat_readdirx(inode,filp,(void *)arg,
index c7ec960..60e71ed 100644 (file)
@@ -4,6+4,8 @@
  * Exported kernel symbols for the low-level FAT-based fs support.
  *
  */
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
 #include <linux/config.h>
 #include <linux/module.h>
 
 
 extern struct file_operations fat_dir_operations;
 
-EXPORT_SYMBOL(fat_a2alias);
-EXPORT_SYMBOL(fat_a2uni);
 EXPORT_SYMBOL(fat_add_cluster);
 EXPORT_SYMBOL(fat_bmap);
 EXPORT_SYMBOL(fat_brelse);
 EXPORT_SYMBOL(fat_cache_inval_inode);
-EXPORT_SYMBOL(fat_code2uni);
 EXPORT_SYMBOL(fat_date_unix2dos);
 EXPORT_SYMBOL(fat_delete_inode);
 EXPORT_SYMBOL(fat_dir_operations);
+EXPORT_SYMBOL(fat_esc2uni);
 EXPORT_SYMBOL(fat_file_read);
 EXPORT_SYMBOL(fat_file_write);
 EXPORT_SYMBOL(fat_fs_panic);
@@ -44,8+44,7 @@ EXPORT_SYMBOL(fat_scan);
 EXPORT_SYMBOL(fat_smap);
 EXPORT_SYMBOL(fat_statfs);
 EXPORT_SYMBOL(fat_truncate);
-EXPORT_SYMBOL(fat_uni2asc_pg);
-EXPORT_SYMBOL(fat_uni2code);
+EXPORT_SYMBOL(fat_uni2esc);
 EXPORT_SYMBOL(fat_unlock_creation);
 EXPORT_SYMBOL(fat_write_inode);
 
index ca35cc2..f3a4f6c 100644 (file)
@@ -6,6+6,8 @@
  *  regular file handling primitives for fat-based filesystems
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
 #include <linux/sched.h>
 #include <linux/locks.h>
 #include <linux/fs.h>
@@ -32,7+34,7 @@ static struct file_operations fat_file_operations = {
        fat_file_read,          /* read */
        fat_file_write,         /* write */
        NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        NULL,                   /* ioctl - default */
        generic_file_mmap,      /* mmap */
        NULL,                   /* no special open is needed */
@@ -60,6+62,7 @@ struct inode_operations fat_file_inode_operations = {
        NULL,                   /* permission */
        NULL                    /* smap */
 };
+
 /* #Specification: msdos / special devices / mmap      
        Mmapping does work because a special mmap is provide in that case.
        Note that it is much less efficient than the generic_file_mmap normally
@@ -71,7+74,7 @@ static struct file_operations fat_file_operations_1024 = {
        fat_file_read,          /* read */
        fat_file_write,         /* write */
        NULL,                   /* readdir - bad */
-       NULL,                   /* poll - default */
+       NULL,                   /* select v2.0.x/poll v2.1.x - default */
        NULL,                   /* ioctl - default */
        fat_mmap,               /* mmap */
        NULL,                   /* no special open is needed */
@@ -152,12+155,13 @@ static void fat_prefetch (
 /*
        Read a file into user space
 */
-long fat_file_read(
-       struct inode *inode,
+ssize_t fat_file_read(
        struct file *filp,
        char *buf,
-       unsigned long count)
+       size_t count,
+       loff_t *ppos)
 {
+       struct inode *inode = filp->f_dentry->d_inode;
        struct super_block *sb = inode->i_sb;
        char *start = buf;
        char *end   = buf + count;
@@ -175,7+179,7 @@ long fat_file_read(
                printk("fat_file_read: mode = %07o\n",inode->i_mode);
                return -EINVAL;
        }
-       if (filp->f_pos >= inode->i_size || count == 0) return 0;
+       if (*ppos >= inode->i_size || count == 0) return 0;
        /*
                Tell the buffer cache which block we expect to read in advance
                Since we are limited with the stack, we preread only MSDOS_PREFETCH
@@ -185,15+189,15 @@ long fat_file_read(
                Each time we process one block in bhlist, we replace
                it by a new prefetch block if needed.
        */
-       PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,filp->f_pos,inode->i_size,count));
+       PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,*ppos,inode->i_size,count));
        {
                /*
                        We must prefetch complete block, so we must
                        take in account the offset in the first block.
                */
-               int count_max = (filp->f_pos & (SECTOR_SIZE-1)) + count;
+               int count_max = (*ppos & (SECTOR_SIZE-1)) + count;
                int   to_reada; /* How many block to read all at once */
-               pre.file_sector = filp->f_pos >> SECTOR_BITS;
+               pre.file_sector = *ppos >> SECTOR_BITS;
                to_reada = count_max / SECTOR_SIZE;
                if (count_max & (SECTOR_SIZE-1)) to_reada++;
                if (filp->f_reada || !MSDOS_I(inode)->i_binary){
@@ -211,7+215,7 @@ long fat_file_read(
        }
        pre.nolist = 0;
        PRINTK (("count %d ahead %d nblist %d\n",count,read_ahead[MAJOR(inode->i_dev)],pre.nblist));
-       while ((left_in_file = inode->i_size - filp->f_pos) > 0
+       while ((left_in_file = inode->i_size - *ppos) > 0
                && buf < end){
                struct buffer_head *bh = pre.bhlist[pre.nolist];
                char *data;
@@ -226,27+230,27 @@ long fat_file_read(
                        fat_prefetch (inode,&pre,MSDOS_PREFETCH/2);
                        pre.nolist = 0;
                }
-               PRINTK (("file_read pos %ld nblist %d %d %d\n",filp->f_pos,pre.nblist,pre.fetched,count));
+               PRINTK (("file_read pos %ld nblist %d %d %d\n",*ppos,pre.nblist,pre.fetched,count));
                wait_on_buffer(bh);
                if (!fat_is_uptodate(sb,bh)){
                        /* read error  ? */
                        fat_brelse (sb, bh);
                        break;
                }
-               offset = filp->f_pos & (SECTOR_SIZE-1);
+               offset = *ppos & (SECTOR_SIZE-1);
                data = bh->b_data + offset;
                size = MIN(SECTOR_SIZE-offset,left_in_file);
                if (MSDOS_I(inode)->i_binary) {
                        size = MIN(size,end-buf);
                        copy_to_user(buf,data,size);
                        buf += size;
-                       filp->f_pos += size;
+                       *ppos += size;
                }else{
                        for (; size && buf < end; size--) {
                                char ch = *data++;
-                               filp->f_pos++;
+                               ++*ppos;
                                if (ch == 26){
-                                       filp->f_pos = inode->i_size;
+                                       *ppos = inode->i_size;
                                        break;
                                }else if (ch != '\r'){
                                        put_user(ch,buf++);
@@ -269,12+273,13 @@ long fat_file_read(
 /*
        Write to a file either from user space
 */
-long fat_file_write(
-       struct inode *inode,
+ssize_t fat_file_write(
        struct file *filp,
        const char *buf,
-       unsigned long count)
+       size_t count,
+       loff_t *ppos)
 {
+       struct inode *inode = filp->f_dentry->d_inode;
        struct super_block *sb = inode->i_sb;
        int sector,offset,size,left,written;
        int error,carry;
@@ -300,23+305,23 @@ long fat_file_write(
  * but so what. That way leads to madness anyway.
  */
        if (filp->f_flags & O_APPEND)
-               filp->f_pos = inode->i_size;
+               *ppos = inode->i_size;
        if (count == 0)
                return 0;
        error = carry = 0;
        for (start = buf; count || carry; count -= size) {
-               while (!(sector = fat_smap(inode,filp->f_pos >> SECTOR_BITS)))
+               while (!(sector = fat_smap(inode,*ppos >> SECTOR_BITS)))
                        if ((error = fat_add_cluster(inode)) < 0) break;
                if (error) {
                        fat_truncate(inode);
                        break;
                }
-               offset = filp->f_pos & (SECTOR_SIZE-1);
+               offset = *ppos & (SECTOR_SIZE-1);
                size = MIN(SECTOR_SIZE-offset,MAX(carry,count));
                if (binary_mode
                        && offset == 0
                        && (size == SECTOR_SIZE
-                               || filp->f_pos + size >= inode->i_size)){
+                               || *ppos + size >= inode->i_size)){
                        /* No need to read the block first since we will */
                        /* completely overwrite it */
                        /* or at least write past the end of file */
@@ -333,7+338,7 @@ long fat_file_write(
                        buf += size;
                } else {
                        written = left = SECTOR_SIZE-offset;
-                       to = (char *) bh->b_data+(filp->f_pos & (SECTOR_SIZE-1));
+                       to = (char *) bh->b_data+(*ppos & (SECTOR_SIZE-1));
                        if (carry) {
                                *to++ = '\n';
                                left--;
@@ -353,10+358,10 @@ long fat_file_write(
                        }
                        written -= left;
                }
-               update_vm_cache(inode, filp->f_pos, bh->b_data + (filp->f_pos & (SECTOR_SIZE-1)), written);
-               filp->f_pos += written;
-               if (filp->f_pos > inode->i_size) {
-                       inode->i_size = filp->f_pos;
+               update_vm_cache(inode, *ppos, bh->b_data + (*ppos & (SECTOR_SIZE-1)), written);
+               *ppos += written;
+               if (*ppos > inode->i_size) {
+                       inode->i_size = *ppos;
                        mark_inode_dirty(inode);
                }
                fat_set_uptodate(sb, bh, 1);
index 8ffd91e..db077c0 100644 (file)
  *  VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
 #define __NO_VERSION__
 #include <linux/module.h>
 
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
+#include <linux/malloc.h>
 
 #include "msbuffer.h"
-#include "tables.h"
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
 #include <asm/uaccess.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) copy_to_user(uaddr, kaddr, len)
+#else
+#include <asm/segment.h>
+#define FAT_COPY_TO_USER(uaddr, kaddr, len) memcpy_tofs(uaddr, kaddr, len)
+#endif
 #include <asm/unaligned.h>
 
-
+#if 0
+#  define PRINTK(x) printk x
+#else
+#  define PRINTK(x)
+#endif
 
 void fat_put_inode(struct inode *inode)
 {
@@ -85,8+98,24 @@ done:
 
 void fat_put_super(struct super_block *sb)
 {
+       if (MSDOS_SB(sb)->fat_bits == 32) {
+               fat_clusters_flush(sb);
+       }
        fat_cache_inval_dev(sb->s_dev);
        set_blocksize (sb->s_dev,BLOCK_SIZE);
+       if (MSDOS_SB(sb)->nls_disk) {
+               unload_nls(MSDOS_SB(sb)->nls_disk);
+               MSDOS_SB(sb)->nls_disk = NULL;
+               MSDOS_SB(sb)->options.codepage = 0;
+       }
+       if (MSDOS_SB(sb)->nls_io) {
+               unload_nls(MSDOS_SB(sb)->nls_io);
+               MSDOS_SB(sb)->nls_io = NULL;
+               if (MSDOS_SB(sb)->options.iocharset) {
+                       kfree(MSDOS_SB(sb)->options.iocharset);
+                       MSDOS_SB(sb)->options.iocharset = NULL;
+               }
+       }
        lock_super(sb);
        sb->s_dev = 0;
        unlock_super(sb);
@@ -98,27+127,38 @@ void fat_put_super(struct super_block *sb)
 static int parse_options(char *options,int *fat, int *blksize, int *debug,
                         struct fat_mount_options *opts)
 {
-       char *this_char,*value;
+       char *this_char,*value,save,*savep;
+       char *p;
+       int ret, len;
 
        opts->name_check = 'n';
        opts->conversion = 'b';
        opts->fs_uid = current->uid;
        opts->fs_gid = current->gid;
        opts->fs_umask = current->fs->umask;
-       opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = opts->isvfat = 0;
+       opts->quiet = opts->sys_immutable = opts->dotsOK = opts->showexec = 0;
+       opts->codepage = 0;
+       opts->utf8 = 0;
+       opts->iocharset = NULL;
        *debug = *fat = 0;
 
        if (!options) return 1;
+       save = 0;
+       savep = NULL;
+       ret = 1;
        for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
-               if ((value = strchr(this_char,'=')) != NULL)
+               if ((value = strchr(this_char,'=')) != NULL) {
+                       save = *value;
+                       savep = value;
                        *value++ = 0;
+               }
                if (!strcmp(this_char,"check") && value) {
                        if (value[0] && !value[1] && strchr("rns",*value))
                                opts->name_check = *value;
                        else if (!strcmp(value,"relaxed")) opts->name_check = 'r';
                        else if (!strcmp(value,"normal")) opts->name_check = 'n';
                        else if (!strcmp(value,"strict")) opts->name_check = 's';
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"conv") && value) {
                        if (value[0] && !value[1] && strchr("bta",*value))
@@ -126,7+166,7 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug,
                        else if (!strcmp(value,"binary")) opts->conversion = 'b';
                        else if (!strcmp(value,"text")) opts->conversion = 't';
                        else if (!strcmp(value,"auto")) opts->conversion = 'a';
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"dots")) {
                        opts->dotsOK = 1;
@@ -140,57+180,80 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug,
                else if (!strcmp(this_char,"dotsOK") && value) {
                        if (!strcmp(value,"yes")) opts->dotsOK = 1;
                        else if (!strcmp(value,"no")) opts->dotsOK = 0;
-                       else return 0;
+                       else ret = 0;
                }
                else if (!strcmp(this_char,"uid")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_uid = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               opts->fs_uid = simple_strtoul(value,&value,0);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"gid")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_gid = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret= 0;
+                       else {
+                               opts->fs_gid = simple_strtoul(value,&value,0);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"umask")) {
-                       if (!value || !*value)
-                               return 0;
-                       opts->fs_umask = simple_strtoul(value,&value,8);
-                       if (*value)
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               opts->fs_umask = simple_strtoul(value,&value,8);
+                               if (*value) ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"debug")) {
-                       if (value) return 0;
-                       *debug = 1;
+                       if (value) ret = 0;
+                       else *debug = 1;
                }
                else if (!strcmp(this_char,"fat")) {
-                       if (!value || !*value)
-                               return 0;
-                       *fat = simple_strtoul(value,&value,0);
-                       if (*value || (*fat != 12 && *fat != 16))
-                               return 0;
+                       if (!value || !*value) ret = 0;
+                       else {
+                               *fat = simple_strtoul(value,&value,0);
+                               if (*value || (*fat != 12 && *fat != 16 &&
+                                              *fat != 32)) 
+                                       ret = 0;
+                       }
                }
                else if (!strcmp(this_char,"quiet")) {
-                       if (value) return 0;
-                       opts->quiet = 1;
+                       if (value) ret = 0;
+                       else opts->quiet = 1;
                }
                else if (!strcmp(this_char,"blocksize")) {
-                       *blksize = simple_strtoul(value,&value,0);
-                       if (*value)
-                               return 0;
-                       if (*blksize != 512 && *blksize != 1024 && *blksize != 2048){
-                               printk ("MSDOS FS: Invalid blocksize (512, 1024 or 2048)\n");
+                       if (*value) ret = 0;
+                       else if (*blksize != 512 && *blksize != 1024 && *blksize != 2048){
+                               printk ("MSDOS FS: Invalid blocksize (512, 1024, or 2048)\n");
                        }
                }
                else if (!strcmp(this_char,"sys_immutable")) {
-                       if (value)
-                               return 0;
-                       opts->sys_immutable = 1;
+                       if (value) ret = 0;
+                       else opts->sys_immutable = 1;
+               }
+               else if (!strcmp(this_char,"codepage")) {
+                       opts->codepage = simple_strtoul(value,&value,0);
+                       if (*value) ret = 0;
+                       else printk ("MSDOS FS: Using codepage %d\n", opts->codepage);
+               }
+               else if (!strcmp(this_char,"iocharset")) {
+                       p = value;
+                       while (*value && *value != ',') value++;
+                       len = value - p;
+                       if (len) {
+                               opts->iocharset = kmalloc(len+1, GFP_KERNEL);
+                               memcpy(opts->iocharset, p, len);
+                               opts->iocharset[len] = 0;
+                               printk ("MSDOS FS: Using IO charset %s\n",
+                                       opts->iocharset);
+                       } else {
+                               opts->iocharset = NULL;
+                               ret = 0;
+                       }
                }
+
+               if (this_char != options) *(this_char-1) = ',';
+               if (value) *savep = save;
+               if (ret == 0) return 0;
        }
        return 1;
 }
@@ -201,11+264,14 @@ static int parse_options(char *options,int *fat, int *blksize, int *debug,
 struct super_block *fat_read_super(struct super_block *sb,void *data, int silent)
 {
        struct buffer_head *bh;
-       struct msdos_boot_sector *b;
+       struct fat_boot_sector *b;
        int data_sectors,logical_sector_size,sector_mult,fat_clusters=0;
-       int debug,error,fat;
+       int debug,error,fat,cp;
        int blksize = 512;
+       int fat32;
        struct fat_mount_options opts;
+       char buf[50];
+       char *p;
        struct inode *root_inode;
 
        MOD_INC_USE_COUNT;
@@ -215,6+281,7 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                        printk ("MSDOS: Hardware sector size is %d\n",blksize);
                }
        }
+       opts.isvfat = MSDOS_SB(sb)->options.isvfat;
        if (!parse_options((char *) data, &fat, &blksize, &debug, &opts)
                || (blksize != 512 && blksize != 1024 && blksize != 2048)) 
        {
@@ -245,8+312,8 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                MOD_DEC_USE_COUNT;
                return NULL;
        }
-       b = (struct msdos_boot_sector *) bh->b_data;
        set_blocksize(sb->s_dev, blksize);
+
 /*
  * The DOS3 partition size limit is *not* 32M as many people think.  
  * Instead, it is 64K sectors (with the usual sector size being
@@ -265,15+332,37 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
 #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
     /* don't divide by zero */
 
+       b = (struct fat_boot_sector *) bh->b_data;
        logical_sector_size =
                CF_LE_W(get_unaligned((unsigned short *) &b->sector_size));
        sector_mult = logical_sector_size >> SECTOR_BITS;
        MSDOS_SB(sb)->cluster_size = b->cluster_size*sector_mult;
        MSDOS_SB(sb)->fats = b->fats;
        MSDOS_SB(sb)->fat_start = CF_LE_W(b->reserved)*sector_mult;
-       MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult;
-       MSDOS_SB(sb)->dir_start = (CF_LE_W(b->reserved)+b->fats*CF_LE_W(
-           b->fat_length))*sector_mult;
+       if (!b->fat_length && b->fat32_length) {
+               struct fat_boot_fsinfo *fsinfo;
+
+               /* Must be FAT32 */
+               fat32 = 1;
+               MSDOS_SB(sb)->fat_length= CF_LE_W(b->fat32_length)*sector_mult;
+               MSDOS_SB(sb)->root_cluster = CF_LE_L(b->root_cluster);
+               MSDOS_SB(sb)->fsinfo_offset =
+                       CF_LE_W(b->info_sector) * logical_sector_size + 0x1e0;
+               fsinfo = (struct fat_boot_fsinfo *)
+                       &bh->b_data[MSDOS_SB(sb)->fsinfo_offset];
+               if (CF_LE_L(fsinfo->signature) != 0x61417272) {
+                       printk("fat_read_super: Did not find valid FSINFO signature. Found 0x%x\n", CF_LE_L(fsinfo->signature));
+               } else {
+                       MSDOS_SB(sb)->free_clusters = CF_LE_L(fsinfo->free_clusters);
+               }
+       } else {
+               fat32 = 0;
+               MSDOS_SB(sb)->fat_length = CF_LE_W(b->fat_length)*sector_mult;
+               MSDOS_SB(sb)->root_cluster = 0;
+               MSDOS_SB(sb)->free_clusters = -1; /* Don't know yet */
+       }
+       MSDOS_SB(sb)->dir_start= CF_LE_W(b->reserved)*sector_mult+
+           b->fats*MSDOS_SB(sb)->fat_length;
        MSDOS_SB(sb)->dir_entries =
                CF_LE_W(get_unaligned((unsigned short *) &b->dir_entries));
        MSDOS_SB(sb)->data_start = MSDOS_SB(sb)->dir_start+ROUND_TO_MULTIPLE((
@@ -288,8+377,9 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
        if (!error) {
                MSDOS_SB(sb)->clusters = b->cluster_size ? data_sectors/
                    b->cluster_size/sector_mult : 0;
-               MSDOS_SB(sb)->fat_bits = fat ? fat : MSDOS_SB(sb)->clusters >
-                   MSDOS_FAT12 ? 16 : 12;
+               MSDOS_SB(sb)->fat_bits = fat32 ? 32 :
+                       (fat ? fat :
+                        (MSDOS_SB(sb)->clusters > MSDOS_FAT12 ? 16 : 12));
                fat_clusters = MSDOS_SB(sb)->fat_length*SECTOR_SIZE*8/
                    MSDOS_SB(sb)->fat_bits;
                error = !MSDOS_SB(sb)->fats || (MSDOS_SB(sb)->dir_entries &
@@ -315,12+405,13 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
                       opts.conversion,opts.fs_uid,opts.fs_gid,opts.fs_umask,
                       MSDOS_CAN_BMAP(MSDOS_SB(sb)) ? ",bmap" : "");
                printk("[me=0x%x,cs=%d,#f=%d,fs=%d,fl=%d,ds=%d,de=%d,data=%d,"
-                      "se=%d,ts=%d,ls=%d]\n",b->media,MSDOS_SB(sb)->cluster_size,
+                      "se=%d,ts=%ld,ls=%d,rc=%ld,fc=%u]\n",b->media,MSDOS_SB(sb)->cluster_size,
                       MSDOS_SB(sb)->fats,MSDOS_SB(sb)->fat_start,MSDOS_SB(sb)->fat_length,
                       MSDOS_SB(sb)->dir_start,MSDOS_SB(sb)->dir_entries,
                       MSDOS_SB(sb)->data_start,
-                      CF_LE_W(get_unaligned((unsigned short *) &b->sectors)),
-                      CF_LE_L(b->total_sect),logical_sector_size);
+                      CF_LE_W(*(unsigned short *) &b->sectors),
+                      (unsigned long)b->total_sect,logical_sector_size,
+                      MSDOS_SB(sb)->root_cluster,MSDOS_SB(sb)->free_clusters);
                printk ("Transaction block size = %d\n",blksize);
        }
        if (MSDOS_SB(sb)->clusters+2 > fat_clusters)
@@ -335,17+426,51 @@ struct super_block *fat_read_super(struct super_block *sb,void *data, int silent
        }
        sb->s_magic = MSDOS_SUPER_MAGIC;
        /* set up enough so that it can read an inode */
-       MSDOS_SB(sb)->free_clusters = -1; /* don't know yet */
        MSDOS_SB(sb)->fat_wait = NULL;
        MSDOS_SB(sb)->fat_lock = 0;
        MSDOS_SB(sb)->prev_free = 0;
        memcpy(&(MSDOS_SB(sb)->options), &opts, sizeof(struct fat_mount_options));
 
+       cp = opts.codepage ? opts.codepage : 437;
+       sprintf(buf, "cp%d", cp);
+       MSDOS_SB(sb)->nls_disk = load_nls(buf);
+       if (! MSDOS_SB(sb)->nls_disk) {
+               /* Fail only if explicit charset specified */
+               if (opts.codepage == 0) {
+                       MSDOS_SB(sb)->options.codepage = 0;
+                       MSDOS_SB(sb)->nls_disk = load_nls_default();
+               } else {
+                       sb->s_dev = 0;
+                       MOD_DEC_USE_COUNT;
+                       return NULL;
+               }
+       }
+
+       p = opts.iocharset ? opts.iocharset : "iso8859-1";
+       if (MSDOS_SB(sb)->options.isvfat && !opts.utf8) {
+               MSDOS_SB(sb)->nls_io = load_nls(p);
+               if (! MSDOS_SB(sb)->nls_io) {
+                       /* Fail only if explicit charset specified */
+                       if (opts.iocharset) {
+                               kfree(opts.iocharset);
+                               unload_nls(MSDOS_SB(sb)->nls_disk);
+                               sb->s_dev = 0;
+                               MOD_DEC_USE_COUNT;
+                               return NULL;
+                       } else {
+                               MSDOS_SB(sb)->nls_io = load_nls_default();
+                       }
+               }
+       }
+
        root_inode = iget(sb,MSDOS_ROOT_INO);
        sb->s_root = d_alloc_root(root_inode, NULL);
        if (!sb->s_root) {
                sb->s_dev = 0;
                printk("get root inode failed\n");
+               unload_nls(MSDOS_SB(sb)->nls_disk);
+               if (MSDOS_SB(sb)->nls_io) unload_nls(MSDOS_SB(sb)->nls_io);
+               if (opts.iocharset) kfree(opts.iocharset);
                MOD_DEC_USE_COUNT;
                return NULL;
        }
@@ -386,7+511,7 @@ int fat_bmap(struct inode *inode,int block)
        int cluster,offset;
 
        sb = MSDOS_SB(inode->i_sb);
-       if (inode->i_ino == MSDOS_ROOT_INO) {
+       if ((inode->i_ino == MSDOS_ROOT_INO) && (sb->fat_bits != 32)) {
                return sb->dir_start + block;
        }
        cluster = block/sb->cluster_size;
@@ -412,6+537,8 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
        struct msdos_dir_entry *raw_entry;
        int nr;
 
+       PRINTK(("fat_read_inode: inode=%p, sb->dir_start=0x%x\n",
+               inode, MSDOS_SB(sb)->dir_start));
        MSDOS_I(inode)->i_busy = 0;
        MSDOS_I(inode)->i_depend = MSDOS_I(inode)->i_old = NULL;
        MSDOS_I(inode)->i_linked = MSDOS_I(inode)->i_oldlink = NULL;
@@ -423,17+550,33 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                inode->i_mode = (S_IRWXUGO & ~MSDOS_SB(sb)->options.fs_umask) |
                    S_IFDIR;
                inode->i_op = fs_dir_inode_ops;
-               inode->i_nlink = fat_subdirs(inode)+2;
-                   /* subdirs (neither . nor ..) plus . and "self" */
-               inode->i_size = MSDOS_SB(sb)->dir_entries*
-                   sizeof(struct msdos_dir_entry);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start = MSDOS_SB(sb)->root_cluster;
+                       if ((nr = MSDOS_I(inode)->i_start) != 0) {
+                               while (nr != -1) {
+                                       inode->i_size += SECTOR_SIZE*MSDOS_SB(sb)->cluster_size;
+                                       if (!(nr = fat_access(sb,nr,-1))) {
+                                               printk("Directory %ld: bad FAT\n",
+                                                      inode->i_ino);
+                                               break;
+                                       }
+                               }
+                       }
+               } else {
+                       MSDOS_I(inode)->i_start = 0;
+                       inode->i_size = MSDOS_SB(sb)->dir_entries*
+                               sizeof(struct msdos_dir_entry);
+               }
                inode->i_blksize = MSDOS_SB(sb)->cluster_size*
                    SECTOR_SIZE;
                inode->i_blocks = (inode->i_size+inode->i_blksize-1)/
                    inode->i_blksize*MSDOS_SB(sb)->cluster_size;
-               MSDOS_I(inode)->i_start = 0;
+               MSDOS_I(inode)->i_logstart = 0;
+
                MSDOS_I(inode)->i_attrs = 0;
                inode->i_mtime = inode->i_atime = inode->i_ctime = 0;
+               inode->i_nlink = fat_subdirs(inode)+2;
+                   /* subdirs (neither . nor ..) plus . and "self" */
                return;
        }
        if (!(bh = fat_bread(sb, inode->i_ino >> MSDOS_DPB_BITS))) {
@@ -449,6+592,11 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                inode->i_op = fs_dir_inode_ops;
 
                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start |=
+                               (CF_LE_W(raw_entry->starthi) << 16);
+               }
+               MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start;
                inode->i_nlink = fat_subdirs(inode);
                    /* includes .., compensating for "self" */
 #ifdef DEBUG
@@ -458,7+606,7 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                }
 #endif
                inode->i_size = 0;
-               if ((nr = CF_LE_W(raw_entry->start)) != 0)
+               if ((nr = MSDOS_I(inode)->i_start) != 0)
                        while (nr != -1) {
                                inode->i_size += SECTOR_SIZE*MSDOS_SB(inode->
                                    i_sb)->cluster_size;
@@ -479,6+627,11 @@ void fat_read_inode(struct inode *inode, struct inode_operations *fs_dir_inode_o
                        ? &fat_file_inode_operations_1024
                        : &fat_file_inode_operations;
                MSDOS_I(inode)->i_start = CF_LE_W(raw_entry->start);
+               if (MSDOS_SB(sb)->fat_bits == 32) {
+                       MSDOS_I(inode)->i_start |=
+                               (CF_LE_W(raw_entry->starthi) << 16);
+               }
+               MSDOS_I(inode)->i_logstart = MSDOS_I(inode)->i_start;
                inode->i_nlink = 1;
                inode->i_size = CF_LE_L(raw_entry->size);
        }
@@ -549,7+702,8 @@ void fat_write_inode(struct inode *inode)
        }
        raw_entry->attr |= MSDOS_MKATTR(inode->i_mode) |
            MSDOS_I(inode)->i_attrs;
-       raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_start);
+       raw_entry->start = CT_LE_W(MSDOS_I(inode)->i_logstart);
+       raw_entry->starthi = CT_LE_W(MSDOS_I(inode)->i_logstart >> 16);
        fat_date_unix2dos(inode->i_mtime,&raw_entry->time,&raw_entry->date);
        raw_entry->time = CT_LE_W(raw_entry->time);
        raw_entry->date = CT_LE_W(raw_entry->date);
index 5b71573..0fb7791 100644 (file)
 
 #include "msbuffer.h"
 
-#define PRINTK(x)
+#if 0
+#  define PRINTK(x)    printk x
+#else
+#  define PRINTK(x)
+#endif
 #define Printk(x)      printk x
 
 /* Well-known binary file extensions - of course there are many more */
@@ -106,6+110,34 @@ void unlock_fat(struct super_block *sb)
        wake_up(&MSDOS_SB(sb)->fat_wait);
 }
 
+/* Flushes the number of free clusters on FAT32 */
+/* XXX: Need to write one per FSINFO block.  Currently only writes 1 */
+void fat_clusters_flush(struct super_block *sb)
+{
+       int offset;
+       struct buffer_head *bh;
+       struct fat_boot_fsinfo *fsinfo;
+
+       /* The fat32 boot fs info is at offset 0x3e0 by observation */
+       offset = MSDOS_SB(sb)->fsinfo_offset;
+       bh = fat_bread(sb, (offset >> SECTOR_BITS));
+       if (bh == NULL) {
+               printk("FAT bread failed in fat_clusters_flush\n");
+               return;
+       }
+       fsinfo = (struct fat_boot_fsinfo *)
+               &bh->b_data[offset & (SECTOR_SIZE-1)];
+
+       /* Sanity check */
+       if (CF_LE_L(fsinfo->signature) != 0x61417272) {
+               printk("fat_clusters_flush: Did not find valid FSINFO signature. Found 0x%x.  offset=0x%x\n", CF_LE_L(fsinfo->signature), offset);
+               fat_brelse(sb, bh);
+               return;
+       }
+       fsinfo->free_clusters = CF_LE_L(MSDOS_SB(sb)->free_clusters);
+       fat_mark_buffer_dirty(sb, bh, 1);
+       fat_brelse(sb, bh);
+}
 
 /*
  * fat_add_cluster tries to allocate a new cluster and adds it to the file
@@ -119,7+151,9 @@ int fat_add_cluster(struct inode *inode)
        struct buffer_head *bh;
        int cluster_size = MSDOS_SB(sb)->cluster_size;
 
-       if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+       if (MSDOS_SB(sb)->fat_bits != 32) {
+               if (inode->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+       }
        if (!MSDOS_SB(sb)->free_clusters) return -ENOSPC;
        lock_fat(sb);
        limit = MSDOS_SB(sb)->clusters;
@@ -141,6+175,8 @@ printk("free cluster: %d\n",nr);
        fat_access(sb,nr,EOF_FAT(sb));
        if (MSDOS_SB(sb)->free_clusters != -1)
                MSDOS_SB(sb)->free_clusters--;
+       if (MSDOS_SB(sb)->fat_bits == 32)
+               fat_clusters_flush(sb);
        unlock_fat(sb);
 #ifdef DEBUG
 printk("set to %x\n",fat_access(sb,nr,-1));
@@ -177,6+213,7 @@ printk("last = %d\n",last);
        if (last) fat_access(sb,last,nr);
        else {
                MSDOS_I(inode)->i_start = nr;
+               MSDOS_I(inode)->i_logstart = nr;
                mark_inode_dirty(inode);
        }
 #ifdef DEBUG
@@ -260,6+297,8 @@ void fat_date_unix2dos(int unix_date,unsigned short *time,
                unix_date += 3600;
        }
        unix_date -= sys_tz.tz_minuteswest*60;
+       if (sys_tz.tz_dsttime) unix_date += 3600;
+
        *time = (unix_date % 60)/2+(((unix_date/60) % 60) << 5)+
            (((unix_date/3600) % 24) << 11);
        day = unix_date/86400-3652;
@@ -302,7+341,7 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
                        fat_brelse(sb, *bh);
                PRINTK (("get_entry sector apres brelse\n"));
                if (!(*bh = fat_bread(sb, sector))) {
-                       printk("Directory sread (sector %d) failed\n",sector);
+                       printk("Directory sread (sector 0x%x) failed\n",sector);
                        continue;
                }
                PRINTK (("get_entry apres sread\n"));
@@ -344,7+383,13 @@ int fat_get_entry(struct inode *dir, loff_t *pos,struct buffer_head **bh,
      !(data[entry].attr & ATTR_VOLUME);
 
 #define RSS_START /* search for start cluster */ \
-    done = !IS_FREE(data[entry].name) && CF_LE_W(data[entry].start) == *number;
+    done = !IS_FREE(data[entry].name) \
+      && ( \
+           ( \
+             (MSDOS_SB(sb)->fat_bits != 32) ? 0 : (CF_LE_W(data[entry].starthi) << 16) \
+           ) \
+           | CF_LE_W(data[entry].start) \
+         ) == *number;
 
 #define RSS_FREE /* search for free entry */ \
     { \
@@ -397,6+442,9 @@ static int raw_scan_sector(struct super_block *sb,int sector,const char *name,
                if (done) {
                        if (ino) *ino = sector*MSDOS_DPS+entry;
                        start = CF_LE_W(data[entry].start);
+                       if (MSDOS_SB(sb)->fat_bits == 32) {
+                               start |= (CF_LE_W(data[entry].starthi) << 16);
+                       }
                        if (!res_bh)
                                fat_brelse(sb, bh);
                        else {
@@ -492,6+540,7 @@ int fat_parent_ino(struct inode *dir,int locked)
        static int zero = 0;
        int error,curr,prev,nr;
 
+       PRINTK(("fat_parent_ino: Debug 0\n"));
        if (!S_ISDIR(dir->i_mode)) panic("Non-directory fed to m_p_i");
        if (dir->i_ino == MSDOS_ROOT_INO) return dir->i_ino;
        if (!locked) fat_lock_creation(); /* prevent renames */
@@ -500,18+549,27 @@ int fat_parent_ino(struct inode *dir,int locked)
                if (!locked) fat_unlock_creation();
                return curr;
        }
+       PRINTK(("fat_parent_ino: Debug 1 curr=%d\n", curr));
        if (!curr) nr = MSDOS_ROOT_INO;
        else {
+               PRINTK(("fat_parent_ino: Debug 2\n"));
                if ((prev = raw_scan(dir->i_sb,curr,MSDOS_DOTDOT,&zero,NULL,
                    NULL,NULL,SCAN_ANY)) < 0) {
+                       PRINTK(("fat_parent_ino: Debug 3 prev=%d\n", prev));
                        if (!locked) fat_unlock_creation();
                        return prev;
                }
+               PRINTK(("fat_parent_ino: Debug 4 prev=%d\n", prev));
+               if (prev == 0 && MSDOS_SB(dir->i_sb)->fat_bits == 32) {
+                       prev = MSDOS_SB(dir->i_sb)->root_cluster;
+               }
                if ((error = raw_scan(dir->i_sb,prev,NULL,&curr,&nr,NULL,
                    NULL,SCAN_ANY)) < 0) {
+                       PRINTK(("fat_parent_ino: Debug 5 error=%d\n", error));
                        if (!locked) fat_unlock_creation();
                        return error;
                }
+               PRINTK(("fat_parent_ino: Debug 6 nr=%d\n", nr));
        }
        if (!locked) fat_unlock_creation();
        return nr;
@@ -528,10+586,12 @@ int fat_subdirs(struct inode *dir)
        int count;
 
        count = 0;
-       if (dir->i_ino == MSDOS_ROOT_INO)
+       if ((dir->i_ino == MSDOS_ROOT_INO) &&
+           (MSDOS_SB(dir->i_sb)->fat_bits != 32)) {
                (void) raw_scan_root(dir->i_sb,NULL,&count,NULL,NULL,NULL,SCAN_ANY);
-       else {
-               if (!MSDOS_I(dir)->i_start) return 0; /* in mkdir */
+       } else {
+               if ((dir->i_ino != MSDOS_ROOT_INO) &&
+                   !MSDOS_I(dir)->i_start) return 0; /* in mkdir */
                else (void) raw_scan_nonroot(dir->i_sb,MSDOS_I(dir)->i_start,
                    NULL,&count,NULL,NULL,NULL,SCAN_ANY);
        }
@@ -549,10+609,7 @@ int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_bh,
 {
        int res;
 
-       res = (name)
-               ? raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
-                   name, NULL, ino, res_bh, res_de, scantype)
-               : raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
-                   NULL, NULL, ino, res_bh, res_de, scantype);
+       res = raw_scan(dir->i_sb,MSDOS_I(dir)->i_start,
+                      name, NULL, ino, res_bh, res_de, scantype);
        return res<0 ? res : 0;
 }
index fd66e51..b124400 100644 (file)
@@ -7,6+7,9 @@
  *     mmap handling for fat-based filesystems
  */
 
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+
 #include <linux/stat.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/malloc.h>
 #include <linux/msdos_fs.h>
 
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
 #include <asm/uaccess.h>
+#else
+#include <asm/segment.h>
+#endif
 #include <asm/system.h>
 
 /*
@@ -59,8+66,8 @@ static unsigned long fat_file_mmap_nopage(
                {
                        unsigned long cur_fs = get_fs();
                        set_fs (KERNEL_DS);
-                       cur_read = fat_file_read (inode,&filp,(char*)page
-                               ,need_read);
+                       cur_read = fat_file_read (&filp, (char*)page,
+                                                 need_read, &filp.f_pos);
                        set_fs (cur_fs);
                }
                if (cur_read != need_read){
dissimilarity index 80%
index 3e83793..c4ad91c 100644 (file)
-/*
- * linux/fs/fat/tables.c
- *
- * ASCII / Unicode translation tables for VFAT filename handling.
- * By Gordon Chaffee.
- *
- * Note: This file is used by all fat-based filesystems.
- */
-
-#include <linux/kernel.h>
-#include <linux/string.h>
-
-#include "tables.h"
-
-unsigned char fat_uni2code[64] = {
-       '0', '1', '2', '3', '4', '5', '6', '7',
-       '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
-       'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
-       'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
-       'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
-       'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
-       'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
-       'u', 'v', 'w', 'x', 'y', 'z', '+', '-'
-};
-
-unsigned char fat_code2uni[256] = {
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0x3e, 0xff, 0x3f, 0xff, 0xff, 
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
-       0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 
-       0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 
-       0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 
-       0x21, 0x22, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 
-       0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 
-       0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 
-       0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
-};
-
-static unsigned char page00[256] = {
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
-       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */
-       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
-       0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */
-       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
-       0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */
-       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
-       0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */
-       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
-       0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */
-       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
-       0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */
-       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
-       0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */
-       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
-       0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 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, 0x92, /* 0x98-0x9F */
-       0xFF, 0xAD, 0xBD, 0x9C, 0xCF, 0xBE, 0xDD, 0xF5, /* 0xA0-0xA7 */
-       0xF9, 0xB8, 0x00, 0xAE, 0xAA, 0xF0, 0x00, 0xEE, /* 0xA8-0xAF */
-       0xF8, 0xF1, 0xFD, 0xFC, 0xEF, 0xE6, 0xF4, 0xFA, /* 0xB0-0xB7 */
-       0xF7, 0xFB, 0x00, 0xAF, 0xAC, 0xAB, 0xF3, 0x00, /* 0xB8-0xBF */
-       0xB7, 0xB5, 0xB6, 0xC7, 0x8E, 0x8F, 0x92, 0x80, /* 0xC0-0xC7 */
-       0xD4, 0x90, 0xD2, 0xD3, 0xDE, 0xD6, 0xD7, 0xD8, /* 0xC8-0xCF */
-       0x00, 0xA5, 0xE3, 0xE0, 0xE2, 0xE5, 0x99, 0x9E, /* 0xD0-0xD7 */
-       0x9D, 0xEB, 0xE9, 0xEA, 0x9A, 0xED, 0xE8, 0xE1, /* 0xD8-0xDF */
-       0xA1, 0xA0, 0x83, 0xC6, 0x84, 0x86, 0x91, 0x87, /* 0xE0-0xE7 */
-       0x8A, 0x82, 0x88, 0x89, 0x8D, 0x00, 0x8C, 0x8B, /* 0xE8-0xEF */
-       0xD0, 0xA4, 0x95, 0xA2, 0x93, 0xE4, 0x94, 0xF6, /* 0xF0-0xF7 */
-       0x9B, 0x97, 0xA3, 0x96, 0x81, 0xEC, 0xE7, 0x98  /* 0xF8-0xFF */
-};
-
-
-static unsigned char page25[256] = {
-       0xC4, 0x00, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
-       0x00, 0x00, 0x00, 0x00, 0xDA, 0x00, 0x00, 0x00, /* 0x08-0x0F */
-       0xBF, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
-       0xD9, 0x00, 0x00, 0x00, 0xC3, 0x00, 0x00, 0x00, /* 0x18-0x1F */
-       0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
-       0x00, 0x00, 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, /* 0x28-0x2F */
-       0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
-       0x00, 0x00, 0x00, 0x00, 0xC5, 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 */
-       0xCD, 0xBA, 0x00, 0x00, 0xC9, 0x00, 0x00, 0xBB, /* 0x50-0x57 */
-       0x00, 0x00, 0xC8, 0x00, 0x00, 0xBC, 0x00, 0x00, /* 0x58-0x5F */
-       0xCC, 0x00, 0x00, 0xB9, 0x00, 0x00, 0xCB, 0x00, /* 0x60-0x67 */
-       0x00, 0xCA, 0x00, 0x00, 0xCE, 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 */
-
-       0xDF, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, /* 0x80-0x87 */
-       0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8F */
-       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 */
-};
-
-
-unsigned char *fat_uni2asc_pg[256] = {
-       page00, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-       NULL,   NULL, NULL, NULL, page25
-};
-
-/* Conversion from ASCII name characters to the shortname character
- * should probably just just use XXX
- */
-unsigned char fat_a2alias[256] = 
-{
-       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
-       0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, /* 0x08-0x0F */
-       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
-       0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, /* 0x18-0x1F */
-       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
-       0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, /* 0x28-0x2F */
-       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
-       0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, /* 0x38-0x3F */
-       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
-       0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, /* 0x48-0x4F */
-       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
-       0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, /* 0x58-0x5F */
-       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
-       0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, /* 0x68-0x6F */
-       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
-       0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, /* 0x78-0x7F */
-
-       0x80, 0x9A, 0x90, 0xB6, 0x8E, 0xB7, 0x8F, 0x80, /* 0x80-0x87 */
-       0xD2, 0xD3, 0xD4, 0xD8, 0xD7, 0xDE, 0x8E, 0x8F, /* 0x88-0x8F */
-       0x90, 0x92, 0x92, 0xE2, 0x99, 0xE3, 0xEA, 0xEB, /* 0x90-0x97 */
-/*_~1*/        0x98, 0x99, 0x9A, 0x9D, 0x9C, 0x9D, 0x9E, 0x9F, /* 0x98-0x9F */
-       0xB5, 0xD6, 0xE0, 0xE9, 0xA5, 0xA5, 0xA6, 0xA7, /* 0xA0-0xA7 */
-       0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, /* 0xA8-0xAF */
-       0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, /* 0xB0-0xB7 */
-       0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, /* 0xB8-0xBF */
-       0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, /* 0xC0-0xC7 */
-       0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, /* 0xC8-0xCF */
-       0xD1, 0xD1, 0xD2, 0xD3, 0xD4, 0x49, 0xD6, 0xD7, /* 0xD0-0xD7 */
-       0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, /* 0xD8-0xDF */
-       0xE0, 0xE1, 0xE2, 0xE3, 0x05, 0x05, 0xE6, 0xE8, /* 0xE0-0xE7 */
-       0xE8, 0xE9, 0xEA, 0xEB, 0xED, 0xED, 0xEE, 0xEF, /* 0xE8-0xEF */
-       0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, /* 0xF0-0xF7 */
-       0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF  /* 0xF8-0xFF */
-};
-
-struct unicode_value fat_a2uni[256] = {
-/* 0x00 */
-{0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
-{0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
-{0x08, 0x00}, {0x09, 0x00}, {0x0A, 0x00}, {0x0B, 0x00},
-{0x0C, 0x00}, {0x0D, 0x00}, {0x0E, 0x00}, {0x0F, 0x00},
-/* 0x10 */
-{0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
-{0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
-{0x18, 0x00}, {0x19, 0x00}, {0x1A, 0x00}, {0x1B, 0x00},
-{0x1C, 0x00}, {0x1D, 0x00}, {0x1E, 0x00}, {0x1F, 0x00},
-/* 0x20 */
-{0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
-{0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
-{0x28, 0x00}, {0x29, 0x00}, {0x2A, 0x00}, {0x2B, 0x00},
-{0x2C, 0x00}, {0x2D, 0x00}, {0x2E, 0x00}, {0x2F, 0x00},
-/* 0x30 */
-{0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
-{0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
-{0x38, 0x00}, {0x39, 0x00}, {0x3A, 0x00}, {0x3B, 0x00},
-{0x3C, 0x00}, {0x3D, 0x00}, {0x3E, 0x00}, {0x3F, 0x00},
-/* 0x40 */
-{0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
-{0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
-{0x48, 0x00}, {0x49, 0x00}, {0x4A, 0x00}, {0x4B, 0x00},
-{0x4C, 0x00}, {0x4D, 0x00}, {0x4E, 0x00}, {0x4F, 0x00},
-/* 0x50 */
-{0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
-{0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
-{0x58, 0x00}, {0x59, 0x00}, {0x5A, 0x00}, {0x5B, 0x00},
-{0x5C, 0x00}, {0x5D, 0x00}, {0x5E, 0x00}, {0x5F, 0x00},
-/* 0x60 */
-{0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
-{0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
-{0x68, 0x00}, {0x69, 0x00}, {0x6A, 0x00}, {0x6B, 0x00},
-{0x6C, 0x00}, {0x6D, 0x00}, {0x6E, 0x00}, {0x6F, 0x00},
-/* 0x70 */
-{0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
-{0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
-{0x78, 0x00}, {0x79, 0x00}, {0x7A, 0x00}, {0x7B, 0x00},
-{0x7C, 0x00}, {0x7D, 0x00}, {0x7E, 0x00}, {0x7F, 0x00},
-/* 0x80 */
-{0xC7, 0x00}, {0xFC, 0x00}, {0xE9, 0x00}, {0xE2, 0x00},
-{0xE4, 0x00}, {0xE0, 0x00}, {0xE5, 0x00}, {0xE7, 0x00},
-{0xEA, 0x00}, {0xEB, 0x00}, {0xE8, 0x00}, {0xEF, 0x00},
-{0xEE, 0x00}, {0xEC, 0x00}, {0xC4, 0x00}, {0xC5, 0x00},
-/* 0x90 */
-{0xC9, 0x00}, {0xE6, 0x00}, {0xC6, 0x00}, {0xF4, 0x00},
-{0xF6, 0x00}, {0xF2, 0x00}, {0xFB, 0x00}, {0xF9, 0x00},
-{0xFF, 0x00}, {0xD6, 0x00}, {0xDC, 0x00}, {0xF8, 0x00},
-{0xA3, 0x00}, {0xD8, 0x00}, {0xD7, 0x00}, {0x92, 0x00},
-/* 0xA0 */
-{0xE1, 0x00}, {0xE0, 0x00}, {0xF3, 0x00}, {0xFA, 0x00},
-{0xF1, 0x00}, {0xD1, 0x00}, {0xAA, 0x00}, {0xBA, 0x00},
-{0xBF, 0x00}, {0xAE, 0x00}, {0xAC, 0x00}, {0xBD, 0x00},
-{0xBC, 0x00}, {0xA1, 0x00}, {0xAB, 0x00}, {0xBB, 0x00},
-/* 0xB0 */
-{0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
-{0x24, 0x25}, {0xC1, 0x00}, {0xC2, 0x00}, {0xC0, 0x00},
-{0xA9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
-{0x5D, 0x25}, {0xA2, 0x00}, {0xA5, 0x00}, {0x10, 0x25},
-/* 0xC0 */
-{0x14, 0x25}, {0x34, 0x25}, {0x2C, 0x25}, {0x1C, 0x25},
-{0x00, 0x25}, {0x3C, 0x25}, {0xE3, 0x00}, {0xC3, 0x00},
-{0x5A, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
-{0x60, 0x25}, {0x50, 0x25}, {0x6C, 0x25}, {0xA4, 0x00},
-/* 0xD0 */
-{0xF0, 0x00}, {0xD0, 0x00}, {0xCA, 0x00}, {0xCB, 0x00},
-{0xC8, 0x00}, {0x31, 0x01}, {0xCD, 0x00}, {0xCE, 0x00},
-{0xCF, 0x00}, {0x18, 0x25}, {0x0C, 0x25}, {0x88, 0x25},
-{0x84, 0x25}, {0xA6, 0x00}, {0xCC, 0x00}, {0x80, 0x25},
-/* 0xE0 */
-{0xD3, 0x00}, {0xDF, 0x00}, {0xD4, 0x00}, {0xD2, 0x00},
-{0xF5, 0x00}, {0xD5, 0x00}, {0xB5, 0x00}, {0xFE, 0x00},
-{0xDE, 0x00}, {0xDA, 0x00}, {0xDB, 0x00}, {0xD9, 0x00},
-{0xFD, 0x00}, {0xDD, 0x00}, {0xAF, 0x00}, {0xB4, 0x00},
-/* 0xF0 */
-{0xAD, 0x00}, {0xB1, 0x00}, {0x17, 0x20}, {0xBE, 0x00},
-{0xB6, 0x00}, {0xA7, 0x00}, {0xF7, 0x00}, {0xB8, 0x00},
-{0xB0, 0x00}, {0xA8, 0x00}, {0xB7, 0x00}, {0xB9, 0x00},
-{0xB3, 0x00}, {0xB2, 0x00}, {0xA0, 0x25}, {0xA0, 0x00}};
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+/*
+ * linux/fs/fat/tables.c
+ *
+ * Unicode escape translation tables for VFAT filename handling.
+ * By Gordon Chaffee.
+ *
+ * Note: This file is used by all fat-based filesystems.
+ */
+
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/msdos_fs.h>
+
+unsigned char fat_uni2esc[64] = {
+       '0', '1', '2', '3', '4', '5', '6', '7',
+       '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
+       'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+       'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
+       'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
+       'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+       'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
+       'u', 'v', 'w', 'x', 'y', 'z', '+', '-'
+};
+
+unsigned char fat_esc2uni[256] = {
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0x3e, 0xff, 0x3f, 0xff, 0xff, 
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 
+       0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 
+       0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 
+       0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 
+       0x21, 0x22, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 
+       0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 
+       0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 
+       0x3b, 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
+};
+
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
index 74016aa..2664f4b 100644 (file)
@@ -116,6+116,10 @@ __initfunc(static void do_sys_setup(void))
        init_autofs_fs();
 #endif
 
+#ifdef CONFIG_NLS
+       init_nls();
+#endif
+
        mount_root();
 }
 
index 1d91173..e2b6ea6 100644 (file)
@@ -146,7+146,7 @@ static const struct super_operations hpfs_sops =
 
 /* file ops */
 
-static long hpfs_file_read(struct inode *, struct file *, char *, unsigned long);
+static ssize_t hpfs_file_read(struct file *, char *, size_t, loff_t *);
 static secno hpfs_bmap(struct inode *, unsigned);
 
 static const struct file_operations hpfs_file_ops =
@@ -187,8+187,8 @@ static const struct inode_operations hpfs_file_iops =
 
 /* directory ops */
 
-static long hpfs_dir_read(struct inode *inode, struct file *filp,
-                         char *buf, unsigned long count);
+static ssize_t hpfs_dir_read(struct file *filp, char *buf, 
+                            size_t count, loff_t *ppos);
 static int hpfs_readdir(struct file *filp,
                        void *dirent, filldir_t filldir);
 static int hpfs_lookup(struct inode *, struct dentry *);
@@ -881,10+881,11 @@ static unsigned count_one_bitmap(kdev_t dev, secno secno)
  * read.  Read the bytes, put them in buf, return the count.
  */
 
-static long hpfs_file_read(struct inode *inode, struct file *filp,
-                         char *buf, unsigned long count)
+static ssize_t hpfs_file_read(struct file *filp, char *buf,
+                             size_t count, loff_t *ppos)
 {
-       unsigned q, r, n, n0;
+       struct inode *inode = filp->f_dentry->d_inode;
+       size_t q, r, n, n0;
        struct buffer_head *bh;
        char *block;
        char *start;
@@ -895,8+896,8 @@ static long hpfs_file_read(struct inode *inode, struct file *filp,
        /*
         * truncate count at EOF
         */
-       if (count > inode->i_size - (off_t) filp->f_pos)
-               count = inode->i_size - filp->f_pos;
+       if (count > inode->i_size - (off_t) *ppos)
+               count = inode->i_size - *ppos;
 
        start = buf;
        while (count > 0) {
@@ -904,8+905,8 @@ static long hpfs_file_read(struct inode *inode, struct file *filp,
                 * get file sector number, offset in sector, length to end of
                 * sector
                 */
-               q = filp->f_pos >> 9;
-               r = filp->f_pos & 511;
+               q = *ppos >> 9;
+               r = *ppos & 511;
                n = 512 - r;
 
                /*
@@ -941,8+942,8 @@ static long hpfs_file_read(struct inode *inode, struct file *filp,
                         * squeeze out \r, output length varies
                         */
                        n0 = convcpy_tofs(buf, block + r, n);
-                       if (count > inode->i_size - (off_t) filp->f_pos - n + n0)
-                               count = inode->i_size - filp->f_pos - n + n0;
+                       if (count > inode->i_size - (off_t) *ppos - n + n0)
+                               count = inode->i_size - *ppos - n + n0;
                }
 
                brelse(bh);
@@ -950,7+951,7 @@ static long hpfs_file_read(struct inode *inode, struct file *filp,
                /*
                 * advance input n bytes, output n0 bytes
                 */
-               filp->f_pos += n;
+               *ppos += n;
                buf += n0;
                count -= n0;
        }
@@ -1578,8+1579,8 @@ static struct hpfs_dirent *map_nth_dirent(kdev_t dev, dnode_secno dno,
        return 0;
 }
 
-static long hpfs_dir_read(struct inode *inode, struct file *filp,
-                         char *buf, unsigned long count)
+static ssize_t hpfs_dir_read(struct file *filp, char *buf,
+                            size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index 6a8423c..946d87d 100644 (file)
@@ -7,6+7,7 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/mm.h>
+#include <linux/dcache.h>
 
 /*
  * New inode.c implementation.
  * Famous last words.
  */
 
+#define INODE_PARANOIA 1
+/* #define INODE_DEBUG 1 */
+
 /*
  * Inode lookup is no longer as critical as it used to be:
  * most of the lookups are going to be through the dcache.
@@ -51,13+55,14 @@ static struct list_head inode_hashtable[HASH_SIZE];
 spinlock_t inode_lock = SPIN_LOCK_UNLOCKED;
 
 /*
- * Statistics gathering.. Not actually done yet.
+ * Statistics gathering..
  */
 struct {
        int nr_inodes;
        int nr_free_inodes;
-       int dummy[10];
-} inodes_stat;
+       int preshrink;          /* pre-shrink dcache? */
+       int dummy[4];
+} inodes_stat = {0, 0, 0,};
 
 int max_inodes = NR_INODE;
 
@@ -138,8+143,11 @@ static inline void sync_one(struct inode *inode)
                __wait_on_inode(inode);
                spin_lock(&inode_lock);
        } else {
+               struct list_head *insert = &inode_in_use;
+               if (!inode->i_count)
+                       insert = inode_in_use.prev;
                list_del(&inode->i_list);
-               list_add(&inode->i_list, &inode_in_use);
+               list_add(&inode->i_list, insert);
 
                /* Set I_LOCK, reset I_DIRTY */
                inode->i_state ^= I_DIRTY | I_LOCK;
@@ -196,7+204,7 @@ void write_inode_now(struct inode *inode)
 
        if (sb) {
                spin_lock(&inode_lock);
-               if (inode->i_state & I_DIRTY)
+               while (inode->i_state & I_DIRTY)
                        sync_one(inode);
                spin_unlock(&inode_lock);
        }
@@ -307,6+315,9 @@ int invalidate_inodes(struct super_block * sb)
  * the in-use for the specified number of freeable inodes.
  * Freeable inodes are moved to a temporary list and then
  * placed on the unused list by dispose_list.
+ *
+ * Note that we do not expect to have to search very hard:
+ * the freeable inodes will be at the old end of the list.
  * 
  * N.B. The spinlock is released to call dispose_list.
  */
@@ -314,18+325,15 @@ int invalidate_inodes(struct super_block * sb)
        (((inode)->i_count == 0) && \
         (!(inode)->i_state))
 
-static void try_to_free_inodes(int goal)
+static int free_inodes(int goal)
 {
-       struct list_head * tmp;
-       struct list_head *head = &inode_in_use;
+       struct list_head *tmp, *head = &inode_in_use;
        LIST_HEAD(freeable);
-       int found = 0, search = goal << 1;
-
-       while ((tmp = head->prev) != head && search--) {
-               struct inode * inode;
+       int found = 0, depth = goal << 1;
 
+       while ((tmp = head->prev) != head && depth--) {
+               struct inode * inode = list_entry(tmp, struct inode, i_list);
                list_del(tmp);
-               inode = list_entry(tmp, struct inode, i_list);
                if (CAN_UNUSE(inode)) {
                        list_del(&inode->i_hash);
                        INIT_LIST_HEAD(&inode->i_hash);
@@ -336,18+344,61 @@ static void try_to_free_inodes(int goal)
                }
                list_add(tmp, head);
        }
+       if (found) {
+               spin_unlock(&inode_lock);
+               dispose_list(&freeable);
+               spin_lock(&inode_lock);
+       }
+       return found;
+}
+
+/*
+ * Searches the inodes list for freeable inodes,
+ * possibly shrinking the dcache before or after.
+ */
+static void try_to_free_inodes(int goal)
+{
+       int retried = 0, found;
+
+       /*
+        * Check whether to preshrink the dcache ...
+        */
+       if (inodes_stat.preshrink) {
+               spin_unlock(&inode_lock);
+               select_dcache(goal, 0);
+               prune_dcache(goal);
+               spin_lock(&inode_lock);
+       }
+
+repeat:
+       found = free_inodes(goal);
+
        /*
         * If we didn't free any inodes, do a limited
         * pruning of the dcache to help the next time.
         */
-       spin_unlock(&inode_lock);
-       if (found)
-               dispose_list(&freeable);
-       else
+       if (!found) {
+               spin_unlock(&inode_lock);
+               select_dcache(goal, 0);
                prune_dcache(goal);
+               spin_lock(&inode_lock);
+               if (inodes_stat.preshrink && !retried++)
+                       goto repeat;
+       }
+}
+
+/*
+ * This is the externally visible routine for
+ * inode memory management.
+ */
+void free_inode_memory(int goal)
+{
        spin_lock(&inode_lock);
+       free_inodes(goal);
+       spin_unlock(&inode_lock);
 }
 
+#define INODES_PER_PAGE PAGE_SIZE/sizeof(struct inode)
 /*
  * This is called with the spinlock held, but releases
  * the lock when freeing or allocating inodes.
@@ -358,27+409,6 @@ static struct inode * grow_inodes(void)
 {
        struct inode * inode;
 
-       /*
-        * Check whether to shrink the dcache ... if we've
-        * allocated more than half of the nominal maximum,
-        * try shrinking before allocating more. 
-        */
-       if (inodes_stat.nr_inodes >= (max_inodes >> 1)) {
-               struct list_head * tmp;
-
-               spin_unlock(&inode_lock);
-               prune_dcache(128);
-               spin_lock(&inode_lock);
-               try_to_free_inodes(128);
-               tmp = inode_unused.next;
-               if (tmp != &inode_unused) {
-                       inodes_stat.nr_free_inodes--;
-                       list_del(tmp);
-                       inode = list_entry(tmp, struct inode, i_list);
-                       return inode;
-               }
-       }
-
        spin_unlock(&inode_lock);
        inode = (struct inode *)__get_free_page(GFP_KERNEL);
        if (inode) {
@@ -392,13+422,42 @@ static struct inode * grow_inodes(void)
                        tmp++;
                        init_once(tmp);
                        list_add(&tmp->i_list, &inode_unused);
-                       inodes_stat.nr_free_inodes++;
                        size -= sizeof(struct inode);
                } while (size >= 0);
                init_once(inode);
-               inodes_stat.nr_inodes += PAGE_SIZE / sizeof(struct inode);
+               /*
+                * Update the inode statistics
+                */
+               inodes_stat.nr_inodes += INODES_PER_PAGE;
+               inodes_stat.nr_free_inodes += INODES_PER_PAGE - 1;
+               inodes_stat.preshrink = 0;
+               if (inodes_stat.nr_inodes > max_inodes)
+                       inodes_stat.preshrink = 1;
+               return inode;
        }
-       return inode;
+
+       /*
+        * If the allocation failed, do an extensive pruning of 
+        * the dcache and then try again to free some inodes.
+        */
+       prune_dcache(128);
+       inodes_stat.preshrink = 1;
+
+       spin_lock(&inode_lock);
+       free_inodes(128);
+       {
+               struct list_head *tmp = inode_unused.next;
+               if (tmp != &inode_unused) {
+                       inodes_stat.nr_free_inodes--;
+                       list_del(tmp);
+                       inode = list_entry(tmp, struct inode, i_list);
+                       return inode;
+               }
+       }
+       spin_unlock(&inode_lock);
+
+       printk("grow_inodes: allocation failed\n");
+       return NULL;
 }
 
 /*
@@ -627,6+686,18 @@ void iput(struct inode *inode)
                                list_add(&inode->i_list, &inode_unused);
                                inodes_stat.nr_free_inodes++;
                        }
+                       else if (!(inode->i_state & I_DIRTY)) {
+                               list_del(&inode->i_list);
+                               list_add(&inode->i_list, inode_in_use.prev);
+                       }
+#ifdef INODE_PARANOIA
+if (inode->i_count)
+printk("iput: device %s inode %ld count changed, count=%d\n",
+kdevname(inode->i_dev), inode->i_ino, inode->i_count);
+if (atomic_read(&inode->i_sem.count) != 1)
+printk("iput: Aieee, semaphore in use device %s, count=%d\n",
+kdevname(inode->i_dev), atomic_read(&inode->i_sem.count));
+#endif
                }
                if (inode->i_count > (1<<15)) {
                        printk("iput: device %s inode %ld count wrapped\n",
index 8dd4cc9..10a4404 100644 (file)
@@ -9,6+9,11 @@
 
 O_TARGET := isofs.o
 O_OBJS   := namei.o inode.o file.o dir.o util.o rock.o symlink.o
+
+ifdef CONFIG_JOLIET
+O_OBJS += joliet.o
+endif
+
 M_OBJS   := $(O_TARGET)
 
 include $(TOPDIR)/Rules.make
index a198141..1d9a4f3 100644 (file)
@@ -102,15+102,14 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
        unsigned int block, offset;
        int inode_number;
        struct buffer_head *bh;
-       int len, rrflag;
+       int len;
+       int map;
        int high_sierra = 0;
-       char *name;
+       char *p = NULL;         /* Quiet GCC */
        struct iso_directory_record *de;
 
-       if( filp->f_pos >= inode->i_size ) {
-         return 0;
-       }
+       if (filp->f_pos >= inode->i_size)
+               return 0;
  
        offset = filp->f_pos & (bufsize - 1);
        block = isofs_bmap(inode, filp->f_pos >> bufbits);
@@ -141,15+140,19 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                   CDROM sector.  If we are at the end of the directory, we
                   kick out of the while loop. */
 
-               if ((de_len == 0) || (offset == bufsize) ) {
+               if ((de_len == 0) || (offset >= bufsize) ) {
                        brelse(bh);
-                       filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1))
-                                      + ISOFS_BLOCK_SIZE);
-                       offset = 0;
-                       if( filp->f_pos >= inode->i_size )
-                         {
-                           return 0;
-                         }
+                       if (de_len == 0) {
+                               filp->f_pos = ((filp->f_pos & ~(ISOFS_BLOCK_SIZE - 1))
+                                              + ISOFS_BLOCK_SIZE);
+                               offset = 0;
+                       } else {
+                               offset -= bufsize;
+                               filp->f_pos += offset;
+                       }
+
+                       if (filp->f_pos >= inode->i_size)
+                               return 0;
 
                        block = isofs_bmap(inode, (filp->f_pos) >> bufbits);
                        if (!block)
@@ -181,6+184,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                        continue;
                }
 
+               len = 0;
+
                /* Handle the case of the '..' directory */
                if (de->name_len[0] == 1 && de->name[0] == 1) {
                        inode_number = filp->f_dentry->d_parent->d_inode->i_ino;
@@ -192,7+197,6 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 
                /* Handle everything else.  Do name translation if there
                   is no Rock Ridge NM field. */
-
                if (inode->i_sb->u.isofs_sb.s_unhide == 'n') {
                        /* Do not report hidden or associated files */
                        high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
@@ -202,34+206,35 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
                        }
                }
 
-               /* Check Rock Ridge name translation.. */
-               len = de->name_len[0];
-               name = de->name;
-               rrflag = get_rock_ridge_filename(de, &name, &len, inode);
-               if (rrflag) {
-                       /* rrflag == 1 means that we have a new name (kmalloced) */
-                       if (rrflag == 1) {
-                               rrflag = filldir(dirent, name, len, filp->f_pos, inode_number);
-                               kfree(name); /* this was allocated in get_r_r_filename.. */
-                               if (rrflag < 0)
-                                       break;
+               if (inode->i_sb->u.isofs_sb.s_joliet_level) {
+                       len = get_joliet_filename(de, inode, tmpname);
+                       p = tmpname;
+               } else {
+                       map = 1;
+                       if (inode->i_sb->u.isofs_sb.s_rock) {
+                               len = get_rock_ridge_filename(de, tmpname, inode);
+                               if (len != 0) {
+                                       p = tmpname;
+                                       map = 0;
+                               }
+                       }
+                       if (map) {
+                               if (inode->i_sb->u.isofs_sb.s_mapping == 'n') {
+                                       len = isofs_name_translate(de->name, de->name_len[0],
+                                                                  tmpname);
+                                       p = tmpname;
+                               } else {
+                                       p = de->name;
+                                       len = de->name_len[0];
+                               }
                        }
-                       filp->f_pos += de_len;
-                       continue;
                }
-
-               if (inode->i_sb->u.isofs_sb.s_mapping == 'n') {
-                       len = isofs_name_translate(name, len, tmpname);
-                       if (filldir(dirent, tmpname, len, filp->f_pos, inode_number) < 0)
+               if (len > 0) {
+                       if (filldir(dirent, p, len, filp->f_pos, inode_number) < 0)
                                break;
-                       filp->f_pos += de_len;
-                       continue;
                }
-
-               if (filldir(dirent, name, len, filp->f_pos, inode_number) < 0)
-                       break;
-
                filp->f_pos += de_len;
+
                continue;
        }
        brelse(bh);
@@ -255,7+260,7 @@ static int isofs_readdir(struct file *filp,
        tmpname = (char *) __get_free_page(GFP_KERNEL);
        if (!tmpname)
                return -ENOMEM;
-       tmpde = (struct iso_directory_record *) (tmpname+256);
+       tmpde = (struct iso_directory_record *) (tmpname+1024);
 
        result = do_isofs_readdir(inode, filp, dirent, filldir, tmpname, tmpde);
 
index a925159..12c5bf9 100644 (file)
 #include <linux/errno.h>
 #include <linux/cdrom.h>
 #include <linux/init.h>
+#include <linux/nls.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -40,6+41,12 @@ static int check_bread = 0;
 
 void isofs_put_super(struct super_block *sb)
 {
+#ifdef CONFIG_JOLIET
+       if (sb->u.isofs_sb.s_nls_iocharset) {
+               unload_nls(sb->u.isofs_sb.s_nls_iocharset);
+               sb->u.isofs_sb.s_nls_iocharset = NULL;
+       }
+#endif
        lock_super(sb);
 
 #ifdef LEAK_CHECK
@@ -67,6+74,7 @@ static struct super_operations isofs_sops = {
 struct iso9660_options{
   char map;
   char rock;
+  char joliet;
   char cruft;
   char unhide;
   unsigned char check;
@@ -75,14+83,18 @@ struct iso9660_options{
   mode_t mode;
   gid_t gid;
   uid_t uid;
+  char *iocharset;
+  unsigned char utf8;
 };
 
 static int parse_options(char *options, struct iso9660_options * popt)
 {
-       char *this_char,*value;
+       char *this_char,*value,*p;
+       int len;
 
        popt->map = 'n';
        popt->rock = 'y';
+       popt->joliet = 'y';
        popt->cruft = 'n';
        popt->unhide = 'n';
        popt->check = 's';              /* default: strict */
@@ -94,12+106,18 @@ static int parse_options(char *options, struct iso9660_options * popt)
                                           a valid executable. */
        popt->gid = 0;
        popt->uid = 0;
+       popt->iocharset = NULL;
+       popt->utf8 = 0;
        if (!options) return 1;
        for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
                if (strncmp(this_char,"norock",6) == 0) {
                  popt->rock = 'n';
                  continue;
                }
+               if (strncmp(this_char,"nojoliet",8) == 0) {
+                 popt->joliet = 'n';
+                 continue;
+               }
                if (strncmp(this_char,"unhide",6) == 0) {
                  popt->unhide = 'y';
                  continue;
@@ -108,8+126,28 @@ static int parse_options(char *options, struct iso9660_options * popt)
                  popt->cruft = 'y';
                  continue;
                }
+               if (strncmp(this_char,"utf8",4) == 0) {
+                 popt->utf8 = 1;
+                 continue;
+               }
                if ((value = strchr(this_char,'=')) != NULL)
                        *value++ = 0;
+
+#ifdef CONFIG_JOLIET
+               if (!strcmp(this_char,"iocharset")) {
+                       p = value;
+                       while (*value && *value != ',') value++;
+                       len = value - p;
+                       if (len) {
+                               popt->iocharset = kmalloc(len+1, GFP_KERNEL);
+                               memcpy(popt->iocharset, p, len);
+                               popt->iocharset[len] = 0;
+                       } else {
+                               popt->iocharset = NULL;
+                               return 0;
+                       }
+               } else
+#endif
                if (!strcmp(this_char,"map") && value) {
                        if (value[0] && !value[1] && strchr("on",*value))
                                popt->map = *value;
@@ -234,10+272,13 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        struct hs_primary_descriptor  * h_pri = NULL;
        int                             high_sierra;
        int                             iso_blknum;
+       int                             joliet_level = 0;
        struct iso9660_options          opt;
        int                             orig_zonesize;
+       char                          * p;
        struct iso_primary_descriptor * pri = NULL;
        struct iso_directory_record   * rootp;
+       struct iso_supplementary_descriptor *sec = NULL;
        struct iso_volume_descriptor  * vdp;
        unsigned int                    vol_desc_start;
 
@@ -254,6+295,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
 #if 0
        printk("map = %c\n", opt.map);
        printk("rock = %c\n", opt.rock);
+       printk("joliet = %c\n", opt.joliet);
        printk("check = %c\n", opt.check);
        printk("cruft = %c\n", opt.cruft);
        printk("unhide = %c\n", opt.unhide);
@@ -297,57+339,91 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
 
        vol_desc_start = isofs_get_last_session(dev);
 
-       for (iso_blknum = vol_desc_start+16;
-             iso_blknum < vol_desc_start+100; iso_blknum++) {
-                int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits);
-
-               if (!(bh = bread(dev,b,opt.blocksize))) {
-                       s->s_dev = 0;
-                       printk("isofs_read_super: bread failed, dev "
-                              "%s iso_blknum %d block %d\n",
-                              kdevname(dev), iso_blknum, b);
-                       unlock_super(s);
-                       MOD_DEC_USE_COUNT;
-                       return NULL;
-               }
-
-               vdp = (struct iso_volume_descriptor *)bh->b_data;
-               hdp = (struct hs_volume_descriptor *)bh->b_data;
+       for (iso_blknum = vol_desc_start+16;
+             iso_blknum < vol_desc_start+100; iso_blknum++)
+       {
+           int b = iso_blknum << (ISOFS_BLOCK_BITS-blocksize_bits);
 
+           if (!(bh = bread(dev,b,opt.blocksize))) {
+               s->s_dev = 0;
+               printk("isofs_read_super: bread failed, dev "
+                      "%s iso_blknum %d block %d\n",
+                      kdevname(dev), iso_blknum, b);
+               unlock_super(s);
+               MOD_DEC_USE_COUNT;
+               return NULL;
+           }
 
-               if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) {
-                 if (isonum_711 (hdp->type) != ISO_VD_PRIMARY)
-                       goto out;
-                 if (isonum_711 (hdp->type) == ISO_VD_END)
-                       goto out;
+           vdp = (struct iso_volume_descriptor *)bh->b_data;
+           hdp = (struct hs_volume_descriptor *)bh->b_data;
+           
+           if (strncmp (hdp->id, HS_STANDARD_ID, sizeof hdp->id) == 0) {
+               if (isonum_711 (hdp->type) != ISO_VD_PRIMARY)
+                   goto out;
+               if (isonum_711 (hdp->type) == ISO_VD_END)
+                   goto out;
+               
+               s->u.isofs_sb.s_high_sierra = 1;
+               high_sierra = 1;
+               opt.rock = 'n';
+               h_pri = (struct hs_primary_descriptor *)vdp;
+               break;
+           }
 
-                       s->u.isofs_sb.s_high_sierra = 1;
-                       high_sierra = 1;
-                       opt.rock = 'n';
-                       h_pri = (struct hs_primary_descriptor *)vdp;
+           if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) {
+               if (isonum_711 (vdp->type) == ISO_VD_END)
+                   break;
+               if (isonum_711 (vdp->type) == ISO_VD_PRIMARY) {
+                   if (pri == NULL) {
+                       pri = (struct iso_primary_descriptor *)vdp;
+                   }
+#ifdef CONFIG_JOLIET
+               } else if (isonum_711 (vdp->type) == ISO_VD_SUPPLEMENTARY) {
+                   sec = (struct iso_supplementary_descriptor *)vdp;
+                   if (sec->escape[0] == 0x25 && sec->escape[1] == 0x2f) {
+                       if (opt.joliet == 'y') {
+                           opt.rock = 'n';
+                           if (sec->escape[2] == 0x40) {
+                               joliet_level = 1;
+                           } else if (sec->escape[2] == 0x43) {
+                               joliet_level = 2;
+                           } else if (sec->escape[2] == 0x45) {
+                               joliet_level = 3;
+                           }
+                           printk("ISO9660 Extensions: Microsoft Joliet Level %d\n",
+                                  joliet_level);
+                       }
                        break;
+                   } else {
+                       /* Unknown supplementary volume descriptor */
+                       sec = NULL;
+                   }
+#endif
                }
+               /* Just skip any volume descriptors we don't recognize */
+           }
 
-               if (strncmp (vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) {
-                 if (isonum_711 (vdp->type) != ISO_VD_PRIMARY)
-                       goto out;
-                 if (isonum_711 (vdp->type) == ISO_VD_END)
-                       goto out;
-
-                       pri = (struct iso_primary_descriptor *)vdp;
-                       break;
-               }
-
-               brelse(bh);
-             }
-       if(iso_blknum == vol_desc_start + 100) {
-               if (!silent)
-                       printk("Unable to identify CD-ROM format.\n");
-               s->s_dev = 0;
-               unlock_super(s);
-               MOD_DEC_USE_COUNT;
-               return NULL;
+           brelse(bh);
+       }
+       if ((pri == NULL) && (sec == NULL) && (h_pri == NULL)) {
+           if (!silent)
+               printk("Unable to identify CD-ROM format.\n");
+           s->s_dev = 0;
+           unlock_super(s);
+           MOD_DEC_USE_COUNT;
+           return NULL;
        }
+#ifdef CONFIG_JOLIET
+       s->u.isofs_sb.s_joliet_level = joliet_level;
+       if (joliet_level) {
+           /* Note: In theory, it is possible to have Rock Ridge
+            * extensions mixed with Joliet. All character strings
+            * would just be saved as Unicode. Until someone sees such
+            * a disc, do not allow the two to be mixed
+            */
+           pri = (struct iso_primary_descriptor *) sec;
+       }
+#endif
 
        if(high_sierra){
          rootp = (struct iso_directory_record *) h_pri->root_directory_record;
@@ -465,6+541,27 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
            printk(KERN_DEBUG "Forcing new log zone size:%d\n", opt.blocksize);
          }
 
+#ifdef CONFIG_JOLIET
+       s->u.isofs_sb.s_nls_iocharset = NULL;
+       if (joliet_level == 0) {
+               if (opt.iocharset) {
+                       kfree(opt.iocharset);
+                       opt.iocharset = NULL;
+               }
+       } else if (opt.utf8 == 0) {
+               p = opt.iocharset ? opt.iocharset : "iso8859-1";
+               s->u.isofs_sb.s_nls_iocharset = load_nls(p);
+               if (! s->u.isofs_sb.s_nls_iocharset) {
+                       /* Fail only if explicit charset specified */
+                       if (opt.iocharset) {
+                               kfree(opt.iocharset);
+                               goto out;
+                       } else {
+                               s->u.isofs_sb.s_nls_iocharset = load_nls_default();
+                       }
+               }
+       }
+#endif
        s->s_dev = dev;
        s->s_op = &isofs_sops;
        s->u.isofs_sb.s_mapping = opt.map;
@@ -475,6+572,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        s->u.isofs_sb.s_unhide = opt.unhide;
        s->u.isofs_sb.s_uid = opt.uid;
        s->u.isofs_sb.s_gid = opt.gid;
+       s->u.isofs_sb.s_utf8 = opt.utf8;
        /*
         * It would be incredibly stupid to allow people to mark every file on the disk
         * as suid, so we merely allow them to set the default permissions.
@@ -490,13+588,24 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
        if (!(s->s_root)) {
                s->s_dev = 0;
                printk("get root inode failed\n");
+#ifdef CONFIG_JOLIET
+               if (s->u.isofs_sb.s_nls_iocharset)
+                       unload_nls(s->u.isofs_sb.s_nls_iocharset);
+               if (opt.iocharset) kfree(opt.iocharset);
+#endif
                MOD_DEC_USE_COUNT;
                return NULL;
        }
 
        if(!check_disk_change(s->s_dev)) {
-         return s;
+               return s;
        }
+#ifdef CONFIG_JOLIET
+       if (s->u.isofs_sb.s_nls_iocharset)
+               unload_nls(s->u.isofs_sb.s_nls_iocharset);
+#endif
+       if (opt.iocharset) kfree(opt.iocharset);
+
  out: /* Kick out for various error conditions */
        brelse(bh);
        s->s_dev = 0;
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
new file mode 100644 (file)
index 0000000..c34bfef
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ *  linux/fs/isofs/joliet.c
+ *
+ *  (C) 1996 Gordon Chaffee
+ *
+ *  Joliet: Microsoft's Unicode extensions to iso9660
+ */
+
+#include <linux/string.h>
+#include <linux/nls.h>
+#include <linux/malloc.h>
+#include <linux/iso_fs.h>
+
+/*
+ * Convert Unicode 16 to UTF8 or ascii.
+ */
+static int
+uni16_to_x8(unsigned char *ascii, unsigned char *uni, int len,
+           struct nls_table *nls)
+{
+       unsigned char *ip, *op;
+       unsigned char ch, cl;
+       unsigned char *uni_page;
+
+       ip = uni;
+       op = ascii;
+
+       while ((*ip || ip[1]) && len) {
+               ch = *ip++;
+               cl = *ip++;
+
+               uni_page = nls->page_uni2charset[ch];
+               if (uni_page && uni_page[cl]) {
+                       *op++ = uni_page[cl];
+               } else {
+                       *op++ = '?';
+               }
+               len--;
+       }
+       *op = 0;
+       return (op - ascii);
+}
+
+/* Convert big endian wide character string to utf8 */
+static int
+wcsntombs_be(__u8 *s, const __u8 *pwcs, int inlen, int maxlen)
+{
+       const __u8 *ip;
+       __u8 *op;
+       int size;
+       __u16 c;
+
+       op = s;
+       ip = pwcs;
+       while ((*ip || ip[1]) && (maxlen > 0) && (inlen > 0)) {
+               c = (*ip << 8) | ip[1];
+               if (c > 0x7f) {
+                       size = utf8_wctomb(op, c, maxlen);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               maxlen--;
+                       } else {
+                               op += size;
+                               maxlen -= size;
+                       }
+               } else {
+                       *op++ = (__u8) c;
+               }
+               ip += 2;
+               inlen--;
+       }
+       return (op - s);
+}
+
+int
+get_joliet_filename(struct iso_directory_record * de, struct inode * inode,
+                   unsigned char *outname)
+{
+       unsigned char utf8;
+       struct nls_table *nls;
+       unsigned char len = 0;
+       int i;
+       char c;
+
+       utf8 = inode->i_sb->u.isofs_sb.s_utf8;
+       nls = inode->i_sb->u.isofs_sb.s_nls_iocharset;
+
+       if (utf8) {
+               len = wcsntombs_be(outname, de->name,
+                                  de->name_len[0] >> 1, PAGE_SIZE);
+       } else {
+               len = uni16_to_x8(outname, de->name,
+                                 de->name_len[0] >> 1, nls);
+       }
+       if ((len > 2) && (outname[len-2] == ';') && (outname[len-1] == '1')) {
+               len -= 2;
+       }
+
+        if (inode->i_sb->u.isofs_sb.s_name_check == 'r') {
+               for (i = 0; i < len; i++) {
+                       c = outname[i];
+                       /* lower case */
+                       if (c >= 'A' && c <= 'Z') c |= 0x20;
+                       if (c == ';') c = '.';
+                       outname[i] = c;
+               }
+       }
+
+       return len;
+}
index 9955583..1bedcf9 100644 (file)
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <asm/uaccess.h>
 #include <linux/malloc.h>
-
 #include <linux/errno.h>
+#include <linux/config.h>      /* Joliet? */
+
+#include <asm/uaccess.h>
 
 /*
  * ok, we cannot use strncmp, as the name is not in our data space.
@@ -67,8+68,9 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                inode_number = 0; /* shut gcc up */
        struct buffer_head * bh;
        unsigned int old_offset;
-       int dlen, rrflag, match;
+       int dlen, match;
        char * dpnt;
+       unsigned char *page = NULL;
        struct iso_directory_record * de = NULL; /* shut gcc up */
        char de_not_in_buf = 0;   /* true if de is in kmalloc'd memory */
        char c;
@@ -92,9+94,8 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                if(!de_not_in_buf) {
                        de = (struct iso_directory_record *) 
                                (bh->b_data + offset);
-                       inode_number = (block << bufbits) 
-                               + (offset & (bufsize - 1));
                }
+               inode_number = (block << bufbits) + (offset & (bufsize - 1));
 
                /* If byte is zero, or we had to fetch this de past
                   the end of the buffer, this is the end of file, or
@@ -109,22+110,22 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                                    one */
                                de_not_in_buf = 0;
                                kfree(de);
-                               offset -= bufsize;
+                               f_pos += offset;
                        }
-                       else 
+                       else 
                                offset = 0;
+                               f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1))
+                                        + ISOFS_BLOCK_SIZE);
+                       }
                        brelse(bh);
-                       f_pos = ((f_pos & ~(ISOFS_BLOCK_SIZE - 1))
-                                + ISOFS_BLOCK_SIZE) + offset;
 
-                       if( f_pos >= dir->i_size )
-                         {
-                           return 0;
-                         }
+                       if (f_pos >= dir->i_size) 
+                               return 0;
 
                        block = isofs_bmap(dir,f_pos>>bufbits);
                        if (!block || !(bh = bread(dir->i_dev,block,bufsize)))
-                               return 0;
+                               return NULL;
+
                        continue; /* Will kick out if past end of directory */
                }
 
@@ -154,31+155,44 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                               bh_next->b_data, offset - bufsize);
                        brelse(bh_next);
                        de_not_in_buf = 1;
+                       offset -= bufsize;
                }
-               
                dlen = de->name_len[0];
                dpnt = de->name;
-               /* Now convert the filename in the buffer to lower case */
-               rrflag = get_rock_ridge_filename(de, &dpnt, &dlen, dir);
-               if (rrflag) {
-                 if (rrflag == -1) goto out; /* Relocated deep directory */
-               } else {
-                 if(dir->i_sb->u.isofs_sb.s_mapping == 'n') {
-                   for (i = 0; i < dlen; i++) {
-                     c = dpnt[i];
-                     if (c >= 'A' && c <= 'Z') c |= 0x20;  /* lower case */
-                     if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') {
-                       dlen -= 2;
-                       break;
-                     }
-                     if (c == ';') c = '.';
-                     de->name[i] = c;
-                   }
-                   /* This allows us to match with and without a trailing
-                      period.  */
-                   if(dpnt[dlen-1] == '.' && namelen == dlen-1)
-                     dlen--;
-                 }
+
+               if (dir->i_sb->u.isofs_sb.s_rock ||
+                   dir->i_sb->u.isofs_sb.s_joliet_level) {
+                       page = (unsigned char *)
+                               __get_free_page(GFP_KERNEL);
+                       if (!page) return NULL;
+               }
+               if (dir->i_sb->u.isofs_sb.s_rock &&
+                   ((i = get_rock_ridge_filename(de, page, dir)))) {
+                       if (i == -1)
+                               goto out;/* Relocated deep directory */
+                       dlen = i;
+                       dpnt = page;
+#ifdef CONFIG_JOLIET
+               } else if (dir->i_sb->u.isofs_sb.s_joliet_level) {
+                       dlen = get_joliet_filename(de, dir, page);
+                       dpnt = page;
+#endif
+               } else if (dir->i_sb->u.isofs_sb.s_mapping == 'n') {
+                       for (i = 0; i < dlen; i++) {
+                               c = dpnt[i];
+                               /* lower case */
+                               if (c >= 'A' && c <= 'Z') c |= 0x20;
+                               if (c == ';' && i == dlen-2 && dpnt[i+1] == '1') {
+                                       dlen -= 2;
+                                       break;
+                               }
+                               if (c == ';') c = '.';
+                               dpnt[i] = c;
+                       }
+                       /* This allows us to match with and without
+                        * a trailing period. */
+                       if(dpnt[dlen-1] == '.' && namelen == dlen-1)
+                               dlen--;
                }
                /*
                 * Skip hidden or associated files unless unhide is set 
@@ -190,7+204,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
                        match = isofs_match(namelen,name,dpnt,dlen);
                }
 
-               if(rrflag) kfree(dpnt);
+               if (page) free_page((unsigned long) page);
                if (match) {
                        if(inode_number == -1) {
                                /* Should only happen for the '..' entry */
index a9bb95f..e006ac3 100644 (file)
@@ -153,15+153,16 @@ int find_rock_ridge_relocation(struct iso_directory_record * de,
 }
 
 int get_rock_ridge_filename(struct iso_directory_record * de,
-                          char ** name, int * namlen, struct inode * inode)
+                           char * retname, struct inode * inode)
 {
   int len;
   unsigned char * chr;
   CONTINUE_DECLS;
-  char * retname = NULL;
   int retnamlen = 0, truncate=0;
  
   if (!inode->i_sb->u.isofs_sb.s_rock) return 0;
+  *retname = 0;
+  retnamlen = 0;
 
   SETUP_ROCK_RIDGE(de, chr, len);
  repeat:
@@ -203,18+204,6 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
          printk("Unsupported NM flag settings (%d)\n",rr->u.NM.flags);
          break;
        };
-       if (!retname){
-         retname = (char *) kmalloc (255,GFP_KERNEL);
-         /* This may be a waste, but we only
-            need this for a moment.  The layers
-            that call this function should
-            deallocate the mem fairly soon
-            after control is returned */
-
-         if (!retname) goto out;
-         *retname = 0; /* Zero length string */
-         retnamlen = 0;
-       };
        if((strlen(retname) + rr->len - 5) >= 254) {
          truncate = 1;
          break;
@@ -227,7+216,6 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
        printk("RR: RE (%x)\n", inode->i_ino);
 #endif
        if (buffer) kfree(buffer);
-       if (retname) kfree(retname);
        return -1;
       default:
        break;
@@ -235,15+223,9 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
     };
   }
   MAYBE_CONTINUE(repeat,inode);
-  if(retname){
-    *name = retname;
-    *namlen = retnamlen;
-    return 1;
-  };
-  return 0;  /* This file did not have a NM field */
+  return retnamlen; /* If 0, this file did not have a NM field */
  out:
   if(buffer) kfree(buffer);
-  if (retname) kfree(retname);
   return 0;
 }
 
index 75183cc..2d578fb 100644 (file)
@@ -9,6+9,8 @@
  *  the 386bsd iso9660 filesystem, by Pace Willisson <pace@blitz.com>.
  */
 
+#include <linux/time.h>
+
 int
 isonum_711 (char * p)
 {
@@ -112,6+114,8 @@ int iso_date(char * p, int flag)
                crtime = 0;
        } else {
                int monlen[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
+               extern struct timezone sys_tz;
+
                days = year * 365;
                if (year > 2)
                        days += (year+1) / 4;
@@ -122,7+126,9 @@ int iso_date(char * p, int flag)
                days += day - 1;
                crtime = ((((days * 24) + hour) * 60 + minute) * 60)
                        + second;
-               
+               if (sys_tz.tz_dsttime)
+                       crtime -= 3600;
+
                /* sign extend */
                if (tz & 0x80)
                        tz |= (-1 << 8);
index f6804b6..3f4c2c2 100644 (file)
@@ -503,7+503,7 @@ int locks_verify_locked(struct inode *inode)
 }
 
 int locks_verify_area(int read_write, struct inode *inode, struct file *filp,
-                     unsigned int offset, unsigned int count)
+                     loff_t offset, size_t count)
 {
        /* Candidates for mandatory locking have the setgid bit set
         * but no group execute bit -  an otherwise meaningless combination.
@@ -531,8+531,8 @@ int locks_mandatory_locked(struct inode *inode)
 }
 
 int locks_mandatory_area(int read_write, struct inode *inode,
-                        struct file *filp, unsigned int offset,
-                        unsigned int count)
+                        struct file *filp, loff_t offset,
+                        size_t count)
 {
        struct file_lock *fl;
        struct file_lock tfl;
@@ -1147,9+1147,9 @@ static char *lock_get_status(struct file_lock *fl, int id, char *pfx)
 }
 
 static inline int copy_lock_status(char *p, char **q, off_t pos, int len,
-                                  off_t offset, int length)
+                                  off_t offset, off_t length)
 {
-       int i;
+       off_t i;
 
        i = pos - offset;
        if (i > 0) {
@@ -1171,15+1171,13 @@ static inline int copy_lock_status(char *p, char **q, off_t pos, int len,
        return (1);
 }
 
-int get_locks_status(char *buffer, char **start, off_t offset, int length)
+int get_locks_status(char *buffer, char **start, off_t offset, off_t length)
 {
        struct file_lock *fl;
        struct file_lock *bfl;
        char *p;
        char *q = buffer;
-       int i;
-       int len;
-       off_t pos = 0;
+       off_t i, len, pos = 0;
 
        for (fl = file_lock_table, i = 1; fl != NULL; fl = fl->fl_nextlink, i++) {
                p = lock_get_status(fl, i, "");
index 11ebef0..4c40781 100644 (file)
 
 #include <asm/uaccess.h>
 
-static long minix_dir_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t minix_dir_read(struct file * filp, char * buf,
+                             size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index ecd0d24..5aaef83 100644 (file)
 #include <linux/fs.h>
 #include <linux/minix_fs.h>
 
-static long minix_file_write(struct inode *, struct file *, const char *, unsigned long);
+static ssize_t minix_file_write(struct file *, const char *, size_t, loff_t *);
 
 /*
  * We have mostly NULL's here: the current defaults are ok for
@@ -66,11+66,12 @@ struct inode_operations minix_file_inode_operations = {
        NULL                    /* permission */
 };
 
-static long minix_file_write(struct inode * inode, struct file * filp,
-       const char * buf, unsigned long count)
+static ssize_t minix_file_write(struct file * filp, const char * buf,
+                               size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        off_t pos;
-       int written,c;
+       ssize_t written, c;
        struct buffer_head * bh;
        char * p;
 
@@ -85,7+86,7 @@ static long minix_file_write(struct inode * inode, struct file * filp,
        if (filp->f_flags & O_APPEND)
                pos = inode->i_size;
        else
-               pos = filp->f_pos;
+               pos = *ppos;
        written = 0;
        while (written < count) {
                bh = minix_getblk(inode,pos/BLOCK_SIZE,1);
@@ -126,7+127,7 @@ static long minix_file_write(struct inode * inode, struct file * filp,
        if (pos > inode->i_size)
                inode->i_size = pos;
        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-       filp->f_pos = pos;
+       *ppos = pos;
        mark_inode_dirty(inode);
        return written;
 }
index d1404cd..91a7445 100644 (file)
@@ -230,6+230,7 @@ struct super_block *msdos_read_super(struct super_block *sb,void *data, int sile
 
        MOD_INC_USE_COUNT;
 
+       MSDOS_SB(sb)->options.isvfat = 0;
        sb->s_op = &msdos_sops;
        res =  fat_read_super(sb, data, silent);
        if (res == NULL) {
@@ -317,7+318,9 @@ static int msdos_create_entry(struct inode *dir, const char *name,
        *result = NULL;
        if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) {
                if (res != -ENOENT) return res;
-               if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+               if ((dir->i_ino == MSDOS_ROOT_INO) &&
+                   (MSDOS_SB(sb)->fat_bits != 32))
+                       return -ENOSPC;
                if ((res = fat_add_cluster(dir)) < 0) return res;
                if ((res = fat_scan(dir,NULL,&bh,&de,&ino,SCAN_ANY)) < 0) return res;
        }
@@ -327,10+330,10 @@ static int msdos_create_entry(struct inode *dir, const char *name,
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        mark_inode_dirty(dir);
        memcpy(de->name,name,MSDOS_NAME);
-       memset(de->unused, 0, sizeof(de->unused));
        de->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
        de->attr = is_hid ? (de->attr|ATTR_HIDDEN) : (de->attr&~ATTR_HIDDEN);
        de->start = 0;
+       de->starthi = 0;
        fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
        de->size = 0;
        fat_mark_buffer_dirty(sb, bh, 1);
@@ -502,6+505,7 @@ int msdos_mkdir(struct inode *dir,struct dentry *dentry,int mode)
                goto mkdir_error;
        dot->i_size = inode->i_size; /* doesn't grow in the 2nd create_entry */
        MSDOS_I(dot)->i_start = MSDOS_I(inode)->i_start;
+       MSDOS_I(dot)->i_logstart = MSDOS_I(inode)->i_logstart;
        dot->i_nlink = inode->i_nlink;
        mark_inode_dirty(dot);
        iput(dot);
@@ -510,6+514,7 @@ int msdos_mkdir(struct inode *dir,struct dentry *dentry,int mode)
        fat_unlock_creation();
        dot->i_size = dir->i_size;
        MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start;
+       MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart;
        dot->i_nlink = dir->i_nlink;
        mark_inode_dirty(dot);
        MSDOS_I(inode)->i_busy = 0;
@@ -737,8+742,10 @@ static int rename_diff_dir(struct inode *old_dir,char *old_name,
                        error = -EIO;
                        goto rename_done;
                }
-               dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
-                   MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart;
+               dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart);
+               dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16);
                mark_inode_dirty(dotdot_inode);
                fat_mark_buffer_dirty(sb, dotdot_bh, 1);
                old_dir->i_nlink--;
index 68064e8..fc90b3e 100644 (file)
@@ -448,6+448,7 @@ struct dentry * __namei(const char *pathname, int follow_link)
        char *name;
        struct dentry *dentry;
 
+       check_dcache_memory();
        name = getname(pathname);
        dentry = (struct dentry *) name;
        if (!IS_ERR(name)) {
@@ -521,6+522,7 @@ struct dentry * open_namei(const char * pathname, int flag, int mode)
        struct inode *inode;
        struct dentry *dentry;
 
+       check_dcache_memory();
        mode &= S_IALLUGO & ~current->fs->umask;
        mode |= S_IFREG;
 
index 1543b00..8b0be8c 100644 (file)
@@ -52,7+52,7 @@ struct nfs_dirent {
 };
 
 static int nfs_dir_open(struct inode * inode, struct file * file);
-static long nfs_dir_read(struct inode *, struct file *, char *, unsigned long);
+static ssize_t nfs_dir_read(struct file *, char *, size_t, loff_t *);
 static int nfs_readdir(struct file *, void *, filldir_t);
 static int nfs_lookup(struct inode *, struct dentry *);
 static int nfs_create(struct inode *, struct dentry *, int);
@@ -107,8+107,8 @@ nfs_dir_open(struct inode *dir, struct file *file)
        return nfs_revalidate_inode(NFS_SERVER(dir), dir);
 }
 
-static long
-nfs_dir_read(struct inode *inode, struct file *filp, char *buf, unsigned long count)
+static ssize_t
+nfs_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
@@ -317,7+317,7 @@ nfs_invalidate_dircache(struct inode *inode)
                        continue;
                if (cache->locked) {
                        printk("NFS: cache locked for %s/%ld\n",
-                               kdevname(dev), ino);
+                               kdevname(dev), (long) ino);
                        continue;
                }
                cache->valid = 0;       /* brute force */
index 3a576e5..d3900b5 100644 (file)
 #define NFSDBG_FACILITY                NFSDBG_FILE
 
 static int  nfs_file_mmap(struct file *, struct vm_area_struct *);
-static long nfs_file_read(struct inode *, struct file *, char *, unsigned long);
-static long nfs_file_write(struct inode *, struct file *,
-                                       const char *, unsigned long);
+static ssize_t nfs_file_read(struct file *, char *, size_t, loff_t *);
+static ssize_t nfs_file_write(struct file *, const char *, size_t, loff_t *);
 static int  nfs_file_close(struct inode *, struct file *);
 static int  nfs_fsync(struct file *, struct dentry *dentry);
 
@@ -97,19+96,19 @@ nfs_file_close(struct inode *inode, struct file *file)
        return nfs_write_error(inode);
 }
 
-static long
-nfs_file_read(struct inode * inode, struct file * file,
-                               char * buf, unsigned long count)
+static ssize_t
+nfs_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        int     status;
 
        dfprintk(VFS, "nfs: read(%x/%ld, %lu@%lu)\n",
                        inode->i_dev, inode->i_ino, count,
-                       (unsigned long) file->f_pos);
+                       (unsigned long) *ppos);
 
        if ((status = nfs_revalidate_inode(NFS_SERVER(inode), inode)) < 0)
                return status;
-       return generic_file_read(inode, file, buf, count);
+       return generic_file_read(file, buf, count, ppos);
 }
 
 static int
@@ -136,15+135,15 @@ static int nfs_fsync(struct file *file, struct dentry *dentry)
 /* 
  * Write to a file (through the page cache).
  */
-static long
-nfs_file_write(struct inode *inode, struct file *file,
-                       const char *buf, unsigned long count)
+static ssize_t
+nfs_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        int     result;
 
        dfprintk(VFS, "nfs: write(%x/%ld (%d), %lu@%lu)\n",
                        inode->i_dev, inode->i_ino, inode->i_count,
-                       count, (unsigned long) file->f_pos);
+                       count, (unsigned long) *ppos);
 
        if (!inode) {
                printk("nfs_file_write: inode = NULL\n");
@@ -168,7+167,7 @@ nfs_file_write(struct inode *inode, struct file *file,
        if ((result = nfs_write_error(inode)) < 0)
                return result;
 
-       return generic_file_write(inode, file, buf, count);
+       return generic_file_write(file, buf, count, ppos);
 }
 
 /*
index 055bc5a..a263400 100644 (file)
 #define NFS_PARANOIA 1
 
 extern void nfs_invalidate_dircache_sb(struct super_block *);
+extern int  check_failed_request(struct inode *);
 
-static int nfs_notify_change(struct inode *, struct iattr *);
+static void nfs_read_inode(struct inode *);
 static void nfs_put_inode(struct inode *);
 static void nfs_delete_inode(struct inode *);
+static int  nfs_notify_change(struct inode *, struct iattr *);
 static void nfs_put_super(struct super_block *);
-static void nfs_read_inode(struct inode *);
-static int nfs_statfs(struct super_block *, struct statfs *, int bufsiz);
+static int  nfs_statfs(struct super_block *, struct statfs *, int);
 
 static struct super_operations nfs_sops = { 
        nfs_read_inode,         /* read inode */
@@ -91,6+92,25 @@ static void
 nfs_delete_inode(struct inode * inode)
 {
        dprintk("NFS: delete_inode(%x/%ld)\n", inode->i_dev, inode->i_ino);
+       /*
+        * Flush out any pending write requests ...
+        */
+       if (NFS_WRITEBACK(inode) != NULL) {
+               unsigned long timeout = jiffies + 5*HZ;
+               printk("NFS: invalidating pending RPC requests\n");
+               nfs_invalidate_pages(inode);
+               while (NFS_WRITEBACK(inode) != NULL && jiffies < timeout) {
+                       current->state = TASK_UNINTERRUPTIBLE;
+                       current->timeout = jiffies + HZ/10;
+                       schedule();
+               }
+               current->state = TASK_RUNNING;
+               if (NFS_WRITEBACK(inode) != NULL)
+                       printk("NFS: Arghhh, stuck RPC requests!\n");
+       }
+
+       if (check_failed_request(inode))
+               printk("NFS: inode had failed requests\n");
        clear_inode(inode);
 }
 
index 1fbc9f5..d6d2136 100644 (file)
 
 #define NFSDBG_FACILITY                NFSDBG_PAGECACHE
 
+int check_failed_request(struct inode *);
+
 static void                    nfs_wback_lock(struct rpc_task *task);
 static void                    nfs_wback_result(struct rpc_task *task);
 
@@ -120,6+122,7 @@ struct nfs_wreq {
  * Limit number of delayed writes
  */
 static int                     nr_write_requests = 0;
+static int                     nr_failed_requests = 0;
 static struct rpc_wait_queue   write_queue = RPC_INIT_WAITQ("write_chain");
 struct nfs_wreq *              nfs_failed_requests = NULL;
 
@@ -282,28+285,72 @@ find_write_request(struct inode *inode, struct page *page)
 /*
  * Find a failed write request by pid
  */
-static inline struct nfs_wreq *
-find_failed_request(struct inode *inode, pid_t pid)
+static struct nfs_wreq *
+find_failed_request(struct inode *inode, pid_t pid, int all)
 {
        struct nfs_wreq *head, *req;
 
        if (!(req = head = nfs_failed_requests))
                return NULL;
        do {
-               if (req->wb_inode == inode && req->wb_pid == pid)
+               if (req->wb_inode == inode && (all || req->wb_pid == pid))
                        return req;
        } while ((req = WB_NEXT(req)) != head);
        return NULL;
 }
 
 /*
+ * Add a request to the failed list.
+ */
+static void
+append_failed_request(struct nfs_wreq * req)
+{
+       static int old_max = 16;
+
+       append_write_request(&nfs_failed_requests, req);
+       nr_failed_requests++;
+       if (nr_failed_requests >= old_max) {
+               printk("NFS: %d failed requests\n", nr_failed_requests);
+               old_max = old_max << 1;
+       }
+}
+
+/*
+ * Remove a request from the failed list and free it.
+ */
+static void
+remove_failed_request(struct nfs_wreq * req)
+{
+       remove_write_request(&nfs_failed_requests, req);
+       kfree(req);
+       nr_failed_requests--;
+}
+
+/*
+ * Find and release all failed requests for this inode.
+ */
+int
+check_failed_request(struct inode * inode)
+{
+       struct nfs_wreq * req;
+       int found = 0;
+
+       while ((req = find_failed_request(inode, 0, 1)) != NULL) {
+               remove_failed_request(req);
+               found++;
+       }
+       return found;
+}
+
+/*
  * Try to merge adjacent write requests. This works only for requests
  * issued by the same user.
  */
 static inline int
-update_write_request(struct nfs_wreq *req, unsigned first, unsigned bytes)
+update_write_request(struct nfs_wreq *req, unsigned int first,
+                       unsigned int bytes)
 {
-       unsigned        rqfirst = req->wb_offset,
+       unsigned int    rqfirst = req->wb_offset,
                        rqlast = rqfirst + req->wb_bytes,
                        last = first + bytes;
 
@@ -335,7+382,7 @@ update_write_request(struct nfs_wreq *req, unsigned first, unsigned bytes)
  */
 static inline struct nfs_wreq *
 create_write_request(struct inode *inode, struct page *page,
-                               unsigned offset, unsigned bytes)
+                       unsigned int offset, unsigned int bytes)
 {
        struct nfs_wreq *wreq;
        struct rpc_clnt *clnt = NFS_CLIENT(inode);
@@ -448,9+495,9 @@ wait_on_write_request(struct nfs_wreq *req)
        }
        remove_wait_queue(&page->wait, &wait);
        current->state = TASK_RUNNING;
-if (atomic_read(&page->count) == 1)
-printk("NFS: lost a page\n");
-       atomic_dec(&page->count);
+       if (atomic_read(&page->count) == 1)
+               printk("NFS: page unused while waiting\n");
+       free_page(page_address(page));
        return retval;
 }
 
@@ -620,7+667,7 @@ nfs_flush_pages(struct inode *inode, pid_t pid, off_t offset, off_t len,
 }
 
 /*
- * Cancel all writeback requests, both pending and in process.
+ * Cancel all writeback requests, both pending and in progress.
  */
 static void
 nfs_cancel_dirty(struct inode *inode, pid_t pid)
@@ -650,17+697,18 @@ int
 nfs_flush_dirty_pages(struct inode *inode, off_t offset, off_t len)
 {
        struct nfs_wreq *last = NULL;
+       int result = 0;
 
        dprintk("NFS:      flush_dirty_pages(%x/%ld for pid %d %ld/%ld)\n",
                                inode->i_dev, inode->i_ino, current->pid,
                                offset, len);
 
-       if (IS_SOFT && signalled())
-               nfs_cancel_dirty(inode, current->pid);
-
        for (;;) {
-               if (IS_SOFT && signalled())
-                       return -ERESTARTSYS;
+               if (IS_SOFT && signalled()) {
+                       nfs_cancel_dirty(inode, current->pid);
+                       result = -ERESTARTSYS;
+                       break;
+               }
 
                /* Flush all pending writes for this pid and file region */
                last = nfs_flush_pages(inode, current->pid, offset, len, 0);
@@ -669,7+717,7 @@ nfs_flush_dirty_pages(struct inode *inode, off_t offset, off_t len)
                wait_on_write_request(last);
        }
 
-       return 0;
+       return result;
 }
 
 /*
@@ -732,15+780,14 @@ nfs_check_error(struct inode *inode)
        dprintk("nfs:      checking for write error inode %04x/%ld\n",
                        inode->i_dev, inode->i_ino);
 
-       if (!(req = find_failed_request(inode, current->pid)))
-               return 0;
-
-       dprintk("nfs: write error %d inode %04x/%ld\n",
+       req = find_failed_request(inode, current->pid, 0);
+       if (req) {
+               dprintk("nfs: write error %d inode %04x/%ld\n",
                        req->wb_task.tk_status, inode->i_dev, inode->i_ino);
 
-       status = req->wb_task.tk_status;
-       remove_write_request(&nfs_failed_requests, req);
-       kfree(req);
+               status = req->wb_task.tk_status;
+               remove_failed_request(req);
+       }
        return status;
 }
 
@@ -816,23+863,14 @@ nfs_wback_result(struct rpc_task *task)
        page   = req->wb_page;
        status = task->tk_status;
 
-       /* Remove request from writeback list and wake up tasks
-        * sleeping on it. */
-       remove_write_request(&NFS_WRITEBACK(inode), req);
-
        if (status < 0) {
                /*
                 * An error occurred. Report the error back to the
-                * application by adding the failed request to the
-                * inode's error list.
+                * application by adding the request to the failed
+                * requests list.
                 */
-               if (find_failed_request(inode, req->wb_pid)) {
+               if (find_failed_request(inode, req->wb_pid, 0))
                        status = 0;
-               } else {
-                       dprintk("NFS: %4d saving write failure code\n",
-                                               task->tk_pid);
-                       append_write_request(&nfs_failed_requests, req);
-               }
                clear_bit(PG_uptodate, &page->flags);
        } else if (!WB_CANCELLED(req)) {
                struct nfs_fattr *fattr = req->wb_fattr;
@@ -860,6+898,10 @@ nfs_wback_result(struct rpc_task *task)
                }
        }
 
+       /*
+        * This call might block, so we defer removing the request
+        * from the inode's writeback list.
+        */
        rpc_release_task(task);
 
        if (WB_INVALIDATE(req))
@@ -871,8+913,20 @@ nfs_wback_result(struct rpc_task *task)
                kfree(req->wb_args);
                req->wb_args = 0;
        }
+
+       /*
+        * Now it's safe to remove the request from the inode's 
+        * writeback list and wake up any tasks sleeping on it.
+        * If the request failed, add it to the failed list.
+        */
+       remove_write_request(&NFS_WRITEBACK(inode), req);
+
        if (status >= 0)
                kfree(req);
+       else {
+               dprintk("NFS: %4d saving write failure code\n", task->tk_pid);
+               append_failed_request(req);
+       }
 
        free_page(page_address(page));
        nr_write_requests--;
index df6eb0e..7b225bd 100644 (file)
@@ -364,7+364,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, char *buf,
        file.f_pos = offset;
 
        oldfs = get_fs(); set_fs(KERNEL_DS);
-       err = file.f_op->read(inode, &file, buf, *count);
+       err = file.f_op->read(&file, buf, *count, &file.f_pos);
        set_fs(oldfs);
 
        /* Write back readahead params */
@@ -432,7+432,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
 
        /* Write the data. */
        oldfs = get_fs(); set_fs(KERNEL_DS);
-       err = file.f_op->write(inode, &file, buf, cnt);
+       err = file.f_op->write(&file, buf, cnt, &file.f_pos);
        set_fs(oldfs);
 
        /* clear setuid/setgid flag after write */
diff --git a/fs/nls/Config.in b/fs/nls/Config.in
new file mode 100644 (file)
index 0000000..595c6ff
--- /dev/null
@@ -0,0 +1,39 @@
+#
+# Native language support configuration
+#
+
+mainmenu_option next_comment
+comment 'Native Language Support'
+
+tristate 'Native language support (Unicode, codepages)' CONFIG_NLS
+
+if [ "$CONFIG_NLS" = "y" -o "$CONFIG_NLS" = "m" ]; then
+  dep_tristate 'Codepage 437'      CONFIG_NLS_CODEPAGE_437 $CONFIG_NLS
+  dep_tristate 'Codepage 737'      CONFIG_NLS_CODEPAGE_737 $CONFIG_NLS
+  dep_tristate 'Codepage 775'      CONFIG_NLS_CODEPAGE_775 $CONFIG_NLS
+  dep_tristate 'Codepage 850'      CONFIG_NLS_CODEPAGE_850 $CONFIG_NLS
+  dep_tristate 'Codepage 852'      CONFIG_NLS_CODEPAGE_852 $CONFIG_NLS
+  dep_tristate 'Codepage 855'      CONFIG_NLS_CODEPAGE_855 $CONFIG_NLS
+  dep_tristate 'Codepage 857'      CONFIG_NLS_CODEPAGE_857 $CONFIG_NLS
+  dep_tristate 'Codepage 860'      CONFIG_NLS_CODEPAGE_860 $CONFIG_NLS
+  dep_tristate 'Codepage 861'      CONFIG_NLS_CODEPAGE_861 $CONFIG_NLS
+  dep_tristate 'Codepage 862'      CONFIG_NLS_CODEPAGE_862 $CONFIG_NLS
+  dep_tristate 'Codepage 863'      CONFIG_NLS_CODEPAGE_863 $CONFIG_NLS
+  dep_tristate 'Codepage 864'      CONFIG_NLS_CODEPAGE_864 $CONFIG_NLS
+  dep_tristate 'Codepage 865'      CONFIG_NLS_CODEPAGE_865 $CONFIG_NLS
+  dep_tristate 'Codepage 866'      CONFIG_NLS_CODEPAGE_866 $CONFIG_NLS
+  dep_tristate 'Codepage 869'      CONFIG_NLS_CODEPAGE_869 $CONFIG_NLS
+  dep_tristate 'Codepage 874'      CONFIG_NLS_CODEPAGE_874 $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-1'    CONFIG_NLS_ISO8859_1    $CONFIG_NLS 
+  dep_tristate 'NLS ISO 8859-2'    CONFIG_NLS_ISO8859_2    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-3'    CONFIG_NLS_ISO8859_3    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-4'    CONFIG_NLS_ISO8859_4    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-5'    CONFIG_NLS_ISO8859_5    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-6'    CONFIG_NLS_ISO8859_6    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-7'    CONFIG_NLS_ISO8859_7    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-8'    CONFIG_NLS_ISO8859_8    $CONFIG_NLS
+  dep_tristate 'NLS ISO 8859-9'    CONFIG_NLS_ISO8859_9    $CONFIG_NLS
+  dep_tristate 'NLS KOI8-R'        CONFIG_NLS_KOI8_R       $CONFIG_NLS
+fi
+
+endmenu
diff --git a/fs/nls/Makefile b/fs/nls/Makefile
new file mode 100644 (file)
index 0000000..270211b
--- /dev/null
@@ -0,0 +1,305 @@
+#
+# Makefile for native language support
+#
+
+MOD_LIST_NAME := NLS_MODULES
+
+ifeq ($(CONFIG_NLS),y)
+NLS += nls_base.o
+O_TARGET = nls.o
+OX_OBJS  = $(NLS)
+else
+  ifeq ($(CONFIG_NLS),m)
+  MX_OBJS += nls_base.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_437),y)
+NLS += nls_cp437.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_437),m)
+  M_OBJS += nls_cp437.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_737),y)
+NLS += nls_cp737.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_737),m)
+  M_OBJS += nls_cp737.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_775),y)
+NLS += nls_cp775.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_775),m)
+  M_OBJS += nls_cp775.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_850),y)
+NLS += nls_cp850.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_850),m)
+  M_OBJS += nls_cp850.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_852),y)
+NLS += nls_cp852.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_852),m)
+  M_OBJS += nls_cp852.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_855),y)
+NLS += nls_cp855.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_855),m)
+  M_OBJS += nls_cp855.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_857),y)
+NLS += nls_cp857.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_857),m)
+  M_OBJS += nls_cp857.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_860),y)
+NLS += nls_cp860.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_860),m)
+  M_OBJS += nls_cp860.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_861),y)
+NLS += nls_cp861.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_861),m)
+  M_OBJS += nls_cp861.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_862),y)
+NLS += nls_cp862.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_862),m)
+  M_OBJS += nls_cp862.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_863),y)
+NLS += nls_cp863.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_863),m)
+  M_OBJS += nls_cp863.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_864),y)
+NLS += nls_cp864.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_864),m)
+  M_OBJS += nls_cp864.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_865),y)
+NLS += nls_cp865.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_865),m)
+  M_OBJS += nls_cp865.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_866),y)
+NLS += nls_cp866.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_866),m)
+  M_OBJS += nls_cp866.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_869),y)
+NLS += nls_cp869.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_869),m)
+  M_OBJS += nls_cp869.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_874),y)
+NLS += nls_cp874.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_874),m)
+  M_OBJS += nls_cp874.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1250),y)
+NLS += nls_cp1250.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1250),m)
+  M_OBJS += nls_cp1250.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1251),y)
+NLS += nls_cp1251.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1251),m)
+  M_OBJS += nls_cp1251.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1252),y)
+NLS += nls_cp1252.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1252),m)
+  M_OBJS += nls_cp1252.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1253),y)
+NLS += nls_cp1253.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1253),m)
+  M_OBJS += nls_cp1253.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1254),y)
+NLS += nls_cp1254.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1254),m)
+  M_OBJS += nls_cp1254.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1255),y)
+NLS += nls_cp1255.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1255),m)
+  M_OBJS += nls_cp1255.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1256),y)
+NLS += nls_cp1256.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1256),m)
+  M_OBJS += nls_cp1256.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1257),y)
+NLS += nls_cp1257.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1257),m)
+  M_OBJS += nls_cp1257.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_CODEPAGE_1258),y)
+NLS += nls_cp1258.o
+else
+  ifeq ($(CONFIG_NLS_CODEPAGE_1258),m)
+  M_OBJS += nls_cp1258.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_1),y)
+NLS += nls_iso8859-1.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_1),m)
+  M_OBJS += nls_iso8859-1.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_2),y)
+NLS += nls_iso8859-2.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_2),m)
+  M_OBJS += nls_iso8859-2.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_3),y)
+NLS += nls_iso8859-3.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_3),m)
+  M_OBJS += nls_iso8859-3.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_4),y)
+NLS += nls_iso8859-4.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_4),m)
+  M_OBJS += nls_iso8859-4.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_5),y)
+NLS += nls_iso8859-5.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_5),m)
+  M_OBJS += nls_iso8859-5.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_6),y)
+NLS += nls_iso8859-6.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_6),m)
+  M_OBJS += nls_iso8859-6.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_7),y)
+NLS += nls_iso8859-7.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_7),m)
+  M_OBJS += nls_iso8859-7.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_8),y)
+NLS += nls_iso8859-8.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_8),m)
+  M_OBJS += nls_iso8859-8.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_9),y)
+NLS += nls_iso8859-9.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_9),m)
+  M_OBJS += nls_iso8859-9.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_ISO8859_10),y)
+NLS += nls_iso8859-10.o
+else
+  ifeq ($(CONFIG_NLS_ISO8859_10),m)
+  M_OBJS += nls_iso8859-10.o
+  endif
+endif
+
+ifeq ($(CONFIG_NLS_KOI8_R),y)
+NLS += nls_koi8-r.o
+else
+  ifeq ($(CONFIG_NLS_KOI8_R),m)
+  M_OBJS += nls_koi8-r.o
+  endif
+endif
+
+include $(TOPDIR)/Rules.make
diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
new file mode 100644 (file)
index 0000000..65c1381
--- /dev/null
@@ -0,0 +1,499 @@
+/*
+ * linux/fs/nls.c
+ *
+ * Native language support--charsets and unicode translations.
+ * By Gordon Chaffee 1996, 1997
+ *
+ */
+
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/string.h>
+#include <linux/config.h>
+#include <linux/nls.h>
+#include <linux/malloc.h>
+#ifdef CONFIG_KERNELD
+#include <linux/kerneld.h>
+#endif
+#include <asm/byteorder.h>
+
+static struct nls_table *tables = (struct nls_table *) NULL;
+
+/*
+ * Sample implementation from Unicode home page.
+ * http://www.stonehand.com/unicode/standard/fss-utf.html
+ */
+struct utf8_table {
+       int     cmask;
+       int     cval;
+       int     shift;
+       long    lmask;
+       long    lval;
+};
+
+static struct utf8_table utf8_table[] =
+{
+    {0x80,  0x00,   0*6,    0x7F,           0,         /* 1 byte sequence */},
+    {0xE0,  0xC0,   1*6,    0x7FF,          0x80,      /* 2 byte sequence */},
+    {0xF0,  0xE0,   2*6,    0xFFFF,         0x800,     /* 3 byte sequence */},
+    {0xF8,  0xF0,   3*6,    0x1FFFFF,       0x10000,   /* 4 byte sequence */},
+    {0xFC,  0xF8,   4*6,    0x3FFFFFF,      0x200000,  /* 5 byte sequence */},
+    {0xFE,  0xFC,   5*6,    0x7FFFFFFF,     0x4000000, /* 6 byte sequence */},
+    {0,                                                       /* end of table    */}
+};
+
+int
+utf8_mbtowc(__u16 *p, const __u8 *s, int n)
+{
+       long l;
+       int c0, c, nc;
+       struct utf8_table *t;
+  
+       printk("utf8_mbtowc\n");
+       nc = 0;
+       c0 = *s;
+       l = c0;
+       for (t = utf8_table; t->cmask; t++) {
+               nc++;
+               if ((c0 & t->cmask) == t->cval) {
+                       l &= t->lmask;
+                       if (l < t->lval)
+                               return -1;
+                       *p = l;
+                       return nc;
+               }
+               if (n <= nc)
+                       return -1;
+               s++;
+               c = (*s ^ 0x80) & 0xFF;
+               if (c & 0xC0)
+                       return -1;
+               l = (l << 6) | c;
+       }
+       return -1;
+}
+
+int
+utf8_mbstowcs(__u16 *pwcs, const __u8 *s, int n)
+{
+       __u16 *op;
+       const __u8 *ip;
+       int size;
+
+       printk("\nutf8_mbstowcs: n=%d\n", n);
+       op = pwcs;
+       ip = s;
+       while (*ip && n > 0) {
+               printk(" %02x", *ip);
+               if (*ip & 0x80) {
+                       size = utf8_mbtowc(op, ip, n);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               ip++;
+                               n--;
+                       } else {
+                               op += size;
+                               ip += size;
+                               n -= size;
+                       }
+               } else {
+                       *op++ = *ip++;
+               }
+       }
+       return (op - pwcs);
+}
+
+int
+utf8_wctomb(__u8 *s, __u16 wc, int maxlen)
+{
+       long l;
+       int c, nc;
+       struct utf8_table *t;
+  
+       if (s == 0)
+               return 0;
+  
+       l = wc;
+       nc = 0;
+       for (t = utf8_table; t->cmask && maxlen; t++, maxlen--) {
+               nc++;
+               if (l <= t->lmask) {
+                       c = t->shift;
+                       *s = t->cval | (l >> c);
+                       while (c > 0) {
+                               c -= 6;
+                               s++;
+                               *s = 0x80 | ((l >> c) & 0x3F);
+                       }
+                       return nc;
+               }
+       }
+       return -1;
+}
+
+int
+utf8_wcstombs(__u8 *s, const __u16 *pwcs, int maxlen)
+{
+       const __u16 *ip;
+       __u8 *op;
+       int size;
+
+       op = s;
+       ip = pwcs;
+       while (*ip && maxlen > 0) {
+               if (*ip > 0x7f) {
+                       size = utf8_wctomb(op, *ip, maxlen);
+                       if (size == -1) {
+                               /* Ignore character and move on */
+                               maxlen--;
+                       } else {
+                               op += size;
+                               maxlen -= size;
+                       }
+               } else {
+                       *op++ = (__u8) *ip;
+               }
+               ip++;
+       }
+       return (op - s);
+}
+
+int register_nls(struct nls_table * nls)
+{
+       struct nls_table ** tmp = &tables;
+
+       if (!nls)
+               return -EINVAL;
+       if (nls->next)
+               return -EBUSY;
+       while (*tmp) {
+               if (nls == *tmp) {
+                       return -EBUSY;
+               }
+               tmp = &(*tmp)->next;
+       }
+       nls->next = tables;
+       tables = nls;
+       return 0;       
+}
+
+int unregister_nls(struct nls_table * nls)
+{
+       struct nls_table ** tmp = &tables;
+
+       while (*tmp) {
+               if (nls == *tmp) {
+                       *tmp = nls->next;
+                       return 0;
+               }
+               tmp = &(*tmp)->next;
+       }
+       return -EINVAL;
+}
+
+struct nls_table *find_nls(char *charset)
+{
+       struct nls_table *nls = tables;
+       while (nls) {
+               if (! strcmp(nls->charset, charset))
+                       return nls;
+               nls = nls->next;
+       }
+       return NULL;
+}
+
+struct nls_table *load_nls(char *charset)
+{
+       struct nls_table *nls;
+       char buf[40];
+       int ret;
+
+       nls = find_nls(charset);
+       if (nls) {
+               nls->inc_use_count();
+               return nls;
+       }
+
+#ifndef CONFIG_KERNELD
+       return NULL;
+#else
+       if (strlen(charset) > sizeof(buf) - sizeof("nls_")) {
+               printk("Unable to load NLS charset %s: name too long\n", charset);
+               return NULL;
+       }
+               
+       sprintf(buf, "nls_%s", charset);
+       ret = request_module(buf);
+       if (ret != 0) {
+               printk("Unable to load NLS charset %s\n", charset);
+               return NULL;
+       }
+       nls = find_nls(charset);
+       if (nls) {
+               nls->inc_use_count();
+       }
+       return nls;
+#endif
+}
+
+void unload_nls(struct nls_table *nls)
+{
+       nls->dec_use_count();
+}
+
+struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x80, 0x00}, {0x81, 0x00}, {0x82, 0x00}, {0x83, 0x00},
+       {0x84, 0x00}, {0x85, 0x00}, {0x86, 0x00}, {0x87, 0x00},
+       {0x88, 0x00}, {0x89, 0x00}, {0x8a, 0x00}, {0x8b, 0x00},
+       {0x8c, 0x00}, {0x8d, 0x00}, {0x8e, 0x00}, {0x8f, 0x00},
+       /* 0x90*/
+       {0x90, 0x00}, {0x91, 0x00}, {0x92, 0x00}, {0x93, 0x00},
+       {0x94, 0x00}, {0x95, 0x00}, {0x96, 0x00}, {0x97, 0x00},
+       {0x98, 0x00}, {0x99, 0x00}, {0x9a, 0x00}, {0x9b, 0x00},
+       {0x9c, 0x00}, {0x9d, 0x00}, {0x9e, 0x00}, {0x9f, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00
+};
+
+
+void inc_use_count(void)
+{
+}
+
+void dec_use_count(void)
+{
+}
+
+static struct nls_table default_table = {
+       "default",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+
+
+/* Returns a simple default translation table */
+struct nls_table *load_nls_default(void)
+{
+       return &default_table;
+}
+
+EXPORT_SYMBOL(register_nls);
+EXPORT_SYMBOL(unregister_nls);
+EXPORT_SYMBOL(unload_nls);
+EXPORT_SYMBOL(find_nls);
+EXPORT_SYMBOL(load_nls);
+EXPORT_SYMBOL(load_nls_default);
+EXPORT_SYMBOL(utf8_mbtowc);
+EXPORT_SYMBOL(utf8_mbstowcs);
+EXPORT_SYMBOL(utf8_wctomb);
+EXPORT_SYMBOL(utf8_wcstombs);
+
+int init_nls(void)
+{
+#ifdef CONFIG_NLS_ISO8859_1
+       init_nls_iso8859_1();
+#endif
+#ifdef CONFIG_NLS_ISO8859_2
+       init_nls_iso8859_2();
+#endif
+#ifdef CONFIG_NLS_ISO8859_3
+       init_nls_iso8859_3();
+#endif
+#ifdef CONFIG_NLS_ISO8859_4
+       init_nls_iso8859_4();
+#endif
+#ifdef CONFIG_NLS_ISO8859_5
+       init_nls_iso8859_5();
+#endif
+#ifdef CONFIG_NLS_ISO8859_6
+       init_nls_iso8859_6();
+#endif
+#ifdef CONFIG_NLS_ISO8859_7
+       init_nls_iso8859_7();
+#endif
+#ifdef CONFIG_NLS_ISO8859_8
+       init_nls_iso8859_8();
+#endif
+#ifdef CONFIG_NLS_ISO8859_9
+       init_nls_iso8859_9();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_437
+       init_nls_cp437();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_737
+       init_nls_cp737();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_775
+       init_nls_cp775();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_850
+       init_nls_cp850();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_852
+       init_nls_cp852();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_855
+       init_nls_cp855();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_857
+       init_nls_cp857();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_860
+       init_nls_cp860();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_861
+       init_nls_cp861();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_862
+       init_nls_cp862();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_863
+       init_nls_cp863();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_864
+       init_nls_cp864();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_865
+       init_nls_cp865();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_866
+       init_nls_cp866();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_869
+       init_nls_cp869();
+#endif
+#ifdef CONFIG_NLS_CODEPAGE_874
+       init_nls_cp874();
+#endif
+#if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,1,0)
+       return 0;
+#else
+       return register_symtab(&nls_syms);
+#endif
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls();
+}
+
+
+void cleanup_module(void)
+{
+}
+#endif /* ifdef MODULE */
diff --git a/fs/nls/nls_cp437.c b/fs/nls/nls_cp437.c
new file mode 100644 (file)
index 0000000..70495cd
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * linux/fs/nls_cp437.c
+ *
+ * Charset cp437 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 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] = {
+       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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 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, 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp437",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp437(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp437();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp737.c b/fs/nls/nls_cp737.c
new file mode 100644 (file)
index 0000000..fdcd2be
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * linux/fs/nls_cp737.c
+ *
+ * Charset cp737 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03},
+       {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0x98, 0x03},
+       {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03},
+       {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03}, {0xa0, 0x03},
+       /* 0x90*/
+       {0xa1, 0x03}, {0xa3, 0x03}, {0xa4, 0x03}, {0xa5, 0x03},
+       {0xa6, 0x03}, {0xa7, 0x03}, {0xa8, 0x03}, {0xa9, 0x03},
+       {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03}, {0xb4, 0x03},
+       {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03},
+       /* 0xa0*/
+       {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03},
+       {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03},
+       {0xc1, 0x03}, {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03},
+       {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03}, {0xc8, 0x03},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xc9, 0x03}, {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03},
+       {0xca, 0x03}, {0xaf, 0x03}, {0xcc, 0x03}, {0xcd, 0x03},
+       {0xcb, 0x03}, {0xce, 0x03}, {0x86, 0x03}, {0x88, 0x03},
+       {0x89, 0x03}, {0x8a, 0x03}, {0x8c, 0x03}, {0x8e, 0x03},
+       /* 0xf0*/
+       {0x8f, 0x03}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0xaa, 0x03}, {0xab, 0x03}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 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, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[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, 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, 0xea, 0x00, /* 0x80-0x87 */
+       0xeb, 0xec, 0xed, 0x00, 0xee, 0x00, 0xef, 0xf0, /* 0x88-0x8f */
+       0x00, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, /* 0x90-0x97 */
+       0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, /* 0x98-0x9f */
+       0x8f, 0x90, 0x00, 0x91, 0x92, 0x93, 0x94, 0x95, /* 0xa0-0xa7 */
+       0x96, 0x97, 0xf4, 0xf5, 0xe1, 0xe2, 0xe3, 0xe5, /* 0xa8-0xaf */
+       0x00, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, /* 0xb0-0xb7 */
+       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] = {
+       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, 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, 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] = {
+       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, 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 */
+       0xf7, 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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 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 */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp737",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp737(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp737();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp775.c b/fs/nls/nls_cp775.c
new file mode 100644 (file)
index 0000000..f7b4947
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * linux/fs/nls_cp775.c
+ *
+ * Charset cp775 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x06, 0x01}, {0xfc, 0x00}, {0xe9, 0x00}, {0x01, 0x01},
+       {0xe4, 0x00}, {0x23, 0x01}, {0xe5, 0x00}, {0x07, 0x01},
+       {0x42, 0x01}, {0x13, 0x01}, {0x56, 0x01}, {0x57, 0x01},
+       {0x2b, 0x01}, {0x79, 0x01}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0x4d, 0x01},
+       {0xf6, 0x00}, {0x22, 0x01}, {0xa2, 0x00}, {0x5a, 0x01},
+       {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0xa4, 0x00},
+       /* 0xa0*/
+       {0x00, 0x01}, {0x2a, 0x01}, {0xf3, 0x00}, {0x7b, 0x01},
+       {0x7c, 0x01}, {0x7a, 0x01}, {0x1d, 0x20}, {0xa6, 0x00},
+       {0xa9, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0x41, 0x01}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x04, 0x01}, {0x0c, 0x01}, {0x18, 0x01},
+       {0x16, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x2e, 0x01}, {0x60, 0x01}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x72, 0x01}, {0x6a, 0x01},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x7d, 0x01},
+       /* 0xd0*/
+       {0x05, 0x01}, {0x0d, 0x01}, {0x19, 0x01}, {0x17, 0x01},
+       {0x2f, 0x01}, {0x61, 0x01}, {0x73, 0x01}, {0x6b, 0x01},
+       {0x7e, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0x4c, 0x01}, {0x43, 0x01},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x44, 0x01},
+       {0x36, 0x01}, {0x37, 0x01}, {0x3b, 0x01}, {0x3c, 0x01},
+       {0x46, 0x01}, {0x12, 0x01}, {0x45, 0x01}, {0x19, 0x20},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x1c, 0x20}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0x1e, 0x20},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x96, 0x9c, 0x9f, 0x00, 0xa7, 0xf5, /* 0xa0-0xa7 */
+       0x00, 0xa8, 0x00, 0xae, 0xaa, 0xf0, 0xa9, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0x00, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0xfb, 0x00, 0xaf, 0xac, 0xab, 0xf3, 0x00, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xe0, 0x00, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x84, 0x86, 0x91, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x00, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */
+       0xb7, 0xd2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x95, 0x85, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0xa1, 0x8c, 0x00, 0x00, 0xbd, 0xd4, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xe9, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0xea, 0xeb, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0xad, 0x88, 0xe3, 0xe7, 0xee, 0xec, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0xe2, 0x93, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8b, /* 0x50-0x57 */
+       0x00, 0x00, 0x97, 0x98, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0xbe, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       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] = {
+       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, 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] = {
+       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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0x00, 0xea, 0x00, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp775",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp775(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp775();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp850.c b/fs/nls/nls_cp850.c
new file mode 100644 (file)
index 0000000..cb6e0e7
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_cp850.c
+ *
+ * Charset cp850 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xd7, 0x00}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00},
+       {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0xf0, 0x00}, {0xd0, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xc8, 0x00}, {0x31, 0x01}, {0xcd, 0x00}, {0xce, 0x00},
+       {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0xfe, 0x00},
+       {0xde, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00},
+       {0xfd, 0x00}, {0xdd, 0x00}, {0xaf, 0x00}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x17, 0x20}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0xb8, 0xa6, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0xf7, 0xfb, 0xa7, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */
+       0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */
+       0xd1, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0xed, 0xe8, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0xd0, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0xec, 0xe7, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 0xd5, 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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp850",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp850(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp850();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp852.c b/fs/nls/nls_cp852.c
new file mode 100644 (file)
index 0000000..d454de8
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_cp852.c
+ *
+ * Charset cp852 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0x6f, 0x01}, {0x07, 0x01}, {0xe7, 0x00},
+       {0x42, 0x01}, {0xeb, 0x00}, {0x50, 0x01}, {0x51, 0x01},
+       {0xee, 0x00}, {0x79, 0x01}, {0xc4, 0x00}, {0x06, 0x01},
+       /* 0x90*/
+       {0xc9, 0x00}, {0x39, 0x01}, {0x3a, 0x01}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0x3d, 0x01}, {0x3e, 0x01}, {0x5a, 0x01},
+       {0x5b, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0x64, 0x01},
+       {0x65, 0x01}, {0x41, 0x01}, {0xd7, 0x00}, {0x0d, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0x04, 0x01}, {0x05, 0x01}, {0x7d, 0x01}, {0x7e, 0x01},
+       {0x18, 0x01}, {0x19, 0x01}, {0xac, 0x00}, {0x7a, 0x01},
+       {0x0c, 0x01}, {0x5f, 0x01}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0x1a, 0x01},
+       {0x5e, 0x01}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x7b, 0x01}, {0x7c, 0x01}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x02, 0x01}, {0x03, 0x01},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0x11, 0x01}, {0x10, 0x01}, {0x0e, 0x01}, {0xcb, 0x00},
+       {0x0f, 0x01}, {0x47, 0x01}, {0xcd, 0x00}, {0xce, 0x00},
+       {0x1b, 0x01}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x62, 0x01}, {0x6e, 0x01}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0x43, 0x01},
+       {0x44, 0x01}, {0x48, 0x01}, {0x60, 0x01}, {0x61, 0x01},
+       {0x54, 0x01}, {0xda, 0x00}, {0x55, 0x01}, {0x70, 0x01},
+       {0xfd, 0x00}, {0xdd, 0x00}, {0x63, 0x01}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xdd, 0x02}, {0xdb, 0x02}, {0xc7, 0x02},
+       {0xd8, 0x02}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xd9, 0x02}, {0x71, 0x01},
+       {0x58, 0x01}, {0x59, 0x01}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0x00, 0x00, 0xae, 0xaa, 0xf0, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xf7, 0x00, 0x00, 0xaf, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xb5, 0xb6, 0x00, 0x8e, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0xd3, 0x00, 0xd6, 0xd7, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xe0, 0xe2, 0x00, 0x99, 0x9e, /* 0xd0-0xd7 */
+       0x00, 0x00, 0xe9, 0x00, 0x9a, 0xed, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0xa0, 0x83, 0x00, 0x84, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x00, 0x82, 0x00, 0x89, 0x00, 0xa1, 0x8c, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xa3, 0x00, 0x81, 0xec, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0xc6, 0xc7, 0xa4, 0xa5, 0x8f, 0x86, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x9f, 0xd2, 0xd4, /* 0x08-0x0f */
+       0xd1, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xa8, 0xa9, 0xb7, 0xd8, 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, 0x91, 0x92, 0x00, 0x00, 0x95, 0x96, 0x00, /* 0x38-0x3f */
+       0x00, 0x9d, 0x88, 0xe3, 0xe4, 0x00, 0x00, 0xd5, /* 0x40-0x47 */
+       0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x8a, 0x8b, 0x00, 0x00, 0xe8, 0xea, 0x00, 0x00, /* 0x50-0x57 */
+       0xfc, 0xfd, 0x97, 0x98, 0x00, 0x00, 0xb8, 0xad, /* 0x58-0x5f */
+       0xe6, 0xe7, 0xdd, 0xee, 0x9b, 0x9c, 0x00, 0x00, /* 0x60-0x67 */
+       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] = {
+       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, 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, 0xf3, /* 0xc0-0xc7 */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x8a, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x00, 0x00, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x9b, 0x00, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0xa6, 0x00, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0xaa, 0x00, 0xac, 0x00, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0x00, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0x00, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0x00, 0xfc, 0x00, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp852",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp852(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp852();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp855.c b/fs/nls/nls_cp855.c
new file mode 100644 (file)
index 0000000..240de80
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_cp855.c
+ *
+ * Charset cp855 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x52, 0x04}, {0x02, 0x04}, {0x53, 0x04}, {0x03, 0x04},
+       {0x51, 0x04}, {0x01, 0x04}, {0x54, 0x04}, {0x04, 0x04},
+       {0x55, 0x04}, {0x05, 0x04}, {0x56, 0x04}, {0x06, 0x04},
+       {0x57, 0x04}, {0x07, 0x04}, {0x58, 0x04}, {0x08, 0x04},
+       /* 0x90*/
+       {0x59, 0x04}, {0x09, 0x04}, {0x5a, 0x04}, {0x0a, 0x04},
+       {0x5b, 0x04}, {0x0b, 0x04}, {0x5c, 0x04}, {0x0c, 0x04},
+       {0x5e, 0x04}, {0x0e, 0x04}, {0x5f, 0x04}, {0x0f, 0x04},
+       {0x4e, 0x04}, {0x2e, 0x04}, {0x4a, 0x04}, {0x2a, 0x04},
+       /* 0xa0*/
+       {0x30, 0x04}, {0x10, 0x04}, {0x31, 0x04}, {0x11, 0x04},
+       {0x46, 0x04}, {0x26, 0x04}, {0x34, 0x04}, {0x14, 0x04},
+       {0x35, 0x04}, {0x15, 0x04}, {0x44, 0x04}, {0x24, 0x04},
+       {0x33, 0x04}, {0x13, 0x04}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x45, 0x04}, {0x25, 0x04}, {0x38, 0x04},
+       {0x18, 0x04}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x39, 0x04}, {0x19, 0x04}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x3a, 0x04}, {0x1a, 0x04},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0x3b, 0x04}, {0x1b, 0x04}, {0x3c, 0x04}, {0x1c, 0x04},
+       {0x3d, 0x04}, {0x1d, 0x04}, {0x3e, 0x04}, {0x1e, 0x04},
+       {0x3f, 0x04}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x1f, 0x04}, {0x4f, 0x04}, {0x80, 0x25},
+       /* 0xe0*/
+       {0x2f, 0x04}, {0x40, 0x04}, {0x20, 0x04}, {0x41, 0x04},
+       {0x21, 0x04}, {0x42, 0x04}, {0x22, 0x04}, {0x43, 0x04},
+       {0x23, 0x04}, {0x36, 0x04}, {0x16, 0x04}, {0x32, 0x04},
+       {0x12, 0x04}, {0x4c, 0x04}, {0x2c, 0x04}, {0x16, 0x21},
+       /* 0xf0*/
+       {0xad, 0x00}, {0x4b, 0x04}, {0x2b, 0x04}, {0x37, 0x04},
+       {0x17, 0x04}, {0x48, 0x04}, {0x28, 0x04}, {0x4d, 0x04},
+       {0x2d, 0x04}, {0x49, 0x04}, {0x29, 0x04}, {0x47, 0x04},
+       {0x27, 0x04}, {0xa7, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x00, 0x00, 0xcf, 0x00, 0x00, 0xfd, /* 0xa0-0xa7 */
+       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] = {
+       0x00, 0x85, 0x81, 0x83, 0x87, 0x89, 0x8b, 0x8d, /* 0x00-0x07 */
+       0x8f, 0x91, 0x93, 0x95, 0x97, 0x00, 0x99, 0x9b, /* 0x08-0x0f */
+       0xa1, 0xa3, 0xec, 0xad, 0xa7, 0xa9, 0xea, 0xf4, /* 0x10-0x17 */
+       0xb8, 0xbe, 0xc7, 0xd1, 0xd3, 0xd5, 0xd7, 0xdd, /* 0x18-0x1f */
+       0xe2, 0xe4, 0xe6, 0xe8, 0xab, 0xb6, 0xa5, 0xfc, /* 0x20-0x27 */
+       0xf6, 0xfa, 0x9f, 0xf2, 0xee, 0xf8, 0x9d, 0xe0, /* 0x28-0x2f */
+       0xa0, 0xa2, 0xeb, 0xac, 0xa6, 0xa8, 0xe9, 0xf3, /* 0x30-0x37 */
+       0xb7, 0xbd, 0xc6, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, /* 0x38-0x3f */
+       0xe1, 0xe3, 0xe5, 0xe7, 0xaa, 0xb5, 0xa4, 0xfb, /* 0x40-0x47 */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x00, 0x81, 0x00, 0x83, 0x00, 0x85, 0x00, 0x87, /* 0x80-0x87 */
+       0x00, 0x89, 0x00, 0x8b, 0x00, 0x8d, 0x00, 0x8f, /* 0x88-0x8f */
+       0x00, 0x91, 0x00, 0x93, 0x00, 0x95, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x00, 0x9b, 0x00, 0x9d, 0x00, 0x9f, /* 0x98-0x9f */
+       0x00, 0xa1, 0x00, 0xa3, 0x00, 0xa5, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0x00, 0xa9, 0x00, 0xab, 0x00, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0x00, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0x00, 0xd3, 0x00, 0xd5, 0x00, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0x00, 0xea, 0x00, 0xec, 0x00, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */
+       0xf8, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp855",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp855(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp855();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp857.c b/fs/nls/nls_cp857.c
new file mode 100644 (file)
index 0000000..c5f0f93
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_cp857.c
+ *
+ * Charset cp857 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0x31, 0x01}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0x30, 0x01}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0x5e, 0x01}, {0x5f, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0x1e, 0x01}, {0x1f, 0x01},
+       {0xbf, 0x00}, {0xae, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc0, 0x00},
+       {0xa9, 0x00}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0xa2, 0x00}, {0xa5, 0x00}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xe3, 0x00}, {0xc3, 0x00},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa4, 0x00},
+       /* 0xd0*/
+       {0xba, 0x00}, {0xaa, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xc8, 0x00}, {0x00, 0x00}, {0xcd, 0x00}, {0xce, 0x00},
+       {0xcf, 0x00}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xa6, 0x00}, {0xcc, 0x00}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xd3, 0x00}, {0xdf, 0x00}, {0xd4, 0x00}, {0xd2, 0x00},
+       {0xf5, 0x00}, {0xd5, 0x00}, {0xb5, 0x00}, {0x00, 0x00},
+       {0xd7, 0x00}, {0xda, 0x00}, {0xdb, 0x00}, {0xd9, 0x00},
+       {0xec, 0x00}, {0xff, 0x00}, {0xaf, 0x00}, {0xb4, 0x00},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0x00, 0x00}, {0xbe, 0x00},
+       {0xb6, 0x00}, {0xa7, 0x00}, {0xf7, 0x00}, {0xb8, 0x00},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xb7, 0x00}, {0xb9, 0x00},
+       {0xb3, 0x00}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0xbd, 0x9c, 0xcf, 0xbe, 0xdd, 0xf5, /* 0xa0-0xa7 */
+       0xf9, 0xb8, 0xd1, 0xae, 0xaa, 0xf0, 0xa9, 0xee, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xfc, 0xef, 0xe6, 0xf4, 0xfa, /* 0xb0-0xb7 */
+       0xf7, 0xfb, 0xd0, 0xaf, 0xac, 0xab, 0xf3, 0xa8, /* 0xb8-0xbf */
+       0xb7, 0xb5, 0xb6, 0xc7, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0xd4, 0x90, 0xd2, 0xd3, 0xde, 0xd6, 0xd7, 0xd8, /* 0xc8-0xcf */
+       0x00, 0xa5, 0xe3, 0xe0, 0xe2, 0xe5, 0x99, 0xe8, /* 0xd0-0xd7 */
+       0x9d, 0xeb, 0xe9, 0xea, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0xc6, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0xec, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0xe4, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0xed, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xa7, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x98, 0x8d, 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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0x00, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0x00, 0xe2, 0xe3, 0x00, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0x00, 0x00, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp857",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp857(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp857();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp860.c b/fs/nls/nls_cp860.c
new file mode 100644 (file)
index 0000000..97bc9f9
--- /dev/null
@@ -0,0 +1,411 @@
+/*
+ * linux/fs/nls_cp860.c
+ *
+ * Charset cp860 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe3, 0x00}, {0xe0, 0x00}, {0xc1, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xca, 0x00}, {0xe8, 0x00}, {0xcd, 0x00},
+       {0xd4, 0x00}, {0xec, 0x00}, {0xc3, 0x00}, {0xc2, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xc0, 0x00}, {0xc8, 0x00}, {0xf4, 0x00},
+       {0xf5, 0x00}, {0xf2, 0x00}, {0xda, 0x00}, {0xf9, 0x00},
+       {0xcc, 0x00}, {0xd5, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xd9, 0x00}, {0xa7, 0x20}, {0xd3, 0x00},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0xd2, 0x00}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x91, 0x86, 0x8f, 0x8e, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x92, 0x90, 0x89, 0x00, 0x98, 0x8b, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0xa9, 0x9f, 0x8c, 0x99, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x9d, 0x96, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x84, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x00, 0x8d, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x94, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 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, 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x00, /* 0x80-0x87 */
+       0x00, 0x89, 0x00, 0x8b, 0x8c, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x96, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp860",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp860(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp860();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp861.c b/fs/nls/nls_cp861.c
new file mode 100644 (file)
index 0000000..1ebbeed
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * linux/fs/nls_cp861.c
+ *
+ * Charset cp861 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xd0, 0x00},
+       {0xf0, 0x00}, {0xde, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xfe, 0x00}, {0xfb, 0x00}, {0xdd, 0x00},
+       {0xfd, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xc1, 0x00}, {0xcd, 0x00}, {0xd3, 0x00}, {0xda, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0xa4, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0xa5, 0x00, 0x00, /* 0xc8-0xcf */
+       0x8b, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0xa7, 0x00, 0x9a, 0x97, 0x8d, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x8c, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x00, 0xa3, 0x96, 0x81, 0x98, 0x95, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 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] = {
+       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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 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, 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x8b, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x97, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp861",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp861(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp861();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp862.c b/fs/nls/nls_cp862.c
new file mode 100644 (file)
index 0000000..1f50a26
--- /dev/null
@@ -0,0 +1,483 @@
+/*
+ * linux/fs/nls_cp862.c
+ *
+ * Charset cp862 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05},
+       {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05},
+       {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05},
+       {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05},
+       /* 0x90*/
+       {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05},
+       {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05},
+       {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xa5, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0x9b, 0x9c, 0x00, 0x9d, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0xaf, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x00, 0x00, /* 0xe8-0xef */
+       0x00, 0xa4, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 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] = {
+       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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 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 */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0xd0-0xd7 */
+       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] = {
+       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, 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, 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   page03, NULL,   page05, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp862",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp862(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp862();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp863.c b/fs/nls/nls_cp863.c
new file mode 100644 (file)
index 0000000..6b6c7a9
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * linux/fs/nls_cp863.c
+ *
+ * Charset cp863 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xc2, 0x00}, {0xe0, 0x00}, {0xb6, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0x17, 0x20}, {0xc0, 0x00}, {0xa7, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xc8, 0x00}, {0xca, 0x00}, {0xf4, 0x00},
+       {0xcb, 0x00}, {0xcf, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xa4, 0x00}, {0xd4, 0x00}, {0xdc, 0x00}, {0xa2, 0x00},
+       {0xa3, 0x00}, {0xd9, 0x00}, {0xdb, 0x00}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xa6, 0x00}, {0xb4, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xa8, 0x00}, {0xb8, 0x00}, {0xb3, 0x00}, {0xaf, 0x00},
+       {0xce, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xbe, 0x00}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x9b, 0x9c, 0x98, 0x00, 0xa0, 0x8f, /* 0xa0-0xa7 */
+       0xa4, 0x00, 0x00, 0xae, 0xaa, 0x00, 0x00, 0xa7, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0xa6, 0xa1, 0xe6, 0x86, 0xfa, /* 0xb0-0xb7 */
+       0xa5, 0x00, 0x00, 0xaf, 0xac, 0xab, 0xad, 0x00, /* 0xb8-0xbf */
+       0x8e, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xc0-0xc7 */
+       0x91, 0x90, 0x92, 0x94, 0x00, 0x00, 0xa8, 0x95, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0x9d, 0x00, 0x9e, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x00, 0x00, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xa2, 0x93, 0x00, 0x00, 0xf6, /* 0xf0-0xf7 */
+       0x00, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 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] = {
+       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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 0x8d, /* 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x84, 0x00, 0x86, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x94, 0x95, 0x00, 0x00, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp863",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp863(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp863();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp864.c b/fs/nls/nls_cp864.c
new file mode 100644 (file)
index 0000000..e425d5d
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * linux/fs/nls_cp864.c
+ *
+ * Charset cp864 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x6a, 0x06}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xb0, 0x00}, {0xb7, 0x00}, {0x19, 0x22}, {0x1a, 0x22},
+       {0x92, 0x25}, {0x00, 0x25}, {0x02, 0x25}, {0x3c, 0x25},
+       {0x24, 0x25}, {0x2c, 0x25}, {0x1c, 0x25}, {0x34, 0x25},
+       {0x10, 0x25}, {0x0c, 0x25}, {0x14, 0x25}, {0x18, 0x25},
+       /* 0x90*/
+       {0xb2, 0x03}, {0x1e, 0x22}, {0xc6, 0x03}, {0xb1, 0x00},
+       {0xbd, 0x00}, {0xbc, 0x00}, {0x48, 0x22}, {0xab, 0x00},
+       {0xbb, 0x00}, {0xf7, 0xfe}, {0xf8, 0xfe}, {0x00, 0x00},
+       {0x00, 0x00}, {0xfb, 0xfe}, {0xfc, 0xfe}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xad, 0x00}, {0x82, 0xfe}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0x84, 0xfe}, {0x00, 0x00}, {0x00, 0x00},
+       {0x8e, 0xfe}, {0x8f, 0xfe}, {0x95, 0xfe}, {0x99, 0xfe},
+       {0x0c, 0x06}, {0x9d, 0xfe}, {0xa1, 0xfe}, {0xa5, 0xfe},
+       /* 0xb0*/
+       {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06},
+       {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06},
+       {0x68, 0x06}, {0x69, 0x06}, {0xd1, 0xfe}, {0x1b, 0x06},
+       {0xb1, 0xfe}, {0xb5, 0xfe}, {0xb9, 0xfe}, {0x1f, 0x06},
+       /* 0xc0*/
+       {0xa2, 0x00}, {0x80, 0xfe}, {0x81, 0xfe}, {0x83, 0xfe},
+       {0x85, 0xfe}, {0xca, 0xfe}, {0x8b, 0xfe}, {0x8d, 0xfe},
+       {0x91, 0xfe}, {0x93, 0xfe}, {0x97, 0xfe}, {0x9b, 0xfe},
+       {0x9f, 0xfe}, {0xa3, 0xfe}, {0xa7, 0xfe}, {0xa9, 0xfe},
+       /* 0xd0*/
+       {0xab, 0xfe}, {0xad, 0xfe}, {0xaf, 0xfe}, {0xb3, 0xfe},
+       {0xb7, 0xfe}, {0xbb, 0xfe}, {0xbf, 0xfe}, {0xc1, 0xfe},
+       {0xc5, 0xfe}, {0xcb, 0xfe}, {0xcf, 0xfe}, {0xa6, 0x00},
+       {0xac, 0x00}, {0xf7, 0x00}, {0xd7, 0x00}, {0xc9, 0xfe},
+       /* 0xe0*/
+       {0x40, 0x06}, {0xd3, 0xfe}, {0xd7, 0xfe}, {0xdb, 0xfe},
+       {0xdf, 0xfe}, {0xe3, 0xfe}, {0xe7, 0xfe}, {0xeb, 0xfe},
+       {0xed, 0xfe}, {0xef, 0xfe}, {0xf3, 0xfe}, {0xbd, 0xfe},
+       {0xcc, 0xfe}, {0xce, 0xfe}, {0xcd, 0xfe}, {0xe1, 0xfe},
+       /* 0xf0*/
+       {0x7d, 0xfe}, {0x51, 0x06}, {0xe5, 0xfe}, {0xe9, 0xfe},
+       {0xec, 0xfe}, {0xf0, 0xfe}, {0xf2, 0xfe}, {0xd0, 0xfe},
+       {0xd5, 0xfe}, {0xf5, 0xfe}, {0xf6, 0xfe}, {0xdd, 0xfe},
+       {0xd9, 0xfe}, {0xf1, 0xfe}, {0xa0, 0x25}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x00, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0xc0, 0xa3, 0xa4, 0x00, 0xdb, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x97, 0xdc, 0xa1, 0x00, 0x00, /* 0xa8-0xaf */
+       0x80, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, /* 0xb0-0xb7 */
+       0x00, 0x00, 0x00, 0x98, 0x95, 0x94, 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, 0xde, /* 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, 0xdd, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page03[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, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 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 */
+       0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0x82, 0x83, 0x00, 0x00, 0x00, 0x91, 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 */
+       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] = {
+       0x85, 0x00, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x8c, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x8f, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x87, 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, 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] = {
+       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, 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, 0xf0, 0x00, 0x00, /* 0x78-0x7f */
+
+       0xc1, 0xc2, 0xa2, 0xc3, 0xa5, 0xc4, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0xc6, 0x00, 0xc7, 0xa8, 0xa9, /* 0x88-0x8f */
+       0x00, 0xc8, 0x00, 0xc9, 0x00, 0xaa, 0x00, 0xca, /* 0x90-0x97 */
+       0x00, 0xab, 0x00, 0xcb, 0x00, 0xad, 0x00, 0xcc, /* 0x98-0x9f */
+       0x00, 0xae, 0x00, 0xcd, 0x00, 0xaf, 0x00, 0xce, /* 0xa0-0xa7 */
+       0x00, 0xcf, 0x00, 0xd0, 0x00, 0xd1, 0x00, 0xd2, /* 0xa8-0xaf */
+       0x00, 0xbc, 0x00, 0xd3, 0x00, 0xbd, 0x00, 0xd4, /* 0xb0-0xb7 */
+       0x00, 0xbe, 0x00, 0xd5, 0x00, 0xeb, 0x00, 0xd6, /* 0xb8-0xbf */
+       0x00, 0xd7, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, /* 0xc0-0xc7 */
+       0x00, 0xdf, 0xc5, 0xd9, 0xec, 0xee, 0xed, 0xda, /* 0xc8-0xcf */
+       0xf7, 0xba, 0x00, 0xe1, 0x00, 0xf8, 0x00, 0xe2, /* 0xd0-0xd7 */
+       0x00, 0xfc, 0x00, 0xe3, 0x00, 0xfb, 0x00, 0xe4, /* 0xd8-0xdf */
+       0x00, 0xef, 0x00, 0xe5, 0x00, 0xf2, 0x00, 0xe6, /* 0xe0-0xe7 */
+       0x00, 0xf3, 0x00, 0xe7, 0xf4, 0xe8, 0x00, 0xe9, /* 0xe8-0xef */
+       0xf5, 0xfd, 0xf6, 0xea, 0x00, 0xf9, 0xfa, 0x99, /* 0xf0-0xf7 */
+       0x9a, 0x00, 0x00, 0x9d, 0x9e, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   page06, NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   page22, NULL,   NULL,   page25, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   pagefe, NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp864",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp864(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp864();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp865.c b/fs/nls/nls_cp865.c
new file mode 100644 (file)
index 0000000..7763b9d
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * linux/fs/nls_cp865.c
+ *
+ * Charset cp865 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0xc7, 0x00}, {0xfc, 0x00}, {0xe9, 0x00}, {0xe2, 0x00},
+       {0xe4, 0x00}, {0xe0, 0x00}, {0xe5, 0x00}, {0xe7, 0x00},
+       {0xea, 0x00}, {0xeb, 0x00}, {0xe8, 0x00}, {0xef, 0x00},
+       {0xee, 0x00}, {0xec, 0x00}, {0xc4, 0x00}, {0xc5, 0x00},
+       /* 0x90*/
+       {0xc9, 0x00}, {0xe6, 0x00}, {0xc6, 0x00}, {0xf4, 0x00},
+       {0xf6, 0x00}, {0xf2, 0x00}, {0xfb, 0x00}, {0xf9, 0x00},
+       {0xff, 0x00}, {0xd6, 0x00}, {0xdc, 0x00}, {0xf8, 0x00},
+       {0xa3, 0x00}, {0xd8, 0x00}, {0xa7, 0x20}, {0x92, 0x01},
+       /* 0xa0*/
+       {0xe1, 0x00}, {0xed, 0x00}, {0xf3, 0x00}, {0xfa, 0x00},
+       {0xf1, 0x00}, {0xd1, 0x00}, {0xaa, 0x00}, {0xba, 0x00},
+       {0xbf, 0x00}, {0x10, 0x23}, {0xac, 0x00}, {0xbd, 0x00},
+       {0xbc, 0x00}, {0xa1, 0x00}, {0xab, 0x00}, {0xa4, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb1, 0x03}, {0xdf, 0x00}, {0x93, 0x03}, {0xc0, 0x03},
+       {0xa3, 0x03}, {0xc3, 0x03}, {0xb5, 0x00}, {0xc4, 0x03},
+       {0xa6, 0x03}, {0x98, 0x03}, {0xa9, 0x03}, {0xb4, 0x03},
+       {0x1e, 0x22}, {0xc6, 0x03}, {0xb5, 0x03}, {0x29, 0x22},
+       /* 0xf0*/
+       {0x61, 0x22}, {0xb1, 0x00}, {0x65, 0x22}, {0x64, 0x22},
+       {0x20, 0x23}, {0x21, 0x23}, {0xf7, 0x00}, {0x48, 0x22},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x7f, 0x20}, {0xb2, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0xad, 0x00, 0x9c, 0xaf, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0xa6, 0xae, 0xaa, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xf8, 0xf1, 0xfd, 0x00, 0x00, 0xe6, 0x00, 0xfa, /* 0xb0-0xb7 */
+       0x00, 0x00, 0xa7, 0x00, 0xac, 0xab, 0x00, 0xa8, /* 0xb8-0xbf */
+       0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, 0x92, 0x80, /* 0xc0-0xc7 */
+       0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
+       0x00, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, /* 0xd0-0xd7 */
+       0x9d, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0xe1, /* 0xd8-0xdf */
+       0x85, 0xa0, 0x83, 0x00, 0x84, 0x86, 0x91, 0x87, /* 0xe0-0xe7 */
+       0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b, /* 0xe8-0xef */
+       0x00, 0xa4, 0x95, 0xa2, 0x93, 0x00, 0x94, 0xf6, /* 0xf0-0xf7 */
+       0x9b, 0x97, 0xa3, 0x96, 0x81, 0x00, 0x00, 0x98, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 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, 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] = {
+       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, 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, 0xe2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0xe8, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       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] = {
+       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, 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, 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, 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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0xf9, 0xfb, 0x00, 0x00, 0x00, 0xec, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0xef, 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 */
+       0xf7, 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, 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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, page01, NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
+       0x00, 0x99, 0x9a, 0x00, 0x9c, 0x9d, 0x9e, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0xe2, 0x00, 0xe4, 0x00, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0x00, 0xec, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0x00, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp865",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp865(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp865();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp866.c b/fs/nls/nls_cp866.c
new file mode 100644 (file)
index 0000000..985b2df
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * linux/fs/nls_cp866.c
+ *
+ * Charset cp866 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04},
+       {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04},
+       {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04},
+       /* 0x90*/
+       {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04},
+       {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04},
+       {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04},
+       {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04},
+       /* 0xa0*/
+       {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04},
+       {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04},
+       {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x61, 0x25}, {0x62, 0x25}, {0x56, 0x25},
+       {0x55, 0x25}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x5c, 0x25}, {0x5b, 0x25}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0x5e, 0x25}, {0x5f, 0x25},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0x67, 0x25},
+       /* 0xd0*/
+       {0x68, 0x25}, {0x64, 0x25}, {0x65, 0x25}, {0x59, 0x25},
+       {0x58, 0x25}, {0x52, 0x25}, {0x53, 0x25}, {0x6b, 0x25},
+       {0x6a, 0x25}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0x8c, 0x25}, {0x90, 0x25}, {0x80, 0x25},
+       /* 0xe0*/
+       {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04},
+       {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04},
+       {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04},
+       {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04},
+       /* 0xf0*/
+       {0x01, 0x04}, {0x51, 0x04}, {0x04, 0x04}, {0x54, 0x04},
+       {0x07, 0x04}, {0x57, 0x04}, {0x0e, 0x04}, {0x5e, 0x04},
+       {0xb0, 0x00}, {0x19, 0x22}, {0xb7, 0x00}, {0x1a, 0x22},
+       {0x16, 0x21}, {0xa4, 0x00}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       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] = {
+       0x00, 0xf0, 0x00, 0x00, 0xf2, 0x00, 0x00, 0xf4, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, /* 0x08-0x0f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       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] = {
+       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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
+       0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
+       0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
+       0xd0, 0xca, 0xd8, 0xd7, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, page22, NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0xf0, 0x00, 0xf2, 0x00, 0xf4, 0x00, 0xf6, 0x00, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp866",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp866(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp866();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp869.c b/fs/nls/nls_cp869.c
new file mode 100644 (file)
index 0000000..1edac6b
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_cp869.c
+ *
+ * Charset cp869 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x86, 0x03}, {0x00, 0x00},
+       {0xb7, 0x00}, {0xac, 0x00}, {0xa6, 0x00}, {0x18, 0x20},
+       {0x19, 0x20}, {0x88, 0x03}, {0x15, 0x20}, {0x89, 0x03},
+       /* 0x90*/
+       {0x8a, 0x03}, {0xaa, 0x03}, {0x8c, 0x03}, {0x00, 0x00},
+       {0x00, 0x00}, {0x8e, 0x03}, {0xab, 0x03}, {0xa9, 0x00},
+       {0x8f, 0x03}, {0xb2, 0x00}, {0xb3, 0x00}, {0xac, 0x03},
+       {0xa3, 0x00}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03},
+       /* 0xa0*/
+       {0xca, 0x03}, {0x90, 0x03}, {0xcc, 0x03}, {0xcd, 0x03},
+       {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03}, {0x94, 0x03},
+       {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03}, {0xbd, 0x00},
+       {0x98, 0x03}, {0x99, 0x03}, {0xab, 0x00}, {0xbb, 0x00},
+       /* 0xb0*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x02, 0x25},
+       {0x24, 0x25}, {0x9a, 0x03}, {0x9b, 0x03}, {0x9c, 0x03},
+       {0x9d, 0x03}, {0x63, 0x25}, {0x51, 0x25}, {0x57, 0x25},
+       {0x5d, 0x25}, {0x9e, 0x03}, {0x9f, 0x03}, {0x10, 0x25},
+       /* 0xc0*/
+       {0x14, 0x25}, {0x34, 0x25}, {0x2c, 0x25}, {0x1c, 0x25},
+       {0x00, 0x25}, {0x3c, 0x25}, {0xa0, 0x03}, {0xa1, 0x03},
+       {0x5a, 0x25}, {0x54, 0x25}, {0x69, 0x25}, {0x66, 0x25},
+       {0x60, 0x25}, {0x50, 0x25}, {0x6c, 0x25}, {0xa3, 0x03},
+       /* 0xd0*/
+       {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03},
+       {0xa8, 0x03}, {0xa9, 0x03}, {0xb1, 0x03}, {0xb2, 0x03},
+       {0xb3, 0x03}, {0x18, 0x25}, {0x0c, 0x25}, {0x88, 0x25},
+       {0x84, 0x25}, {0xb4, 0x03}, {0xb5, 0x03}, {0x80, 0x25},
+       /* 0xe0*/
+       {0xb6, 0x03}, {0xb7, 0x03}, {0xb8, 0x03}, {0xb9, 0x03},
+       {0xba, 0x03}, {0xbb, 0x03}, {0xbc, 0x03}, {0xbd, 0x03},
+       {0xbe, 0x03}, {0xbf, 0x03}, {0xc0, 0x03}, {0xc1, 0x03},
+       {0xc3, 0x03}, {0xc2, 0x03}, {0xc4, 0x03}, {0x84, 0x03},
+       /* 0xf0*/
+       {0xad, 0x00}, {0xb1, 0x00}, {0xc5, 0x03}, {0xc6, 0x03},
+       {0xc7, 0x03}, {0xa7, 0x00}, {0xc8, 0x03}, {0x85, 0x03},
+       {0xb0, 0x00}, {0xa8, 0x00}, {0xc9, 0x03}, {0xcb, 0x03},
+       {0xb0, 0x03}, {0xce, 0x03}, {0xa0, 0x25}, {0xa0, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xff, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x8a, 0xf5, /* 0xa0-0xa7 */
+       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] = {
+       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, 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, 0xef, 0xf7, 0x86, 0x00, /* 0x80-0x87 */
+       0x8d, 0x8f, 0x90, 0x00, 0x92, 0x00, 0x95, 0x98, /* 0x88-0x8f */
+       0xa1, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, /* 0x90-0x97 */
+       0xac, 0xad, 0xb5, 0xb6, 0xb7, 0xb8, 0xbd, 0xbe, /* 0x98-0x9f */
+       0xc6, 0xc7, 0x00, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, /* 0xa0-0xa7 */
+       0xd4, 0xd5, 0x91, 0x96, 0x9b, 0x9d, 0x9e, 0x9f, /* 0xa8-0xaf */
+       0xfc, 0xd6, 0xd7, 0xd8, 0xdd, 0xde, 0xe0, 0xe1, /* 0xb0-0xb7 */
+       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] = {
+       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, 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] = {
+       0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0xc5, 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 */
+       0xcd, 0xba, 0x00, 0x00, 0xc9, 0x00, 0x00, 0xbb, /* 0x50-0x57 */
+       0x00, 0x00, 0xc8, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x58-0x5f */
+       0xcc, 0x00, 0x00, 0xb9, 0x00, 0x00, 0xcb, 0x00, /* 0x60-0x67 */
+       0x00, 0xca, 0x00, 0x00, 0xce, 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 */
+
+       0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x00, 0x9c, 0x00, 0x00, 0x00, /* 0x98-0x9f */
+       0x00, 0x00, 0x00, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0x00, 0x00, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0x00, 0x00, 0x00, 0xf5, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp869",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp869(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp869();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_cp874.c b/fs/nls/nls_cp874.c
new file mode 100644 (file)
index 0000000..2635055
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_cp874.c
+ *
+ * Charset cp874 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x26, 0x20}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x18, 0x20}, {0x19, 0x20}, {0x1c, 0x20},
+       {0x1d, 0x20}, {0x22, 0x20}, {0x13, 0x20}, {0x14, 0x20},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x01, 0x0e}, {0x02, 0x0e}, {0x03, 0x0e},
+       {0x04, 0x0e}, {0x05, 0x0e}, {0x06, 0x0e}, {0x07, 0x0e},
+       {0x08, 0x0e}, {0x09, 0x0e}, {0x0a, 0x0e}, {0x0b, 0x0e},
+       {0x0c, 0x0e}, {0x0d, 0x0e}, {0x0e, 0x0e}, {0x0f, 0x0e},
+       /* 0xb0*/
+       {0x10, 0x0e}, {0x11, 0x0e}, {0x12, 0x0e}, {0x13, 0x0e},
+       {0x14, 0x0e}, {0x15, 0x0e}, {0x16, 0x0e}, {0x17, 0x0e},
+       {0x18, 0x0e}, {0x19, 0x0e}, {0x1a, 0x0e}, {0x1b, 0x0e},
+       {0x1c, 0x0e}, {0x1d, 0x0e}, {0x1e, 0x0e}, {0x1f, 0x0e},
+       /* 0xc0*/
+       {0x20, 0x0e}, {0x21, 0x0e}, {0x22, 0x0e}, {0x23, 0x0e},
+       {0x24, 0x0e}, {0x25, 0x0e}, {0x26, 0x0e}, {0x27, 0x0e},
+       {0x28, 0x0e}, {0x29, 0x0e}, {0x2a, 0x0e}, {0x2b, 0x0e},
+       {0x2c, 0x0e}, {0x2d, 0x0e}, {0x2e, 0x0e}, {0x2f, 0x0e},
+       /* 0xd0*/
+       {0x30, 0x0e}, {0x31, 0x0e}, {0x32, 0x0e}, {0x33, 0x0e},
+       {0x34, 0x0e}, {0x35, 0x0e}, {0x36, 0x0e}, {0x37, 0x0e},
+       {0x38, 0x0e}, {0x39, 0x0e}, {0x3a, 0x0e}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x3f, 0x0e},
+       /* 0xe0*/
+       {0x40, 0x0e}, {0x41, 0x0e}, {0x42, 0x0e}, {0x43, 0x0e},
+       {0x44, 0x0e}, {0x45, 0x0e}, {0x46, 0x0e}, {0x47, 0x0e},
+       {0x48, 0x0e}, {0x49, 0x0e}, {0x4a, 0x0e}, {0x4b, 0x0e},
+       {0x4c, 0x0e}, {0x4d, 0x0e}, {0x4e, 0x0e}, {0x4f, 0x0e},
+       /* 0xf0*/
+       {0x50, 0x0e}, {0x51, 0x0e}, {0x52, 0x0e}, {0x53, 0x0e},
+       {0x54, 0x0e}, {0x55, 0x0e}, {0x56, 0x0e}, {0x57, 0x0e},
+       {0x58, 0x0e}, {0x59, 0x0e}, {0x5a, 0x0e}, {0x5b, 0x0e},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       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] = {
+       0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x08-0x0f */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0xdf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       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] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   page0e, NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "cp874",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_cp874(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_cp874();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-1.c b/fs/nls/nls_iso8859-1.c
new file mode 100644 (file)
index 0000000..3b32a70
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * linux/fs/nls_iso8859-1.c
+ *
+ * Charset iso8859-1 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0xd0, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0xde, 0x00}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0xf0, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0xfe, 0x00}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char *page_uni2charset[256] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 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, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-1",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_1(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_1();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-2.c b/fs/nls/nls_iso8859-2.c
new file mode 100644 (file)
index 0000000..b21961b
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-2.c
+ *
+ * Charset iso8859-2 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x04, 0x01}, {0xd8, 0x02}, {0x41, 0x01},
+       {0xa4, 0x00}, {0x3d, 0x01}, {0x5a, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x60, 0x01}, {0x5e, 0x01}, {0x64, 0x01},
+       {0x79, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0x7b, 0x01},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x42, 0x01},
+       {0xb4, 0x00}, {0x3e, 0x01}, {0x5b, 0x01}, {0xc7, 0x02},
+       {0xb8, 0x00}, {0x61, 0x01}, {0x5f, 0x01}, {0x65, 0x01},
+       {0x7a, 0x01}, {0xdd, 0x02}, {0x7e, 0x01}, {0x7c, 0x01},
+       /* 0xc0*/
+       {0x54, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0x02, 0x01},
+       {0xc4, 0x00}, {0x39, 0x01}, {0x06, 0x01}, {0xc7, 0x00},
+       {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00},
+       {0x1a, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x0e, 0x01},
+       /* 0xd0*/
+       {0x10, 0x01}, {0x43, 0x01}, {0x47, 0x01}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0x50, 0x01}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0x58, 0x01}, {0x6e, 0x01}, {0xda, 0x00}, {0x70, 0x01},
+       {0xdc, 0x00}, {0xdd, 0x00}, {0x62, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0x55, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0x03, 0x01},
+       {0xe4, 0x00}, {0x3a, 0x01}, {0x07, 0x01}, {0xe7, 0x00},
+       {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00},
+       {0x1b, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x0f, 0x01},
+       /* 0xf0*/
+       {0x11, 0x01}, {0x44, 0x01}, {0x48, 0x01}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0x51, 0x01}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0x59, 0x01}, {0x6f, 0x01}, {0xfa, 0x00}, {0x71, 0x01},
+       {0xfc, 0x00}, {0xfd, 0x00}, {0x63, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0x00, 0xda, 0x00, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */
+       0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0xfa, 0x00, 0xfc, 0xfd, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0xc3, 0xe3, 0xa1, 0xb1, 0xc6, 0xe6, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0xcf, 0xef, /* 0x08-0x0f */
+       0xd0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0xca, 0xea, 0xcc, 0xec, 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, 0xc5, 0xe5, 0x00, 0x00, 0xa5, 0xb5, 0x00, /* 0x38-0x3f */
+       0x00, 0xa3, 0xb3, 0xd1, 0xf1, 0x00, 0x00, 0xd2, /* 0x40-0x47 */
+       0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
+       0xd5, 0xf5, 0x00, 0x00, 0xc0, 0xe0, 0x00, 0x00, /* 0x50-0x57 */
+       0xd8, 0xf8, 0xa6, 0xb6, 0x00, 0x00, 0xaa, 0xba, /* 0x58-0x5f */
+       0xa9, 0xb9, 0xde, 0xfe, 0xab, 0xbb, 0x00, 0x00, /* 0x60-0x67 */
+       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] = {
+       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, 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, 0xb7, /* 0xc0-0xc7 */
+       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] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 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, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-2",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_2(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_2();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-3.c b/fs/nls/nls_iso8859-3.c
new file mode 100644 (file)
index 0000000..d5d7f7f
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-3.c
+ *
+ * Charset iso8859-3 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x26, 0x01}, {0xd8, 0x02}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0x00, 0x00}, {0x24, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0x1e, 0x01},
+       {0x34, 0x01}, {0xad, 0x00}, {0x00, 0x00}, {0x7b, 0x01},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x27, 0x01}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0x25, 0x01}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0x1f, 0x01},
+       {0x35, 0x01}, {0xbd, 0x00}, {0x00, 0x00}, {0x7c, 0x01},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0x00, 0x00},
+       {0xc4, 0x00}, {0x0a, 0x01}, {0x08, 0x01}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0x00, 0x00}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0x20, 0x01}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0x1c, 0x01}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x6c, 0x01}, {0x5c, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0x00, 0x00},
+       {0xe4, 0x00}, {0x0b, 0x01}, {0x09, 0x01}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0x00, 0x00}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0x21, 0x01}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0x1d, 0x01}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x6d, 0x01}, {0x5d, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0x00, 0xa3, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0x00, 0xc4, 0x00, 0x00, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0x00, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0x00, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0x00, 0x00, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0xc6, 0xe6, 0xc5, 0xe5, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0xd8, 0xf8, 0xab, 0xbb, /* 0x18-0x1f */
+       0xd5, 0xf5, 0x00, 0x00, 0xa6, 0xb6, 0xa1, 0xb1, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0xa9, 0xb9, 0x00, 0x00, 0xac, 0xbc, 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, 0xde, 0xfe, 0xaa, 0xba, /* 0x58-0x5f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
+       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] = {
+       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, 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 */
+       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] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0xb3, 0xb4, 0xb5, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbe, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x00, /* 0xd8-0xdf */
+       0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
+       0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-3",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_3(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_3();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-4.c b/fs/nls/nls_iso8859-4.c
new file mode 100644 (file)
index 0000000..f03aaaa
--- /dev/null
@@ -0,0 +1,299 @@
+/*
+ * linux/fs/nls_iso8859-4.c
+ *
+ * Charset iso8859-4 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x04, 0x01}, {0x38, 0x01}, {0x56, 0x01},
+       {0xa4, 0x00}, {0x28, 0x01}, {0x3b, 0x01}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0x60, 0x01}, {0x12, 0x01}, {0x22, 0x01},
+       {0x66, 0x01}, {0xad, 0x00}, {0x7d, 0x01}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0x05, 0x01}, {0xdb, 0x02}, {0x57, 0x01},
+       {0xb4, 0x00}, {0x29, 0x01}, {0x3c, 0x01}, {0xc7, 0x02},
+       {0xb8, 0x00}, {0x61, 0x01}, {0x13, 0x01}, {0x23, 0x01},
+       {0x67, 0x01}, {0x4a, 0x01}, {0x7e, 0x01}, {0x4b, 0x01},
+       /* 0xc0*/
+       {0x00, 0x01}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0x2e, 0x01},
+       {0x0c, 0x01}, {0xc9, 0x00}, {0x18, 0x01}, {0xcb, 0x00},
+       {0x16, 0x01}, {0xcd, 0x00}, {0xce, 0x00}, {0x2a, 0x01},
+       /* 0xd0*/
+       {0x10, 0x01}, {0x45, 0x01}, {0x4c, 0x01}, {0x36, 0x01},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0x72, 0x01}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x68, 0x01}, {0x6a, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0x01, 0x01}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0x2f, 0x01},
+       {0x0d, 0x01}, {0xe9, 0x00}, {0x19, 0x01}, {0xeb, 0x00},
+       {0x17, 0x01}, {0xed, 0x00}, {0xee, 0x00}, {0x2b, 0x01},
+       /* 0xf0*/
+       {0x11, 0x01}, {0x46, 0x01}, {0x4d, 0x01}, {0x37, 0x01},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0x73, 0x01}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x69, 0x01}, {0x6b, 0x01}, {0xd9, 0x02},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0x00, /* 0xc0-0xc7 */
+       0x00, 0xc9, 0x00, 0xcb, 0x00, 0xcd, 0xce, 0x00, /* 0xc8-0xcf */
+       0x00, 0x00, 0x00, 0x00, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0x00, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0x00, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x00, /* 0xe0-0xe7 */
+       0x00, 0xe9, 0x00, 0xeb, 0x00, 0xed, 0xee, 0x00, /* 0xe8-0xef */
+       0x00, 0x00, 0x00, 0x00, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0x00, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page01[256] = {
+       0xc0, 0xe0, 0x00, 0x00, 0xa1, 0xb1, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xc8, 0xe8, 0x00, 0x00, /* 0x08-0x0f */
+       0xd0, 0xf0, 0xaa, 0xba, 0x00, 0x00, 0xcc, 0xec, /* 0x10-0x17 */
+       0xca, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0xab, 0xbb, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0xa5, 0xb5, 0xcf, 0xef, 0x00, 0x00, 0xc7, 0xe7, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0xf3, /* 0x30-0x37 */
+       0xa2, 0x00, 0x00, 0xa6, 0xb6, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xd1, 0xf1, 0x00, /* 0x40-0x47 */
+       0x00, 0x00, 0xbd, 0xbf, 0xd2, 0xf2, 0x00, 0x00, /* 0x48-0x4f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0xb3, /* 0x50-0x57 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
+       0xa9, 0xb9, 0x00, 0x00, 0x00, 0x00, 0xac, 0xbc, /* 0x60-0x67 */
+       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] = {
+       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, 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, 0xb7, /* 0xc0-0xc7 */
+       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] = {
+       page00, page01, page02, NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0x00, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0x00, 0xb2, 0x00, 0xb4, 0x00, 0x00, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0x00, 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 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, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-4",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_4(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_4();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-5.c b/fs/nls/nls_iso8859-5.c
new file mode 100644 (file)
index 0000000..94bece0
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_iso8859-5.c
+ *
+ * Charset iso8859-5 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x01, 0x04}, {0x02, 0x04}, {0x03, 0x04},
+       {0x04, 0x04}, {0x05, 0x04}, {0x06, 0x04}, {0x07, 0x04},
+       {0x08, 0x04}, {0x09, 0x04}, {0x0a, 0x04}, {0x0b, 0x04},
+       {0x0c, 0x04}, {0xad, 0x00}, {0x0e, 0x04}, {0x0f, 0x04},
+       /* 0xb0*/
+       {0x10, 0x04}, {0x11, 0x04}, {0x12, 0x04}, {0x13, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x16, 0x04}, {0x17, 0x04},
+       {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04}, {0x1b, 0x04},
+       {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04}, {0x1f, 0x04},
+       /* 0xc0*/
+       {0x20, 0x04}, {0x21, 0x04}, {0x22, 0x04}, {0x23, 0x04},
+       {0x24, 0x04}, {0x25, 0x04}, {0x26, 0x04}, {0x27, 0x04},
+       {0x28, 0x04}, {0x29, 0x04}, {0x2a, 0x04}, {0x2b, 0x04},
+       {0x2c, 0x04}, {0x2d, 0x04}, {0x2e, 0x04}, {0x2f, 0x04},
+       /* 0xd0*/
+       {0x30, 0x04}, {0x31, 0x04}, {0x32, 0x04}, {0x33, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x36, 0x04}, {0x37, 0x04},
+       {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04}, {0x3b, 0x04},
+       {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04}, {0x3f, 0x04},
+       /* 0xe0*/
+       {0x40, 0x04}, {0x41, 0x04}, {0x42, 0x04}, {0x43, 0x04},
+       {0x44, 0x04}, {0x45, 0x04}, {0x46, 0x04}, {0x47, 0x04},
+       {0x48, 0x04}, {0x49, 0x04}, {0x4a, 0x04}, {0x4b, 0x04},
+       {0x4c, 0x04}, {0x4d, 0x04}, {0x4e, 0x04}, {0x4f, 0x04},
+       /* 0xf0*/
+       {0x16, 0x21}, {0x51, 0x04}, {0x52, 0x04}, {0x53, 0x04},
+       {0x54, 0x04}, {0x55, 0x04}, {0x56, 0x04}, {0x57, 0x04},
+       {0x58, 0x04}, {0x59, 0x04}, {0x5a, 0x04}, {0x5b, 0x04},
+       {0x5c, 0x04}, {0xa7, 0x00}, {0x5e, 0x04}, {0x5f, 0x04},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       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] = {
+       0x00, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x00-0x07 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0x00, 0xae, 0xaf, /* 0x08-0x0f */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0x10-0x17 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0x18-0x1f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       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] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   page21, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 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 */
+       0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-5",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_5(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_5();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-6.c b/fs/nls/nls_iso8859-6.c
new file mode 100644 (file)
index 0000000..050aee9
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * linux/fs/nls_iso8859-6.c
+ *
+ * Charset iso8859-6 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x60, 0x06}, {0x61, 0x06}, {0x62, 0x06}, {0x63, 0x06},
+       {0x64, 0x06}, {0x65, 0x06}, {0x66, 0x06}, {0x67, 0x06},
+       {0x68, 0x06}, {0x69, 0x06}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0xa4, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x0c, 0x06}, {0xad, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xb0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1b, 0x06},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x1f, 0x06},
+       /* 0xc0*/
+       {0x00, 0x00}, {0x21, 0x06}, {0x22, 0x06}, {0x23, 0x06},
+       {0x24, 0x06}, {0x25, 0x06}, {0x26, 0x06}, {0x27, 0x06},
+       {0x28, 0x06}, {0x29, 0x06}, {0x2a, 0x06}, {0x2b, 0x06},
+       {0x2c, 0x06}, {0x2d, 0x06}, {0x2e, 0x06}, {0x2f, 0x06},
+       /* 0xd0*/
+       {0x30, 0x06}, {0x31, 0x06}, {0x32, 0x06}, {0x33, 0x06},
+       {0x34, 0x06}, {0x35, 0x06}, {0x36, 0x06}, {0x37, 0x06},
+       {0x38, 0x06}, {0x39, 0x06}, {0x3a, 0x06}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xe0*/
+       {0x40, 0x06}, {0x41, 0x06}, {0x42, 0x06}, {0x43, 0x06},
+       {0x44, 0x06}, {0x45, 0x06}, {0x46, 0x06}, {0x47, 0x06},
+       {0x48, 0x06}, {0x49, 0x06}, {0x4a, 0x06}, {0x4b, 0x06},
+       {0x4c, 0x06}, {0x4d, 0x06}, {0x4e, 0x06}, {0x4f, 0x06},
+       /* 0xf0*/
+       {0x50, 0x06}, {0x51, 0x06}, {0x52, 0x06}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       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] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0xbb, 0x00, 0x00, 0x00, 0xbf, /* 0x18-0x1f */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x20-0x27 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x28-0x2f */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0x30-0x37 */
+       0xd8, 0xd9, 0xda, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
+       0xf0, 0xf1, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
+       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] = {
+       page00, NULL,   NULL,   NULL,   NULL,   NULL,   page06, NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-6",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_6(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_6();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-7.c b/fs/nls/nls_iso8859-7.c
new file mode 100644 (file)
index 0000000..3790378
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * linux/fs/nls_iso8859-7.c
+ *
+ * Charset iso8859-7 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xbd, 0x02}, {0xbc, 0x02}, {0xa3, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0x00, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0x00, 0x00}, {0x15, 0x20},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0x84, 0x03}, {0x85, 0x03}, {0x86, 0x03}, {0xb7, 0x00},
+       {0x88, 0x03}, {0x89, 0x03}, {0x8a, 0x03}, {0xbb, 0x00},
+       {0x8c, 0x03}, {0xbd, 0x00}, {0x8e, 0x03}, {0x8f, 0x03},
+       /* 0xc0*/
+       {0x90, 0x03}, {0x91, 0x03}, {0x92, 0x03}, {0x93, 0x03},
+       {0x94, 0x03}, {0x95, 0x03}, {0x96, 0x03}, {0x97, 0x03},
+       {0x98, 0x03}, {0x99, 0x03}, {0x9a, 0x03}, {0x9b, 0x03},
+       {0x9c, 0x03}, {0x9d, 0x03}, {0x9e, 0x03}, {0x9f, 0x03},
+       /* 0xd0*/
+       {0xa0, 0x03}, {0xa1, 0x03}, {0x00, 0x00}, {0xa3, 0x03},
+       {0xa4, 0x03}, {0xa5, 0x03}, {0xa6, 0x03}, {0xa7, 0x03},
+       {0xa8, 0x03}, {0xa9, 0x03}, {0xaa, 0x03}, {0xab, 0x03},
+       {0xac, 0x03}, {0xad, 0x03}, {0xae, 0x03}, {0xaf, 0x03},
+       /* 0xe0*/
+       {0xb0, 0x03}, {0xb1, 0x03}, {0xb2, 0x03}, {0xb3, 0x03},
+       {0xb4, 0x03}, {0xb5, 0x03}, {0xb6, 0x03}, {0xb7, 0x03},
+       {0xb8, 0x03}, {0xb9, 0x03}, {0xba, 0x03}, {0xbb, 0x03},
+       {0xbc, 0x03}, {0xbd, 0x03}, {0xbe, 0x03}, {0xbf, 0x03},
+       /* 0xf0*/
+       {0xc0, 0x03}, {0xc1, 0x03}, {0xc2, 0x03}, {0xc3, 0x03},
+       {0xc4, 0x03}, {0xc5, 0x03}, {0xc6, 0x03}, {0xc7, 0x03},
+       {0xc8, 0x03}, {0xc9, 0x03}, {0xca, 0x03}, {0xcb, 0x03},
+       {0xcc, 0x03}, {0xcd, 0x03}, {0xce, 0x03}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       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] = {
+       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, 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, 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] = {
+       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, 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, 0xb4, 0xb5, 0xb6, 0x00, /* 0x80-0x87 */
+       0xb8, 0xb9, 0xba, 0x00, 0xbc, 0x00, 0xbe, 0xbf, /* 0x88-0x8f */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0x90-0x97 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0x98-0x9f */
+       0xd0, 0xd1, 0x00, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xa0-0xa7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xa8-0xaf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xb0-0xb7 */
+       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] = {
+       page00, NULL,   page02, page03, NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0x00, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 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, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-7",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_7(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_7();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-8.c b/fs/nls/nls_iso8859-8.c
new file mode 100644 (file)
index 0000000..b639b73
--- /dev/null
@@ -0,0 +1,303 @@
+/*
+ * linux/fs/nls_iso8859-8.c
+ *
+ * Charset iso8859-8 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0x00, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xd7, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0x3e, 0x20},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xf7, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0x00, 0x00},
+       /* 0xc0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xd0*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x17, 0x20},
+       /* 0xe0*/
+       {0xd0, 0x05}, {0xd1, 0x05}, {0xd2, 0x05}, {0xd3, 0x05},
+       {0xd4, 0x05}, {0xd5, 0x05}, {0xd6, 0x05}, {0xd7, 0x05},
+       {0xd8, 0x05}, {0xd9, 0x05}, {0xda, 0x05}, {0xdb, 0x05},
+       {0xdc, 0x05}, {0xdd, 0x05}, {0xde, 0x05}, {0xdf, 0x05},
+       /* 0xf0*/
+       {0xe0, 0x05}, {0xe1, 0x05}, {0xe2, 0x05}, {0xe3, 0x05},
+       {0xe4, 0x05}, {0xe5, 0x05}, {0xe6, 0x05}, {0xe7, 0x05},
+       {0xe8, 0x05}, {0xe9, 0x05}, {0xea, 0x05}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0x00, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0x00, 0xab, 0xac, 0xad, 0xae, 0x00, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0x00, 0xbb, 0xbc, 0xbd, 0xbe, 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, 0xaa, /* 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, 0xba, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page05[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, 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 */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xd0-0xd7 */
+       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] = {
+       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, 0xdf, /* 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, 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] = {
+       page00, NULL,   NULL,   NULL,   NULL,   page05, NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       page20, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-8",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_8(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_8();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_iso8859-9.c b/fs/nls/nls_iso8859-9.c
new file mode 100644 (file)
index 0000000..aef5b41
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * linux/fs/nls_iso8859-9.c
+ *
+ * Charset iso8859-9 translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0x90*/
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00},
+       /* 0xa0*/
+       {0xa0, 0x00}, {0xa1, 0x00}, {0xa2, 0x00}, {0xa3, 0x00},
+       {0xa4, 0x00}, {0xa5, 0x00}, {0xa6, 0x00}, {0xa7, 0x00},
+       {0xa8, 0x00}, {0xa9, 0x00}, {0xaa, 0x00}, {0xab, 0x00},
+       {0xac, 0x00}, {0xad, 0x00}, {0xae, 0x00}, {0xaf, 0x00},
+       /* 0xb0*/
+       {0xb0, 0x00}, {0xb1, 0x00}, {0xb2, 0x00}, {0xb3, 0x00},
+       {0xb4, 0x00}, {0xb5, 0x00}, {0xb6, 0x00}, {0xb7, 0x00},
+       {0xb8, 0x00}, {0xb9, 0x00}, {0xba, 0x00}, {0xbb, 0x00},
+       {0xbc, 0x00}, {0xbd, 0x00}, {0xbe, 0x00}, {0xbf, 0x00},
+       /* 0xc0*/
+       {0xc0, 0x00}, {0xc1, 0x00}, {0xc2, 0x00}, {0xc3, 0x00},
+       {0xc4, 0x00}, {0xc5, 0x00}, {0xc6, 0x00}, {0xc7, 0x00},
+       {0xc8, 0x00}, {0xc9, 0x00}, {0xca, 0x00}, {0xcb, 0x00},
+       {0xcc, 0x00}, {0xcd, 0x00}, {0xce, 0x00}, {0xcf, 0x00},
+       /* 0xd0*/
+       {0x1e, 0x01}, {0xd1, 0x00}, {0xd2, 0x00}, {0xd3, 0x00},
+       {0xd4, 0x00}, {0xd5, 0x00}, {0xd6, 0x00}, {0xd7, 0x00},
+       {0xd8, 0x00}, {0xd9, 0x00}, {0xda, 0x00}, {0xdb, 0x00},
+       {0xdc, 0x00}, {0x30, 0x01}, {0x5e, 0x01}, {0xdf, 0x00},
+       /* 0xe0*/
+       {0xe0, 0x00}, {0xe1, 0x00}, {0xe2, 0x00}, {0xe3, 0x00},
+       {0xe4, 0x00}, {0xe5, 0x00}, {0xe6, 0x00}, {0xe7, 0x00},
+       {0xe8, 0x00}, {0xe9, 0x00}, {0xea, 0x00}, {0xeb, 0x00},
+       {0xec, 0x00}, {0xed, 0x00}, {0xee, 0x00}, {0xef, 0x00},
+       /* 0xf0*/
+       {0x1f, 0x01}, {0xf1, 0x00}, {0xf2, 0x00}, {0xf3, 0x00},
+       {0xf4, 0x00}, {0xf5, 0x00}, {0xf6, 0x00}, {0xf7, 0x00},
+       {0xf8, 0x00}, {0xf9, 0x00}, {0xfa, 0x00}, {0xfb, 0x00},
+       {0xfc, 0x00}, {0x31, 0x01}, {0x5f, 0x01}, {0xff, 0x00},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf, /* 0xd8-0xdf */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff, /* 0xf8-0xff */
+};
+
+static unsigned char page01[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, 0x00, /* 0x10-0x17 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0xdd, 0xfd, 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, 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] = {
+       page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 0xb8-0xbf */
+       0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */
+       0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */
+       0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0-0xd7 */
+       0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 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, 0xf7, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "iso8859-9",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_iso8859_9(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_iso8859_9();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
diff --git a/fs/nls/nls_koi8-r.c b/fs/nls/nls_koi8-r.c
new file mode 100644 (file)
index 0000000..8d08ba3
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * linux/fs/nls_koi8-r.c
+ *
+ * Charset koi8-r translation tables.
+ * Generated automatically from the Unicode and charset
+ * tables from the Unicode Organization (www.unicode.org).
+ * The Unicode to charset table has only exact mappings.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+
+static struct nls_unicode charset2uni[256] = {
+       /* 0x00*/
+       {0x00, 0x00}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x00},
+       {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x00},
+       {0x08, 0x00}, {0x09, 0x00}, {0x0a, 0x00}, {0x0b, 0x00},
+       {0x0c, 0x00}, {0x0d, 0x00}, {0x0e, 0x00}, {0x0f, 0x00},
+       /* 0x10*/
+       {0x10, 0x00}, {0x11, 0x00}, {0x12, 0x00}, {0x13, 0x00},
+       {0x14, 0x00}, {0x15, 0x00}, {0x16, 0x00}, {0x17, 0x00},
+       {0x18, 0x00}, {0x19, 0x00}, {0x1a, 0x00}, {0x1b, 0x00},
+       {0x1c, 0x00}, {0x1d, 0x00}, {0x1e, 0x00}, {0x1f, 0x00},
+       /* 0x20*/
+       {0x20, 0x00}, {0x21, 0x00}, {0x22, 0x00}, {0x23, 0x00},
+       {0x24, 0x00}, {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00},
+       {0x28, 0x00}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0x00},
+       {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00},
+       /* 0x30*/
+       {0x30, 0x00}, {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00},
+       {0x34, 0x00}, {0x35, 0x00}, {0x36, 0x00}, {0x37, 0x00},
+       {0x38, 0x00}, {0x39, 0x00}, {0x3a, 0x00}, {0x3b, 0x00},
+       {0x3c, 0x00}, {0x3d, 0x00}, {0x3e, 0x00}, {0x3f, 0x00},
+       /* 0x40*/
+       {0x40, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x43, 0x00},
+       {0x44, 0x00}, {0x45, 0x00}, {0x46, 0x00}, {0x47, 0x00},
+       {0x48, 0x00}, {0x49, 0x00}, {0x4a, 0x00}, {0x4b, 0x00},
+       {0x4c, 0x00}, {0x4d, 0x00}, {0x4e, 0x00}, {0x4f, 0x00},
+       /* 0x50*/
+       {0x50, 0x00}, {0x51, 0x00}, {0x52, 0x00}, {0x53, 0x00},
+       {0x54, 0x00}, {0x55, 0x00}, {0x56, 0x00}, {0x57, 0x00},
+       {0x58, 0x00}, {0x59, 0x00}, {0x5a, 0x00}, {0x5b, 0x00},
+       {0x5c, 0x00}, {0x5d, 0x00}, {0x5e, 0x00}, {0x5f, 0x00},
+       /* 0x60*/
+       {0x60, 0x00}, {0x61, 0x00}, {0x62, 0x00}, {0x63, 0x00},
+       {0x64, 0x00}, {0x65, 0x00}, {0x66, 0x00}, {0x67, 0x00},
+       {0x68, 0x00}, {0x69, 0x00}, {0x6a, 0x00}, {0x6b, 0x00},
+       {0x6c, 0x00}, {0x6d, 0x00}, {0x6e, 0x00}, {0x6f, 0x00},
+       /* 0x70*/
+       {0x70, 0x00}, {0x71, 0x00}, {0x72, 0x00}, {0x73, 0x00},
+       {0x74, 0x00}, {0x75, 0x00}, {0x76, 0x00}, {0x77, 0x00},
+       {0x78, 0x00}, {0x79, 0x00}, {0x7a, 0x00}, {0x7b, 0x00},
+       {0x7c, 0x00}, {0x7d, 0x00}, {0x7e, 0x00}, {0x7f, 0x00},
+       /* 0x80*/
+       {0x00, 0x25}, {0x02, 0x25}, {0x0c, 0x25}, {0x10, 0x25},
+       {0x14, 0x25}, {0x18, 0x25}, {0x1c, 0x25}, {0x24, 0x25},
+       {0x2c, 0x25}, {0x34, 0x25}, {0x3c, 0x25}, {0x80, 0x25},
+       {0x84, 0x25}, {0x88, 0x25}, {0x8c, 0x25}, {0x90, 0x25},
+       /* 0x90*/
+       {0x91, 0x25}, {0x92, 0x25}, {0x93, 0x25}, {0x20, 0x23},
+       {0xa0, 0x25}, {0x19, 0x22}, {0x1a, 0x22}, {0x48, 0x22},
+       {0x64, 0x22}, {0x65, 0x22}, {0xa0, 0x00}, {0x21, 0x23},
+       {0xb0, 0x00}, {0xb2, 0x00}, {0xb7, 0x00}, {0xf7, 0x00},
+       /* 0xa0*/
+       {0x50, 0x25}, {0x51, 0x25}, {0x52, 0x25}, {0x51, 0x04},
+       {0x53, 0x25}, {0x54, 0x25}, {0x55, 0x25}, {0x56, 0x25},
+       {0x57, 0x25}, {0x58, 0x25}, {0x59, 0x25}, {0x5a, 0x25},
+       {0x5b, 0x25}, {0x5c, 0x25}, {0x5d, 0x25}, {0x5e, 0x25},
+       /* 0xb0*/
+       {0x5f, 0x25}, {0x60, 0x25}, {0x61, 0x25}, {0x01, 0x04},
+       {0x62, 0x25}, {0x63, 0x25}, {0x64, 0x25}, {0x65, 0x25},
+       {0x66, 0x25}, {0x67, 0x25}, {0x68, 0x25}, {0x69, 0x25},
+       {0x6a, 0x25}, {0x6b, 0x25}, {0x6c, 0x25}, {0xa9, 0x00},
+       /* 0xc0*/
+       {0x4e, 0x04}, {0x30, 0x04}, {0x31, 0x04}, {0x46, 0x04},
+       {0x34, 0x04}, {0x35, 0x04}, {0x44, 0x04}, {0x33, 0x04},
+       {0x45, 0x04}, {0x38, 0x04}, {0x39, 0x04}, {0x3a, 0x04},
+       {0x3b, 0x04}, {0x3c, 0x04}, {0x3d, 0x04}, {0x3e, 0x04},
+       /* 0xd0*/
+       {0x3f, 0x04}, {0x4f, 0x04}, {0x40, 0x04}, {0x41, 0x04},
+       {0x42, 0x04}, {0x43, 0x04}, {0x36, 0x04}, {0x32, 0x04},
+       {0x4c, 0x04}, {0x4b, 0x04}, {0x37, 0x04}, {0x48, 0x04},
+       {0x4d, 0x04}, {0x49, 0x04}, {0x47, 0x04}, {0x4a, 0x04},
+       /* 0xe0*/
+       {0x2e, 0x04}, {0x10, 0x04}, {0x11, 0x04}, {0x26, 0x04},
+       {0x14, 0x04}, {0x15, 0x04}, {0x24, 0x04}, {0x13, 0x04},
+       {0x25, 0x04}, {0x18, 0x04}, {0x19, 0x04}, {0x1a, 0x04},
+       {0x1b, 0x04}, {0x1c, 0x04}, {0x1d, 0x04}, {0x1e, 0x04},
+       /* 0xf0*/
+       {0x1f, 0x04}, {0x2f, 0x04}, {0x20, 0x04}, {0x21, 0x04},
+       {0x22, 0x04}, {0x23, 0x04}, {0x16, 0x04}, {0x12, 0x04},
+       {0x2c, 0x04}, {0x2b, 0x04}, {0x17, 0x04}, {0x28, 0x04},
+       {0x2d, 0x04}, {0x29, 0x04}, {0x27, 0x04}, {0x2a, 0x04},
+};
+
+static unsigned char page00[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
+       0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
+       0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
+       0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 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 */
+       0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
+       0x00, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
+       0x9c, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x00, 0x9e, /* 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, 0x9f, /* 0xf0-0xf7 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
+};
+
+static unsigned char page04[256] = {
+       0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */
+       0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, /* 0x18-0x1f */
+       0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe, /* 0x20-0x27 */
+       0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1, /* 0x28-0x2f */
+       0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0x30-0x37 */
+       0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, /* 0x38-0x3f */
+       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] = {
+       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, 0x00, /* 0x10-0x17 */
+       0x00, 0x95, 0x96, 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 */
+       0x97, 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, 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] = {
+       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, 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] = {
+       0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
+       0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */
+       0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */
+       0x85, 0x00, 0x00, 0x00, 0x86, 0x00, 0x00, 0x00, /* 0x18-0x1f */
+       0x00, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, /* 0x20-0x27 */
+       0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, /* 0x28-0x2f */
+       0x00, 0x00, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */
+       0x00, 0x00, 0x00, 0x00, 0x8a, 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 */
+       0xa0, 0xa1, 0xa2, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, /* 0x50-0x57 */
+       0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, /* 0x58-0x5f */
+       0xb1, 0xb2, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, /* 0x60-0x67 */
+       0xba, 0xbb, 0xbc, 0xbd, 0xbe, 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 */
+
+       0x8b, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, /* 0x80-0x87 */
+       0x8d, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, /* 0x88-0x8f */
+       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] = {
+       page00, NULL,   NULL,   NULL,   page04, NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   
+       NULL,   NULL,   page22, page23, NULL,   page25, NULL,   NULL,   
+};
+
+static unsigned char charset2upper[256] = {
+       0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
+       0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
+       0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
+       0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
+       0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
+       0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
+       0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
+       0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
+       0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
+       0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
+       0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
+       0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
+       0x60, 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, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
+       0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80-0x87 */
+       0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x88-0x8f */
+       0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90-0x97 */
+       0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x98-0x9f */
+       0xa0, 0xa1, 0xa2, 0x00, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0-0xa7 */
+       0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0xa8-0xaf */
+       0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0-0xb7 */
+       0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, /* 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 */
+       0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */
+       0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */
+       0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0-0xf7 */
+       0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */
+};
+
+
+static void inc_use_count(void)
+{
+       MOD_INC_USE_COUNT;
+}
+
+static void dec_use_count(void)
+{
+       MOD_DEC_USE_COUNT;
+}
+
+static struct nls_table table = {
+       "koi8-r",
+       page_uni2charset,
+       charset2uni,
+       inc_use_count,
+       dec_use_count,
+       NULL
+};
+
+int init_nls_koi8_r(void)
+{
+       return register_nls(&table);
+}
+
+#ifdef MODULE
+int init_module(void)
+{
+       return init_nls_koi8_r();
+}
+
+
+void cleanup_module(void)
+{
+       unregister_nls(&table);
+       return;
+}
+#endif
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only.  This must remain at the end
+ * of the file.
+ * ---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */
index 35cb232..8c476c3 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
 /* in case of paging and multiple read/write on the same pipe. (FGC)         */
 
 
-static long pipe_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t pipe_read(struct file * filp, char * buf,
+                        size_t count, loff_t *ppos)
 {
-       int chars = 0, size = 0, read = 0;
+       struct inode * inode = filp->f_dentry->d_inode;
+       ssize_t chars = 0, size = 0, read = 0;
         char *pipebuf;
 
+       if (ppos != &filp->f_pos)
+               return -ESPIPE;
+
        if (filp->f_flags & O_NONBLOCK) {
                if (PIPE_LOCK(*inode))
                        return -EAGAIN;
@@ -83,17+87,21 @@ static long pipe_read(struct inode * inode, struct file * filp,
        return 0;
 }
        
-static long pipe_write(struct inode * inode, struct file * filp,
-       const char * buf, unsigned long count)
+static ssize_t pipe_write(struct file * filp, const char * buf,
+                         size_t count, loff_t *ppos)
 {
-       int chars = 0, free = 0, written = 0;
+       struct inode * inode = filp->f_dentry->d_inode;
+       ssize_t chars = 0, free = 0, written = 0;
        char *pipebuf;
 
+       if (ppos != &filp->f_pos)
+               return -ESPIPE;
+
        if (!PIPE_READERS(*inode)) { /* no readers */
                send_sig(SIGPIPE,current,0);
                return -EPIPE;
        }
-/* if count <= PIPE_BUF, we have to make it atomic */
+       /* if count <= PIPE_BUF, we have to make it atomic */
        if (count <= PIPE_BUF)
                free = count;
        else
@@ -138,20+146,20 @@ static long long pipe_lseek(struct file * file, long long offset, int orig)
        return -ESPIPE;
 }
 
-static long bad_pipe_r(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t bad_pipe_r(struct file * filp, char * buf,
+                         size_t count, loff_t *ppos)
 {
        return -EBADF;
 }
 
-static long bad_pipe_w(struct inode * inode, struct file * filp,
-       const char * buf, unsigned long count)
+static ssize_t bad_pipe_w(struct file * filp, const char * buf,
+                         size_t count, loff_t *ppos)
 {
        return -EBADF;
 }
 
 static int pipe_ioctl(struct inode *pino, struct file * filp,
-       unsigned int cmd, unsigned long arg)
+                     unsigned int cmd, unsigned long arg)
 {
        switch (cmd) {
                case FIONREAD:
@@ -206,13+214,14 @@ static unsigned int fifo_poll(struct file * filp, poll_table * wait)
  * the open() code hasn't guaranteed a connection (O_NONBLOCK),
  * and we need to act differently until we do get a writer..
  */
-static long connect_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t connect_read(struct file * filp, char * buf,
+                           size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        if (PIPE_EMPTY(*inode) && !PIPE_WRITERS(*inode))
                return 0;
        filp->f_op = &read_fifo_fops;
-       return pipe_read(inode,filp,buf,count);
+       return pipe_read(filp,buf,count,ppos);
 }
 
 static unsigned int connect_poll(struct file * filp, poll_table * wait)
index a6921cb..26634ad 100644 (file)
@@ -61,12+61,12 @@ int get_malloc(char * buffer);
 #endif
 
 
-static long read_core(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t read_core(struct file * file, char * buf,
+                        size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos, memsize;
-       int read;
-       int count1;
+       unsigned long p = *ppos, memsize;
+       ssize_t read;
+       ssize_t count1;
        char * pnt;
        struct user dump;
 #if defined (__i386__) || defined (__mc68000__)
@@ -101,16+101,21 @@ static long read_core(struct inode * inode, struct file * file,
                read += count1;
        }
 
-       while (count > 0 && p < PAGE_SIZE + FIRST_MAPPED) {
-               put_user(0,buf);
-               buf++;
-               p++;
-               count--;
-               read++;
+       if (count > 0 && p < PAGE_SIZE + FIRST_MAPPED) {
+               count1 = PAGE_SIZE + FIRST_MAPPED - p;
+               if (count1 > count)
+                       count1 = count;
+               clear_user(buf, count1);
+               buf += count1;
+               p += count1;
+               count -= count1;
+               read += count1;
        }
-       copy_to_user(buf, (void *) (PAGE_OFFSET + p - PAGE_SIZE), count);
-       read += count;
-       file->f_pos += read;
+       if (count > 0) {
+               copy_to_user(buf, (void *) (PAGE_OFFSET+p-PAGE_SIZE), count);
+               read += count;
+       }
+       *ppos += read;
        return read;
 }
 
@@ -129,11+134,11 @@ struct inode_operations proc_kcore_inode_operations = {
  * buffer. Use of the program readprofile is recommended in order to
  * get meaningful info out of these data.
  */
-static long read_profile(struct inode *inode, struct file *file,
-       char *buf, unsigned long count)
+static ssize_t read_profile(struct file *file, char *buf,
+                           size_t count, loff_t *ppos)
 {
-       unsigned long p = file->f_pos;
-       int read;
+       unsigned long p = *ppos;
+       ssize_t read;
        char * pnt;
        unsigned int sample_step = 1 << prof_shift;
 
@@ -143,14+148,14 @@ static long read_profile(struct inode *inode, struct file *file,
                count = (prof_len+1)*sizeof(unsigned int) - p;
        read = 0;
 
-       while (p < sizeof(unsigned long) && count > 0) {
+       while (p < sizeof(unsigned int) && count > 0) {
                put_user(*((char *)(&sample_step)+p),buf);
                buf++; p++; count--; read++;
        }
        pnt = (char *)prof_buffer + p - sizeof(unsigned int);
        copy_to_user(buf,(void *)pnt,count);
        read += count;
-       file->f_pos += read;
+       *ppos += read;
        return read;
 }
 
@@ -160,10+165,9 @@ static long read_profile(struct inode *inode, struct file *file,
  * Writing a 'profiling multiplier' value into it also re-sets the profiling
  * interrupt frequency, on architectures that support this.
  */
-static long write_profile(struct inode * inode, struct file * file,
-       const char * buf, unsigned long count)
+static ssize_t write_profile(struct file * file, const char * buf,
+                            size_t count, loff_t *ppos)
 {
-       int i=prof_len;
 #ifdef __SMP__
        extern int setup_profiling_timer (unsigned int multiplier);
 
@@ -178,8+182,7 @@ static long write_profile(struct inode * inode, struct file * file,
        }
 #endif
   
-       while (i--)
-               prof_buffer[i]=0UL;
+       memset(prof_buffer, 0, prof_len * sizeof(*prof_buffer));
        return count;
 }
 
@@ -923,14+926,15 @@ static int get_statm(int pid, char * buffer)
 #define MAPS_LINE_MAX  MAPS_LINE_MAX8
 
 
-static long read_maps (int pid, struct file * file, char * buf,
-                       unsigned long count)
+static ssize_t read_maps (int pid, struct file * file, char * buf,
+                         size_t count, loff_t *ppos)
 {
        struct task_struct *p;
        struct vm_area_struct * map, * next;
        char * destptr = buf, * buffer;
        loff_t lineno;
-       int column, i, volatile_task;
+       ssize_t column, i;
+       int volatile_task;
        long retval;
 
        /*
@@ -953,8+957,8 @@ static long read_maps (int pid, struct file * file, char * buf,
        volatile_task = (p != current || p->mm->count > 1);
 
        /* decode f_pos */
-       lineno = file->f_pos >> MAPS_LINE_SHIFT;
-       column = file->f_pos & (MAPS_LINE_LENGTH-1);
+       lineno = *ppos >> MAPS_LINE_SHIFT;
+       column = *ppos & (MAPS_LINE_LENGTH-1);
 
        /* quickly go to line lineno */
        for (map = p->mm->mmap, i = 0; map && (i < lineno); map = map->vm_next, i++)
@@ -1002,7+1006,6 @@ static long read_maps (int pid, struct file * file, char * buf,
                              kdevname(dev), ino);
 
                if(map->vm_dentry) {
-                       int i;
                        for(i = len; i < maxlen; i++)
                                line[i] = ' ';
                        len = buffer + PAGE_SIZE - line;
@@ -1038,7+1041,7 @@ static long read_maps (int pid, struct file * file, char * buf,
        }
 
        /* encode f_pos */
-       file->f_pos = (lineno << MAPS_LINE_SHIFT) + column;
+       *ppos = (lineno << MAPS_LINE_SHIFT) + column;
 
 getlen_out:
        retval = destptr - buf;
@@ -1192,13+1195,14 @@ static inline int fill_array(char * page, int pid, int type, char **start, off_t
 
 #define PROC_BLOCK_SIZE        (3*1024)                /* 4K page size but our output routines use some slack for overruns */
 
-static long array_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t array_read(struct file * file, char * buf,
+                         size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        unsigned long page;
        char *start;
-       int length;
-       int end;
+       ssize_t length;
+       ssize_t end;
        unsigned int type, pid;
        struct proc_dir_entry *dp;
 
@@ -1212,11+1216,11 @@ static long array_read(struct inode * inode, struct file * file,
        start = NULL;
        dp = (struct proc_dir_entry *) inode->u.generic_ip;
        if (dp->get_info)
-               length = dp->get_info((char *)page, &start, file->f_pos,
+               length = dp->get_info((char *)page, &start, *ppos,
                                      count, 0);
        else
                length = fill_array((char *) page, pid, type,
-                                   &start, file->f_pos, count);
+                                   &start, *ppos, count);
        if (length < 0) {
                free_page(page);
                return length;
@@ -1224,19+1228,19 @@ static long array_read(struct inode * inode, struct file * file,
        if (start != NULL) {
                /* We have had block-adjusting processing! */
                copy_to_user(buf, start, length);
-               file->f_pos += length;
+               *ppos += length;
                count = length;
        } else {
                /* Static 4kB (or whatever) block capacity */
-               if (file->f_pos >= length) {
+               if (*ppos >= length) {
                        free_page(page);
                        return 0;
                }
-               if (count + file->f_pos > length)
-                       count = length - file->f_pos;
-               end = count + file->f_pos;
-               copy_to_user(buf, (char *) page + file->f_pos, count);
-               file->f_pos = end;
+               if (count + *ppos > length)
+                       count = length - *ppos;
+               end = count + *ppos;
+               copy_to_user(buf, (char *) page + *ppos, count);
+               *ppos = end;
        }
        free_page(page);
        return count;
@@ -1275,15+1279,16 @@ struct inode_operations proc_array_inode_operations = {
        NULL                    /* permission */
 };
 
-static long arraylong_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t arraylong_read(struct file * file, char * buf,
+                             size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        unsigned int pid = inode->i_ino >> 16;
        unsigned int type = inode->i_ino & 0x0000ffff;
 
        switch (type) {
                case PROC_PID_MAPS:
-                       return read_maps(pid, file, buf, count);
+                       return read_maps(pid, file, buf, count, ppos);
        }
        return -EINVAL;
 }
index 4774cf8..89da754 100644 (file)
 
 extern struct inode_operations proc_dyna_dir_inode_operations;
 
-static long proc_file_read(struct inode * inode, struct file * file,
-                          char * buf, unsigned long nbytes);
-static long proc_file_write(struct inode * inode, struct file * file,
-                           const char * buffer, unsigned long count);
+static ssize_t proc_file_read(struct file * file, char * buf,
+                             size_t nbytes, loff_t *ppos);
+static ssize_t proc_file_write(struct file * file, const char * buffer,
+                              size_t count, loff_t *ppos);
 static long long proc_file_lseek(struct file *, long long, int);
 
 int proc_match(int len, const char *name,struct proc_dir_entry * de)
@@ -97,18+97,17 @@ struct inode_operations proc_net_inode_operations = {
 /* 4K page size but our output routines use some slack for overruns */
 #define PROC_BLOCK_SIZE        (3*1024)
 
-static long proc_file_read(struct inode * inode, struct file * file,
-                          char * buf, unsigned long nbytes)
+static ssize_t
+proc_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        char    *page;
-       int     retval=0;
+       ssize_t retval=0;
        int     eof=0;
-       int     n, count;
+       ssize_t n, count;
        char    *start;
        struct proc_dir_entry * dp;
 
-       if (nbytes < 0)
-               return -EINVAL;
        dp = (struct proc_dir_entry *) inode->u.generic_ip;
        if (!(page = (char*) __get_free_page(GFP_KERNEL)))
                return -ENOMEM;
@@ -126,12+125,12 @@ static long proc_file_read(struct inode * inode, struct file * file,
                         * XXX What gives with the file->f_flags & O_ACCMODE
                         * test?  Seems stupid to me....
                         */
-                       n = dp->get_info(page, &start, file->f_pos, count,
+                       n = dp->get_info(page, &start, *ppos, count,
                                 (file->f_flags & O_ACCMODE) == O_RDWR);
                        if (n < count)
                                eof = 1;
                } else if (dp->read_proc) {
-                       n = dp->read_proc(page, &start, file->f_pos,
+                       n = dp->read_proc(page, &start, *ppos,
                                          count, &eof, dp->data);
                } else
                        break;
@@ -140,8+139,8 @@ static long proc_file_read(struct inode * inode, struct file * file,
                        /*
                         * For proc files that are less than 4k
                         */
-                       start = page + file->f_pos;
-                       n -= file->f_pos;
+                       start = page + *ppos;
+                       n -= *ppos;
                        if (n <= 0)
                                break;
                        if (n > count)
@@ -162,7+161,7 @@ static long proc_file_read(struct inode * inode, struct file * file,
                        break;
                }
                
-               file->f_pos += n;       /* Move down the file */
+               *ppos += n;     /* Move down the file */
                nbytes -= n;
                buf += n;
                retval += n;
@@ -171,24+170,25 @@ static long proc_file_read(struct inode * inode, struct file * file,
        return retval;
 }
 
-static long
-proc_file_write(struct inode * inode, struct file * file,
-               const char * buffer, unsigned long count)
+static ssize_t
+proc_file_write(struct file * file, const char * buffer,
+               size_t count, loff_t *ppos)
 {
+       struct inode *inode = file->f_dentry->d_inode;
        struct proc_dir_entry * dp;
        
-       if (count < 0)
-               return -EINVAL;
        dp = (struct proc_dir_entry *) inode->u.generic_ip;
 
        if (!dp->write_proc)
                return -EIO;
 
+       /* FIXME: does this routine need ppos?  probably... */
        return dp->write_proc(file, buffer, count, dp->data);
 }
 
 
-static long long proc_file_lseek(struct file * file, long long offset, int orig)
+static long long
+proc_file_lseek(struct file * file, long long offset, int orig)
 {
     switch (orig) {
     case 0:
index 1cc6a9c..42346a8 100644 (file)
@@ -30,8+30,8 @@ static int kmsg_release(struct inode * inode, struct file * file)
        return 0;
 }
 
-static long kmsg_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t kmsg_read(struct file * file, char * buf,
+                        size_t count, loff_t *ppos)
 {
        return sys_syslog(2,buf,count);
 }
index 9f03867..c49f187 100644 (file)
@@ -70,9+70,10 @@ static struct task_struct * get_task(int pid)
        return tsk;
 }
 
-static long mem_read(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t mem_read(struct file * file, char * buf,
+                       size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        pgd_t *page_dir;
        pmd_t *page_middle;
        pte_t pte;
@@ -80,17+81,17 @@ static long mem_read(struct inode * inode, struct file * file,
        struct task_struct * tsk;
        unsigned long addr;
        char *tmp;
-       int i;
+       ssize_t scount, i;
 
        tsk = get_task(inode->i_ino >> 16);
        if (!tsk)
                return -ESRCH;
-       addr = file->f_pos;
-       count = check_range(tsk->mm, addr, count);
-       if (count < 0)
-               return count;
+       addr = *ppos;
+       scount = check_range(tsk->mm, addr, count);
+       if (scount < 0)
+               return scount;
        tmp = buf;
-       while (count > 0) {
+       while (scount > 0) {
                if (signal_pending(current))
                        break;
                page_dir = pgd_offset(tsk->mm,addr);
@@ -114,22+115,23 @@ static long mem_read(struct inode * inode, struct file * file,
                        break;
                page = (char *) pte_page(pte) + (addr & ~PAGE_MASK);
                i = PAGE_SIZE-(addr & ~PAGE_MASK);
-               if (i > count)
-                       i = count;
+               if (i > scount)
+                       i = scount;
                copy_to_user(tmp, page, i);
                addr += i;
                tmp += i;
-               count -= i;
+               scount -= i;
        }
-       file->f_pos = addr;
+       *ppos = addr;
        return tmp-buf;
 }
 
 #ifndef mem_write
 
-static long mem_write(struct inode * inode, struct file * file,
-       char * buf, unsigned long count)
+static ssize_t mem_write(struct file * file, char * buf,
+                        size_t count, loff_t *ppos)
 {
+       struct inode * inode = file->f_dentry->d_inode;
        pgd_t *page_dir;
        pmd_t *page_middle;
        pte_t pte;
@@ -137,9+139,9 @@ static long mem_write(struct inode * inode, struct file * file,
        struct task_struct * tsk;
        unsigned long addr;
        char *tmp;
-       int i;
+       long i;
 
-       addr = file->f_pos;
+       addr = *ppos;
        tsk = get_task(inode->i_ino >> 16);
        if (!tsk)
                return -ESRCH;
@@ -177,7+179,7 @@ static long mem_write(struct inode * inode, struct file * file,
                tmp += i;
                count -= i;
        }
-       file->f_pos = addr;
+       *ppos = addr;
        if (tmp != buf)
                return tmp-buf;
        if (signal_pending(current))
index 831a262..3bc4b1d 100644 (file)
 #include <asm/uaccess.h>
 
 /* forward references */
-static long proc_readscsi(struct inode * inode, struct file * file,
-                        char * buf, unsigned long count);
-static long proc_writescsi(struct inode * inode, struct file * file,
-                        const char * buf, unsigned long count);
+static ssize_t proc_readscsi(struct file * file, char * buf,
+                             size_t count, loff_t *ppos);
+static ssize_t proc_writescsi(struct file * file, const char * buf,
+                              size_t count, loff_t *ppos);
 static long long proc_scsilseek(struct file *, long long, int);
 
 extern void build_proc_dir_hba_entries(uint);
@@ -101,13+101,14 @@ int get_not_present_info(char *buffer, char **start, off_t offset, int length)
                                      * use some slack for overruns 
                                      */
 
-static long proc_readscsi(struct inode * inode, struct file * file,
-                         char * buf, unsigned long count)
+static ssize_t proc_readscsi(struct file * file, char * buf,
+                             size_t count, loff_t *ppos)
 {
-    int length;
-    int bytes = count;
-    int copied = 0;
-    int thistime;
+    struct inode * inode = file->f_dentry->d_inode; 
+    ssize_t length;
+    ssize_t bytes = count;
+    ssize_t copied = 0;
+    ssize_t thistime;
     char * page;
     char * start;
     
@@ -121,9+122,9 @@ static long proc_readscsi(struct inode * inode, struct file * file,
        
        if(dispatch_scsi_info_ptr)
            length = dispatch_scsi_info_ptr(inode->i_ino, page, &start, 
-                                           file->f_pos, thistime, 0);
+                                           *ppos, thistime, 0);
        else
-           length = get_not_present_info(page, &start, file->f_pos, thistime);
+           length = get_not_present_info(page, &start, *ppos, thistime);
        if(length < 0) {
            free_page((ulong) page);
            return(length);
@@ -140,7+141,7 @@ static long proc_readscsi(struct inode * inode, struct file * file,
         *  Copy the bytes
         */
        copy_to_user(buf + copied, start, length);
-       file->f_pos += length;  /* Move down the file */
+       *ppos += length;        /* Move down the file */
        bytes -= length;
        copied += length;
        
@@ -154,10+155,11 @@ static long proc_readscsi(struct inode * inode, struct file * file,
 }
 
 
-static long proc_writescsi(struct inode * inode, struct file * file,
-                          const char * buf, unsigned long count)
+static ssize_t proc_writescsi(struct file * file, const char * buf,
+                              size_t count, loff_t *ppos)
 {
-    int ret = 0;
+    struct inode * inode = file->f_dentry->d_inode;
+    ssize_t ret = 0;
     char * page;
     
     if(count > PROC_BLOCK_SIZE) {
index df3d34d..616dbd7 100644 (file)
 #include <linux/malloc.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/limits.h>
 
 #include <asm/uaccess.h>
 
-static long long default_llseek(struct file *file, long long offset, int origin)
+static loff_t default_llseek(struct file *file, loff_t offset, int origin)
 {
        long long retval;
 
@@ -42,9+43,9 @@ static long long default_llseek(struct file *file, long long offset, int origin)
        return retval;
 }
 
-static inline long long llseek(struct file *file, long long offset, unsigned int origin)
+static inline loff_t llseek(struct file *file, loff_t offset, int origin)
 {
-       long long (*fn)(struct file *, long long, int);
+       loff_t (*fn)(struct file *, loff_t, int);
 
        fn = default_llseek;
        if (file->f_op && file->f_op->llseek)
@@ -52,9+53,9 @@ static inline long long llseek(struct file *file, long long offset, unsigned int
        return fn(file, offset, origin);
 }
 
-asmlinkage long sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
+asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
 {
-       long retval;
+       off_t retval;
        struct file * file;
        struct dentry * dentry;
        struct inode * inode;
@@ -67,23+68,23 @@ asmlinkage long sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
            !(inode = dentry->d_inode))
                goto bad;
        retval = -EINVAL;
-       if (origin > 2)
-               goto bad;
-       retval = llseek(file, offset, origin);
+       if (origin <= 2)
+               retval = llseek(file, offset, origin);
 bad:
        unlock_kernel();
        return retval;
 }
 
+#if !defined(__alpha__) && !defined(__sparc_v9__)
 asmlinkage int sys_llseek(unsigned int fd, unsigned long offset_high,
                          unsigned long offset_low, loff_t * result,
                          unsigned int origin)
 {
-       long retval;
+       int retval;
        struct file * file;
        struct dentry * dentry;
        struct inode * inode;
-       long long offset;
+       loff_t offset;
 
        lock_kernel();
        retval = -EBADF;
@@ -96,10+97,10 @@ asmlinkage int sys_llseek(unsigned int fd, unsigned long offset_high,
        if (origin > 2)
                goto bad;
 
-       offset = llseek(file, (((unsigned long long) offset_high << 32) | offset_low),
-               origin);
+       offset = llseek(file, ((loff_t) offset_high << 32) | offset_low,
+                       origin);
 
-       retval = offset;
+       retval = (int)offset & INT_MAX;
        if (offset >= 0) {
                retval = copy_to_user(result, &offset, sizeof(offset));
                if (retval)
@@ -109,120+110,114 @@ bad:
        unlock_kernel();
        return retval;
 }
+#endif
 
-asmlinkage long sys_read(unsigned int fd, char * buf, unsigned long count)
+asmlinkage ssize_t sys_read(unsigned int fd, char * buf, size_t count)
 {
-       int error;
+       ssize_t ret;
        struct file * file;
-       struct dentry * dentry;
-       struct inode * inode;
-       long (*read)(struct inode *, struct file *, char *, unsigned long);
+       ssize_t (*read)(struct file *, char *, size_t, loff_t *);
 
        lock_kernel();
-       error = -EBADF;
+
+       ret = -EBADF;
        file = fget(fd);
        if (!file)
                goto bad_file;
-       dentry = file->f_dentry;
-       if (!dentry)
+       ret = -EBADF;
+       if (!(file->f_mode & FMODE_READ))
                goto out;
-       inode = dentry->d_inode;
-       if (!inode)
+       ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
+                               file, file->f_pos, count);
+       if (ret)
                goto out;
-       error = -EBADF;
-       if (!(file->f_mode & 1))
-               goto out;
-       error = locks_verify_area(FLOCK_VERIFY_READ,inode,file,file->f_pos,count);
-       if (error)
-               goto out;
-       error = -EINVAL;
+       ret = -EINVAL;
        if (!file->f_op || !(read = file->f_op->read))
                goto out;
-       error = read(inode,file,buf,count);
+       ret = read(file, buf, count, &file->f_pos);
 out:
        fput(file);
 bad_file:
        unlock_kernel();
-       return error;
+       return ret;
 }
 
-asmlinkage long sys_write(unsigned int fd, const char * buf, unsigned long count)
+asmlinkage ssize_t sys_write(unsigned int fd, const char * buf, size_t count)
 {
-       int error;
+       ssize_t ret;
        struct file * file;
-       struct dentry * dentry;
        struct inode * inode;
-       long (*write)(struct inode *, struct file *, const char *, unsigned long);
+       ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
 
        lock_kernel();
-       error = -EBADF;
+
+       ret = -EBADF;
        file = fget(fd);
        if (!file)
                goto bad_file;
-       dentry = file->f_dentry;
-       if (!dentry)
-               goto out;
-       inode = dentry->d_inode;
-       if (!inode)
+       if (!(file->f_mode & FMODE_WRITE))
                goto out;
-       if (!(file->f_mode & 2))
+       inode = file->f_dentry->d_inode;
+       ret = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file,
+                               file->f_pos, count);
+       if (ret)
                goto out;
-       error = locks_verify_area(FLOCK_VERIFY_WRITE,inode,file,file->f_pos,count);
-       if (error)
-               goto out;
-       error = -EINVAL;
+       ret = -EINVAL;
        if (!file->f_op || !(write = file->f_op->write))
                goto out;
+
        down(&inode->i_sem);
-       error = write(inode,file,buf,count);
+       ret = write(file, buf, count, &file->f_pos);
        up(&inode->i_sem);
 out:
        fput(file);
 bad_file:
        unlock_kernel();
-       return error;
+       return ret;
 }
 
-typedef long (*IO_fn_t)(struct inode *, struct file *, char *, unsigned long);
 
-static long do_readv_writev(int type, struct inode * inode, struct file * file,
-       const struct iovec * vector, unsigned long count)
+static ssize_t do_readv_writev(int type, struct file *file,
+                              const struct iovec * vector,
+                              unsigned long count)
 {
-       unsigned long tot_len;
+       typedef ssize_t (*io_fn_t)(struct file *, char *, size_t, loff_t *);
+
+       size_t tot_len;
        struct iovec iovstack[UIO_FASTIOV];
        struct iovec *iov=iovstack;
-       long retval, i;
-       IO_fn_t fn;
+       ssize_t ret, i;
+       io_fn_t fn;
+       struct inode *inode;
 
        /*
         * First get the "struct iovec" from user memory and
         * verify all the pointers
         */
+       ret = 0;
        if (!count)
-               return 0;
+               goto out_nofree;
+       ret = -EINVAL;
        if (count > UIO_MAXIOV)
-               return -EINVAL;
+               goto out_nofree;
        if (count > UIO_FASTIOV) {
                iov = kmalloc(count*sizeof(struct iovec), GFP_KERNEL);
-               if (!iov)
-                       return -ENOMEM;
-       }
-       if (copy_from_user(iov, vector, count*sizeof(*vector))) {
-               if (iov != iovstack)
-                       kfree(iov);
-               return -EFAULT;
+               ret = -ENOMEM;
+               if (!iov) goto out_nofree;
        }
+       ret = -EFAULT;
+       if (copy_from_user(iov, vector, count*sizeof(*vector)))
+               goto out;
+
        tot_len = 0;
        for (i = 0 ; i < count ; i++)
                tot_len += iov[i].iov_len;
 
-       retval = locks_verify_area(type == VERIFY_READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE,
-                                  inode, file, file->f_pos, tot_len);
-       if (retval) {
-               if (iov != iovstack)
-                       kfree(iov);
-               return retval;
-       }
+       inode = file->f_dentry->d_inode;
+       ret = locks_verify_area((type == VERIFY_READ
+                                ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE),
+                               inode, file, file->f_pos, tot_len);
+       if (ret) goto out;
 
        /*
         * Then do the actual IO.  Note that sockets need to be handled
@@ -230,116+225,165 @@ static long do_readv_writev(int type, struct inode * inode, struct file * file,
         * iovec's natively
         */
        if (inode->i_sock) {
-               int err;
-               err = sock_readv_writev(type, inode, file, iov, count, tot_len);
-               if (iov != iovstack)
-                       kfree(iov);
-               return err;
+               ret = sock_readv_writev(type,inode,file,iov,count,tot_len);
+               goto out;
        }
 
-       if (!file->f_op) {
-               if (iov != iovstack)
-                       kfree(iov);
-               return -EINVAL;
-       }
+       ret = -EINVAL;
+       if (!file->f_op)
+               goto out;
+
        /* VERIFY_WRITE actually means a read, as we write to user space */
        fn = file->f_op->read;
        if (type == VERIFY_READ)
-               fn = (IO_fn_t) file->f_op->write;               
+               fn = (io_fn_t) file->f_op->write;               
+
+       ret = 0;
        vector = iov;
        while (count > 0) {
                void * base;
-               int len, nr;
+               size_t len;
+               ssize_t nr;
 
                base = vector->iov_base;
                len = vector->iov_len;
                vector++;
                count--;
 
-               /* Any particular reason why we do not grab the inode semaphore
-                * when doing writes here? -DaveM
-                */
-               nr = fn(inode, file, base, len);
+               nr = fn(file, base, len, &file->f_pos);
+
                if (nr < 0) {
-                       if (retval)
-                               break;
-                       retval = nr;
+                       if (!ret) ret = nr;
                        break;
                }
-               retval += nr;
+               ret += nr;
                if (nr != len)
                        break;
        }
+
+out:
        if (iov != iovstack)
                kfree(iov);
-       return retval;
+out_nofree:
+       return ret;
 }
 
-asmlinkage long sys_readv(unsigned long fd, const struct iovec * vector, unsigned long count)
+asmlinkage ssize_t sys_readv(unsigned long fd, const struct iovec * vector,
+                            unsigned long count)
 {
        struct file * file;
-       struct dentry * dentry;
-       struct inode * inode;
-       long err;
+       ssize_t ret;
 
        lock_kernel();
-       err = -EBADF;
-       if (fd >= NR_OPEN)
-               goto out;
 
-       file = current->files->fd[fd];
+       ret = -EBADF;
+       file = fget(fd);
        if (!file)
+               goto bad_file;
+       if (!(file->f_mode & FMODE_READ))
                goto out;
+       ret = do_readv_writev(VERIFY_WRITE, file, vector, count);
+out:
+       fput(file);
+bad_file:
+       unlock_kernel();
+       return ret;
+}
 
-       if (!(file->f_mode & 1))
-               goto out;
+asmlinkage ssize_t sys_writev(unsigned long fd, const struct iovec * vector,
+                             unsigned long count)
+{
+       struct file * file;
+       ssize_t ret;
 
-       dentry = file->f_dentry;
-       if (!dentry)
-               goto out;
+       lock_kernel();
 
-       inode = dentry->d_inode;
-       if (!inode)
+       ret = -EBADF;
+       file = fget(fd);
+       if (!file)
+               goto bad_file;
+       if (!(file->f_mode & FMODE_WRITE))
                goto out;
 
-       err = do_readv_writev(VERIFY_WRITE, inode, file, vector, count);
+       down(&file->f_dentry->d_inode->i_sem);
+       ret = do_readv_writev(VERIFY_READ, file, vector, count);
+       up(&file->f_dentry->d_inode->i_sem);
+
 out:
+       fput(file);
+bad_file:
        unlock_kernel();
-       return err;
+       return ret;
 }
 
-asmlinkage long sys_writev(unsigned long fd, const struct iovec * vector, unsigned long count)
+/* From the Single Unix Spec: pread & pwrite act like lseek to pos + op +
+   lseek back to original location.  They fail just like lseek does on
+   non-seekable files.  */
+
+asmlinkage ssize_t sys_pread(unsigned int fd, char * buf,
+                            size_t count, loff_t pos)
 {
-       long error;
+       ssize_t ret;
        struct file * file;
-       struct dentry * dentry;
-       struct inode * inode;
+       ssize_t (*read)(struct file *, char *, size_t, loff_t *);
 
        lock_kernel();
-       error = -EBADF;
 
-       if (fd >= NR_OPEN)
+       ret = -EBADF;
+       file = fget(fd);
+       if (!file)
+               goto bad_file;
+       if (!(file->f_mode & FMODE_READ))
+               goto out;
+       ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode,
+                               file, pos, count);
+       if (ret)
                goto out;
+       ret = -EINVAL;
+       if (!file->f_op || !(read = file->f_op->read))
+               goto out;
+       if (pos < 0)
+               goto out;
+       ret = read(file, buf, count, &pos);
+out:
+       fput(file);
+bad_file:
+       unlock_kernel();
+       return ret;
+}
+
+asmlinkage ssize_t sys_pwrite(unsigned int fd, const char * buf,
+                             size_t count, loff_t pos)
+{
+       ssize_t ret;
+       struct file * file;
+       ssize_t (*write)(struct file *, const char *, size_t, loff_t *);
+
+       lock_kernel();
 
-       file = current->files->fd[fd];
+       ret = -EBADF;
+       file = fget(fd);
        if (!file)
+               goto bad_file;
+       if (!(file->f_mode & FMODE_WRITE))
                goto out;
-
-       if (!(file->f_mode & 2))
+       ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode,
+                               file, pos, count);
+       if (ret)
                goto out;
-
-       dentry = file->f_dentry;
-       if (!dentry)
+       ret = -EINVAL;
+       if (!file->f_op || !(write = file->f_op->write))
                goto out;
-
-       inode = dentry->d_inode;
-       if (!inode)
+       if (pos < 0)
                goto out;
 
-       down(&inode->i_sem);
-       error = do_readv_writev(VERIFY_READ, inode, file, vector, count);
-       up(&inode->i_sem);
+       down(&file->f_dentry->d_inode->i_sem);
+       ret = write(file, buf, count, &pos);
+       up(&file->f_dentry->d_inode->i_sem);
+
 out:
+       fput(file);
+bad_file:
        unlock_kernel();
-       return error;
+       return ret;
 }
index 680a91c..a572de0 100644 (file)
 /* #define SMBFS_DEBUG_VERBOSE 1 */
 /* #define pr_debug printk */
 
-static long smb_dir_read(struct inode *, struct file *, char *, unsigned long);
+static ssize_t smb_dir_read(struct file *, char *, size_t, loff_t *);
 static int smb_readdir(struct file *, void *, filldir_t);
 static int smb_dir_open(struct inode *, struct file *);
 
@@ -71,9+71,8 @@ struct inode_operations smb_dir_inode_operations =
        NULL                    /* smap */
 };
 
-static long
-smb_dir_read(struct inode *inode, struct file *filp, char *buf,
-            unsigned long count)
+static ssize_t
+smb_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index 7388ee3..cb0a2e8 100644 (file)
@@ -227,22+227,21 @@ page_addr, offset, buffer);
        goto out;
 }
 
-static long
-smb_file_read(struct inode * inode, struct file * file,
-             char * buf, unsigned long count)
+static ssize_t
+smb_file_read(struct file * file, char * buf, size_t count, loff_t *ppos)
 {
-       int     status;
+       ssize_t status;
 
 #ifdef SMBFS_DEBUG_VERBOSE
 printk("smb_file_read: file %s/%s, count=%lu@%lu\n",
 file->f_dentry->d_parent->d_name.name, file->f_dentry->d_name.name,
-count, (unsigned long) file->f_pos);
+count, (unsigned long) *ppos);
 #endif
 
-       status = smb_revalidate_inode(inode);
+       status = smb_revalidate_inode(file->f_dentry->d_inode);
        if (status >= 0)
        {
-               status = generic_file_read(inode, file, buf, count);
+               status = generic_file_read(file, buf, count, ppos);
        }
        return status;
 }
@@ -270,30+269,29 @@ vma->vm_start, vma->vm_end);
 /* 
  * Write to a file (through the page cache).
  */
-static long
-smb_file_write(struct inode *inode, struct file *file,
-              const char *buf, unsigned long count)
+static ssize_t
+smb_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
-       int     result;
+       ssize_t result;
 
 #ifdef SMBFS_DEBUG_VERBOSE
 printk("smb_file_write: file %s/%s, count=%lu@%lu\n",
 file->f_dentry->d_parent->d_name.name, file->f_dentry->d_name.name,
-count, (unsigned long) file->f_pos);
+count, (unsigned long) *ppos);
 #endif
 
 #ifdef SMBFS_PARANOIA
        /* Should be impossible now that inodes can't change mode */
        result = -EINVAL;
-       if (!S_ISREG(inode->i_mode))
+       if (!S_ISREG(file->f_dentry->d_inode->i_mode))
        {
                printk("smb_file_write: write to non-file, mode %07o\n",
-                       inode->i_mode);
+                      file->f_dentry->d_inode->i_mode);
                goto out;
        }
 #endif
 
-       result = smb_revalidate_inode(inode);
+       result = smb_revalidate_inode(file->f_dentry->d_inode);
        if (result)
                goto out;
 
@@ -303,9+301,9 @@ count, (unsigned long) file->f_pos);
 
        if (count > 0)
        {
-               result = generic_file_write(inode, file, buf, count);
+               result = generic_file_write(file, buf, count, ppos);
                if (result > 0)
-                       smb_refresh_inode(inode);
+                       smb_refresh_inode(file->f_dentry->d_inode);
        }
 out:
        return result;
index 03d4080..b9e40e3 100644 (file)
@@ -594,31+594,11 @@ static int do_umount(kdev_t dev,int unmount_root)
 
        if (!sb->s_root)
                return -ENOENT;
-
-       if (dev==ROOT_DEV && !unmount_root) {
-               /*
-                * Special case for "unmounting" root. We just try to remount
-                * it readonly, and sync() the device.
-                */
-               if (!(sb->s_flags & MS_RDONLY)) {
-                       /*
-                        * Make sure all quotas are turned off on this device we need to mount
-                        * it readonly so no more writes by the quotasystem.
-                        * If later on the remount fails too bad there are no quotas running
-                        * anymore. Turn them on again by hand.
-                        */
-                       quota_off(dev, -1);
-                       fsync_dev(dev);
-                       retval = do_remount_sb(sb, MS_RDONLY, 0);
-                       return retval;
-               }
-               return 0;
-       }
-
        /*
-        * Before checking if the filesystem is still busy make sure the kernel
-        * doesn't hold any quotafiles open on that device. If the umount fails
-        * too bad there are no quotas running anymore. Turn them on again by hand.
+        * Before checking whether the filesystem is still busy,
+        * make sure the kernel doesn't hold any quotafiles open
+        * on the device. If the umount fails, too bad -- there
+        * are no quotas running anymore. Just turn them on again.
         */
        quota_off(dev, -1);
 
@@ -628,12+608,23 @@ static int do_umount(kdev_t dev,int unmount_root)
         * root entry should be in use and (b) that root entry is
         * clean.
         */
-       shrink_dcache();
+       shrink_dcache_sb(sb);
        fsync_dev(dev);
 
+       if (dev==ROOT_DEV && !unmount_root) {
+               /*
+                * Special case for "unmounting" root ...
+                * we just try to remount it readonly.
+                */
+               retval = 0;
+               if (!(sb->s_flags & MS_RDONLY))
+                       retval = do_remount_sb(sb, MS_RDONLY, 0);
+               return retval;
+       }
+
        retval = d_umount(sb);
        if (retval)
-               return retval;
+               goto out;
 
        /* Forget any inodes */
        if (invalidate_inodes(sb)) {
@@ -648,7+639,9 @@ static int do_umount(kdev_t dev,int unmount_root)
                        sb->s_op->put_super(sb);
        }
        remove_vfsmnt(dev);
-       return 0;
+       retval = 0;
+out:
+       return retval;
 }
 
 static int umount_dev(kdev_t dev)
index ac0bd29..e93f8bb 100644 (file)
 
 #include <asm/uaccess.h>
 
-static long sysv_dir_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+static ssize_t sysv_dir_read(struct file * filp, char * buf,
+                            size_t count, loff_t *ppos)
 {
        return -EISDIR;
 }
index 1a28e4c..2bb4422 100644 (file)
 #include <linux/fs.h>
 #include <linux/sysv_fs.h>
 
-static long sysv_file_write(struct inode *, struct file *, const char *, unsigned long);
+static ssize_t sysv_file_write(struct file *, const char *, size_t, loff_t *);
 
 /*
  * We have mostly NULL's here: the current defaults are ok for
@@ -72,18+72,19 @@ struct inode_operations sysv_file_inode_operations = {
        NULL                    /* permission */
 };
 
-long sysv_file_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+ssize_t sysv_file_read(struct file * filp, char * buf, 
+                      size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        struct super_block * sb = inode->i_sb;
-       int read,left,chars;
-       unsigned int block;
-       int blocks, offset;
+       ssize_t read,left,chars;
+       size_t block;
+       ssize_t blocks, offset;
        int bhrequest, uptodate;
        struct buffer_head ** bhb, ** bhe;
        struct buffer_head * bhreq[NBUF];
        struct buffer_head * buflist[NBUF];
-       unsigned int size;
+       size_t size;
 
        if (!inode) {
                printk("sysv_file_read: inode = NULL\n");
@@ -93,7+94,7 @@ long sysv_file_read(struct inode * inode, struct file * filp,
                printk("sysv_file_read: mode = %07o\n",inode->i_mode);
                return -EINVAL;
        }
-       offset = filp->f_pos;
+       offset = *ppos;
        size = inode->i_size;
        if (offset > size)
                left = 0;
@@ -167,7+168,7 @@ long sysv_file_read(struct inode * inode, struct file * filp,
                                chars = left;
                        else
                                chars = sb->sv_block_size - offset;
-                       filp->f_pos += chars;
+                       *ppos += chars;
                        left -= chars;
                        read += chars;
                        if (*bhe) {
@@ -200,12+201,13 @@ long sysv_file_read(struct inode * inode, struct file * filp,
        return read;
 }
 
-static long sysv_file_write(struct inode * inode, struct file * filp,
-       const char * buf, unsigned long count)
+static ssize_t sysv_file_write(struct file * filp, const char * buf,
+                              size_t count, loff_t *ppos)
 {
+       struct inode * inode = filp->f_dentry->d_inode;
        struct super_block * sb = inode->i_sb;
        off_t pos;
-       int written,c;
+       ssize_t written, c;
        struct buffer_head * bh;
        char * p;
 
@@ -227,7+229,7 @@ static long sysv_file_write(struct inode * inode, struct file * filp,
        if (filp->f_flags & O_APPEND)
                pos = inode->i_size;
        else
-               pos = filp->f_pos;
+               pos = *ppos;
        written = 0;
        while (written<count) {
                bh = sysv_getblk (inode, pos >> sb->sv_block_size_bits, 1);
@@ -265,7+267,7 @@ static long sysv_file_write(struct inode * inode, struct file * filp,
                brelse(bh);
        }
        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
-       filp->f_pos = pos;
+       *ppos = pos;
        mark_inode_dirty(inode);
        return written;
 }
index b2d7edf..d84a952 100644 (file)
@@ -46,13+46,14 @@ void sysv_put_inode(struct inode *inode)
 
 static struct super_operations sysv_sops = {
        sysv_read_inode,
-       sysv_notify_change,
        sysv_write_inode,
        sysv_put_inode,
+       NULL,                   /* delete_inode */
+       sysv_notify_change,
        sysv_put_super,
        sysv_write_super,
        sysv_statfs,
-       NULL
+       NULL                    /* remount_fs */
 };
 
 /* The following functions try to recognize specific filesystems.
index 354757b..df90363 100644 (file)
@@ -8,8+8,8 @@
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
 O_TARGET := vfat.o
-O_OBJS   := 
-OX_OBJS  := namei.o
+O_OBJS   := namei.o
+OX_OBJS  := vfatfs_syms.o
 M_OBJS   := $(O_TARGET)
 
 include $(TOPDIR)/Rules.make
index 5872916..cc8613c 100644 (file)
  */
 
 #include <linux/config.h>
+#define __NO_VERSION__
 #include <linux/module.h>
 
 #include <linux/sched.h>
 #include <linux/msdos_fs.h>
+#include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/init.h>
-
-#include <asm/uaccess.h>
+#include <linux/malloc.h>
 
 #include "../fat/msbuffer.h"
-#include "../fat/tables.h"
 
 #if 0
 # define PRINTK(x) printk x
@@ -79,13+78,30 @@ static struct super_operations vfat_sops = {
        NULL  /* remount */
 };
 
+static int simple_getbool(char *s, int *setval)
+{
+       if (s) {
+               if (!strcmp(s,"1") || !strcmp(s,"yes") || !strcmp(s,"true")) {
+                       *setval = 1;
+               } else if (!strcmp(s,"0") || !strcmp(s,"no") || !strcmp(s,"false")) {
+                       *setval = 0;
+               } else {
+                       return 0;
+               }
+       } else {
+               *setval = 1;
+       }
+       return 1;
+}
+
 static int parse_options(char *options,        struct fat_mount_options *opts)
 {
        char *this_char,*value,save,*savep;
-       int ret;
+       int ret, val;
 
        opts->unicode_xlate = opts->posixfs = 0;
        opts->numtail = 1;
+       opts->utf8 = 0;
 
        if (!options) return 1;
        save = 0;
@@ -97,25+113,19 @@ static int parse_options(char *options,    struct fat_mount_options *opts)
                        savep = value;
                        *value++ = 0;
                }
-               if (!strcmp(this_char,"uni_xlate")) {
-                       if (value) {
-                               ret = 0;
-                       } else {
-                               opts->unicode_xlate = 1;
-                       }
-               }
-               else if (!strcmp(this_char,"posix")) {
-                       if (value) {
-                               ret = 0;
-                       } else {
-                               opts->posixfs = 1;
-                       }
-               }
-               else if (!strcmp(this_char,"nonumtail")) {
-                       if (value) {
-                               ret = 0;
-                       } else {
-                               opts->numtail = 0;
+               if (!strcmp(this_char,"utf8")) {
+                       ret = simple_getbool(value, &val);
+                       if (ret) opts->utf8 = val;
+               } else if (!strcmp(this_char,"uni_xlate")) {
+                       ret = simple_getbool(value, &val);
+                       if (ret) opts->unicode_xlate = val;
+               } else if (!strcmp(this_char,"posix")) {
+                       ret = simple_getbool(value, &val);
+                       if (ret) opts->posixfs = val;
+               } else if (!strcmp(this_char,"nonumtail")) {
+                       ret = simple_getbool(value, &val);
+                       if (ret) {
+                               opts->numtail = !val;
                        }
                }
                if (this_char != options)
@@ -127,6+137,9 @@ static int parse_options(char *options,     struct fat_mount_options *opts)
                        return 0;
                }
        }
+       if (opts->unicode_xlate) {
+               opts->utf8 = 0;
+       }
        return 1;
 }
 
@@ -137,6+150,8 @@ struct super_block *vfat_read_super(struct super_block *sb,void *data,
   
        MOD_INC_USE_COUNT;
        
+       MSDOS_SB(sb)->options.isvfat = 1;
+
        sb->s_op = &vfat_sops;
        res = fat_read_super(sb, data, silent);
        if (res == NULL) {
@@ -148,7+163,6 @@ struct super_block *vfat_read_super(struct super_block *sb,void *data,
        if (!parse_options((char *) data, &(MSDOS_SB(sb)->options))) {
                MOD_DEC_USE_COUNT;
        } else {
-               MSDOS_SB(sb)->options.isvfat = 1;
                MSDOS_SB(sb)->options.dotsOK = 0;
        }
 
@@ -225,7+239,6 @@ static const char *reserved_names[] = {
 /* Characters that are undesirable in an MS-DOS file name */
 
 static char bad_chars[] = "*?<>|\":/\\";
-static char bad_if_strict[] = "+=,; []";
 static char replace_chars[] = "[];,+=";
 
 static int vfat_find(struct inode *dir,struct qstr* name,
@@ -265,8+278,8 @@ static int vfat_valid_longname(const char *name, int len, int dot_dirs,
        return 0;
 }
 
-static int vfat_valid_shortname(char conv,const char *name,int len,
-                                int dot_dirs)
+static int vfat_valid_shortname(const char *name,int len,
+                               int dot_dirs, int utf8)
 {
        const char *walk, **reserved;
        unsigned char c;
@@ -283,17+296,17 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
        for (walk = name; len && walk-name < 8;) {
                c = *walk++;
                len--;
-               if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-               if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL;
-               if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL;
-               if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+               if (utf8 && (c & 0x80)) return -EINVAL;
+               if (strchr(bad_chars,c)) return -EINVAL;
+               if (strchr(replace_chars,c)) return -EINVAL;
+               if (c >= 'A' && c <= 'Z') return -EINVAL;
                if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
                if ((walk == name) && (c == 0xE5)) c = 0x05;
                if (c == '.') break;
                space = c == ' ';
        }
        if (space) return -EINVAL;
-       if ((conv == 's' || conv == 'x') && len && c != '.') {
+       if (len && c != '.') {
                c = *walk++;
                len--;
                if (c != '.') return -EINVAL;
@@ -304,18+317,17 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
                while (len > 0 && walk-name < (MSDOS_NAME+1)) {
                        c = *walk++;
                        len--;
-                       if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-                       if (conv == 's' && strchr(bad_if_strict,c))
-                               return -EINVAL;
-                       if (conv == 'x' && strchr(replace_chars,c))
+                       if (utf8 && (c & 0x80)) return -EINVAL;
+                       if (strchr(bad_chars,c)) return -EINVAL;
+                       if (strchr(replace_chars,c))
                                return -EINVAL;
                        if (c < ' ' || c == ':' || c == '\\' || c == '.')
                                return -EINVAL;
-                       if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+                       if (c >= 'A' && c <= 'Z') return -EINVAL;
                        space = c == ' ';
                }
                if (space) return -EINVAL;
-               if ((conv == 's' || conv == 'x') && len) return -EINVAL;
+               if (len) return -EINVAL;
        }
        for (reserved = reserved_names; *reserved; reserved++)
                if (!strncmp(name,*reserved,8)) return -EINVAL;
@@ -328,8+340,8 @@ static int vfat_valid_shortname(char conv,const char *name,int len,
  * returned.  The formatted short filename is returned in 'res'.
  */
 
-static int vfat_format_name(char conv,const char *name,int len,char *res,
-  int dot_dirs)
+static int vfat_format_name(const char *name,int len,char *res,
+  int dot_dirs,int utf8)
 {
        char *walk;
        const char **reserved;
@@ -349,17+361,17 @@ static int vfat_format_name(char conv,const char *name,int len,char *res,
        for (walk = res; len && walk-res < 8; walk++) {
                c = *name++;
                len--;
-               if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-               if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL;
-               if (conv == 'x' && strchr(replace_chars,c)) return -EINVAL;
-               if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+               if (utf8 && (c & 0x80)) return -EINVAL;
+               if (strchr(bad_chars,c)) return -EINVAL;
+               if (strchr(replace_chars,c)) return -EINVAL;
+               if (c >= 'A' && c <= 'Z') return -EINVAL;
                if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
                if (c == '.') break;
                space = c == ' ';
                *walk = c >= 'a' && c <= 'z' ? c-32 : c;
        }
        if (space) return -EINVAL;
-       if ((conv == 's' || conv == 'x') && len && c != '.') {
+       if (len && c != '.') {
                c = *name++;
                len--;
                if (c != '.') return -EINVAL;
@@ -370,19+382,18 @@ static int vfat_format_name(char conv,const char *name,int len,char *res,
                while (len > 0 && walk-res < MSDOS_NAME) {
                        c = *name++;
                        len--;
-                       if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-                       if (conv == 's' && strchr(bad_if_strict,c))
-                               return -EINVAL;
-                       if (conv == 'x' && strchr(replace_chars,c))
+                       if (utf8 && (c & 0x80)) return -EINVAL;
+                       if (strchr(bad_chars,c)) return -EINVAL;
+                       if (strchr(replace_chars,c))
                                return -EINVAL;
                        if (c < ' ' || c == ':' || c == '\\' || c == '.')
                                return -EINVAL;
-                       if (c >= 'A' && c <= 'Z' && (conv == 's' || conv == 'x')) return -EINVAL;
+                       if (c >= 'A' && c <= 'Z') return -EINVAL;
                        space = c == ' ';
                        *walk++ = c >= 'a' && c <= 'z' ? c-32 : c;
                }
                if (space) return -EINVAL;
-               if ((conv == 's' || conv == 'x') && len) return -EINVAL;
+               if (len) return -EINVAL;
        }
        while (walk-res < MSDOS_NAME) *walk++ = ' ';
        for (reserved = reserved_names; *reserved; reserved++)
@@ -397,7+408,7 @@ static char skip_chars[] = ".:\"?<>| ";
  * shortname does not exist
  */
 static int vfat_create_shortname(struct inode *dir, const char *name,
-     int len, char *name_res)
+     int len, char *name_res, int utf8)
 {
        const char *ip, *ext_start, *end;
        char *p;
@@ -417,16+428,25 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
        if (len && name[len-1]==' ') return -EINVAL;
        if (len <= 12) {
                /* Do a case insensitive search if the name would be a valid
-                * shortname if is were all capitalized */
+                * shortname if is were all capitalized.  However, do not
+                * allow spaces in short names because Win95 scandisk does
+                * not like that */
+               res = 0;
                for (i = 0, p = msdos_name, ip = name; i < len; i++, p++, ip++)
                {
+                       if (*ip == ' ') {
+                               res = -1;
+                               break;
+                       }
                        if (*ip >= 'A' && *ip <= 'Z') {
                                *p = *ip + 32;
                        } else {
                                *p = *ip;
                        }
                }
-               res = vfat_format_name('x', msdos_name, len, name_res, 1);
+               if (res == 0) {
+                       res = vfat_format_name(msdos_name, len, name_res, 1, utf8);
+               }
                if (res > -1) {
                        PRINTK(("vfat_create_shortname 1\n"));
                        qname.name=msdos_name;
@@ -476,7+496,10 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
 
        for (baselen = i = 0, p = base, ip = name; i < sz && baselen < 8; i++)
        {
-               if (!strchr(skip_chars, *ip)) {
+               if (utf8 && (*ip & 0x80)) {
+                       *p++ = '_';
+                       baselen++;
+               } else if (!strchr(skip_chars, *ip)) {
                        if (*ip >= 'A' && *ip <= 'Z') {
                                *p = *ip + 32;
                        } else {
@@ -496,7+519,10 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
        if (ext_start) {
                extlen = 0;
                for (p = ext, ip = ext_start; extlen < 3 && ip < end; ip++) {
-                       if (!strchr(skip_chars, *ip)) {
+                       if (utf8 && (*ip & 0x80)) {
+                               *p++ = '_';
+                               extlen++;
+                       } else if (!strchr(skip_chars, *ip)) {
                                if (*ip >= 'A' && *ip <= 'Z') {
                                        *p = *ip + 32;
                                } else {
@@ -547,7+573,7 @@ static int vfat_create_shortname(struct inode *dir, const char *name,
                qname.len=totlen;
                res = vfat_find(dir, &qname, 0, 0, 0, &sinfo);
        }
-       res = vfat_format_name('x', msdos_name, totlen, name_res, 1);
+       res = vfat_format_name(msdos_name, totlen, name_res, 1, utf8);
        return res;
 }
 
@@ -596,7+622,9 @@ static loff_t vfat_find_free_slots(struct inode *dir,int slots)
                        ino = fat_get_entry(dir,&curr,&bh,&de);
                }
 
-               if (dir->i_ino == MSDOS_ROOT_INO) return -ENOSPC;
+               if ((dir->i_ino == MSDOS_ROOT_INO) &&
+                   (MSDOS_SB(sb)->fat_bits != 32)) 
+                       return -ENOSPC;
                if ((res = fat_add_cluster(dir)) < 0) return res;
                ino = fat_get_entry(dir,&curr,&bh,&de);
        }
@@ -605,7+633,8 @@ static loff_t vfat_find_free_slots(struct inode *dir,int slots)
 
 /* Translate a string, including coded sequences into Unicode */
 static int
-xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
+xlate_to_uni(const char *name, int len, char *outname, int *outlen,
+            int escape, int utf8, struct nls_table *nls)
 {
        int i;
        const unsigned char *ip;
@@ -613,22+642,43 @@ xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
        int fill;
        unsigned char c1, c2, c3;
 
-       op = outname;
-       for (i = 0, ip = name, op = outname, *outlen = 0;
-            i < len && *outlen <= 260; i++, *outlen += 1)
-       {
-               if (escape && (i < len - 4) && 
-                   (*ip == ':') &&
-                   ((c1 = fat_code2uni[ip[1]]) != 255) &&
-                   ((c2 = fat_code2uni[ip[2]]) != 255) &&
-                   ((c3 = fat_code2uni[ip[3]]) != 255)) {
-                       *op++ = (c1 << 4) + (c2 >> 2);
-                       *op++ = ((c2 & 0x3) << 6) + c3;
-                       ip += 4;
+       if (utf8) {
+               *outlen = utf8_mbstowcs((__u16 *) outname, name, PAGE_SIZE);
+               if (name[len-1] == '.')
+                       *outlen-=2;
+               op = &outname[*outlen * sizeof(__u16)];
+       } else {
+               if (name[len-1] == '.') 
+                       len--;
+               op = outname;
+               if (nls) {
+                       /* XXX: i is incorrectly computed. */
+                       for (i = 0, ip = name, op = outname, *outlen = 0;
+                            i < len && *outlen <= 260; i++, *outlen += 1)
+                       {
+                               if (escape && (*ip == ':')) {
+                                       if (i > len - 4) return -EINVAL;
+                                       c1 = fat_esc2uni[ip[1]];
+                                       c2 = fat_esc2uni[ip[2]];
+                                       c3 = fat_esc2uni[ip[3]];
+                                       if (c1 == 255 || c2 == 255 || c3 == 255)
+                                               return -EINVAL;
+                                       *op++ = (c1 << 4) + (c2 >> 2);
+                                       *op++ = ((c2 & 0x3) << 6) + c3;
+                                       ip += 4;
+                               } else {
+                                       *op++ = nls->charset2uni[*ip].uni1;
+                                       *op++ = nls->charset2uni[*ip].uni2;
+                                       ip++;
+                               }
+                       }
                } else {
-                       *op++ = fat_a2uni[*ip].uni1;
-                       *op++ = fat_a2uni[*ip].uni2;
-                       ip++;
+                       for (i = 0, ip = name, op = outname, *outlen = 0;
+                            i < len && *outlen <= 260; i++, *outlen += 1)
+                       {
+                               *op++ = *ip++;
+                               *op++ = 0;
+                       }
                }
        }
        if (*outlen > 260)
@@ -653,7+703,8 @@ xlate_to_uni(const char *name, int len, char *outname, int *outlen, int escape)
 
 static int
 vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
-                    char *msdos_name, int *slots, int uni_xlate)
+                    char *msdos_name, int *slots,
+                    int uni_xlate, int utf8, struct nls_table *nls)
 {
        struct msdos_dir_slot *ps;
        struct msdos_dir_entry *de;
@@ -667,10+718,11 @@ vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
        int i;
        loff_t offset;
 
+       if (name[len-1] == '.') len--;
        if(!(page = __get_free_page(GFP_KERNEL)))
                return -ENOMEM;
        uniname = (char *) page;
-       res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate);
+       res = xlate_to_uni(name, len, uniname, &unilen, uni_xlate, utf8, nls);
        if (res < 0) {
                free_page(page);
                return res;
@@ -690,8+742,7 @@ vfat_fill_long_slots(struct msdos_dir_slot *ds, const char *name, int len,
                ps->attr = ATTR_EXT;
                ps->reserved = 0;
                ps->alias_checksum = cksum;
-               ps->start[0] = 0;
-               ps->start[1] = 0;
+               ps->start = 0;
                PRINTK(("vfat_fill_long_slots 5: uniname=%s\n",uniname));
                offset = (slot - 1) * 26;
                ip = &uniname[offset];
@@ -728,11+779,14 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
 {
        struct msdos_dir_entry *de;
        char msdos_name[MSDOS_NAME];
-       int res, xlate;
+       int res, xlate, utf8;
+       struct nls_table *nls;
 
        PRINTK(("Entering vfat_build_slots: name=%s, len=%d\n", name, len));
        de = (struct msdos_dir_entry *) ds;
        xlate = MSDOS_SB(dir->i_sb)->options.unicode_xlate;
+       utf8 = MSDOS_SB(dir->i_sb)->options.utf8;
+       nls = MSDOS_SB(dir->i_sb)->nls_io;
 
        *slots = 1;
        *is_long = 0;
@@ -742,13+796,13 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
                strncpy(de->name, MSDOS_DOT, MSDOS_NAME);
        } else {
                PRINTK(("vfat_build_slots 4\n"));
-               res = vfat_valid_shortname('x', name, len, 1);
+               res = vfat_valid_shortname(name, len, 1, utf8);
                if (res > -1) {
                        PRINTK(("vfat_build_slots 5a\n"));
-                       res = vfat_format_name('x', name, len, de->name, 1);
+                       res = vfat_format_name(name, len, de->name, 1, utf8);
                        PRINTK(("vfat_build_slots 5b\n"));
                } else {
-                       res = vfat_create_shortname(dir, name, len, msdos_name);
+                       res = vfat_create_shortname(dir, name, len, msdos_name, utf8);
                        if (res < 0) {
                                return res;
                        }
@@ -761,7+815,7 @@ static int vfat_build_slots(struct inode *dir,const char *name,int len,
                        *is_long = 1;
 
                        return vfat_fill_long_slots(ds, name, len, msdos_name,
-                                                   slots, xlate);
+                                                   slots, xlate, utf8, nls);
                }
        }
        return 0;
@@ -787,8+841,11 @@ static int vfat_readdir_cb(
                          vf->name, vf->len, name, name_len);
 #endif
 
+       /* Filenames cannot end in '.' or we treat like it has none */
        if (vf->len != name_len) {
-               return 0;
+               if ((vf->len != name_len + 1) || (vf->name[name_len] != '.')) {
+                       return 0;
+               }
        }
 
        s1 = name; s2 = vf->name;
@@ -821,12+878,17 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
        struct msdos_dir_entry *de;
        struct msdos_dir_slot *ps;
        loff_t offset;
-       struct msdos_dir_slot ds[MSDOS_SLOTS];
+       struct msdos_dir_slot *ds;
        int is_long;
        int slots, slot;
        int res;
 
        PRINTK(("Entering vfat_find\n"));
+
+       ds = (struct msdos_dir_slot *)
+           kmalloc(sizeof(struct msdos_dir_slot)*MSDOS_SLOTS, GFP_KERNEL);
+       if (ds == NULL) return -ENOMEM;
+
        fil.f_pos = 0;
        vf.name = qname->name;
        vf.len = qname->len;
@@ -835,10+897,11 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
        vf.posix = MSDOS_SB(sb)->options.posixfs;
        res = fat_readdirx(dir,&fil,(void *)&vf,vfat_readdir_cb,NULL,1,find_long,0);
        PRINTK(("vfat_find: Debug 1\n"));
-       if (res < 0) return res;
+       if (res < 0) goto cleanup;
        if (vf.found) {
                if (new_filename) {
-                       return -EEXIST;
+                       res = -EEXIST;
+                       goto cleanup;
                }
                sinfo_out->longname_offset = vf.offset;
                sinfo_out->shortname_offset = vf.short_offset;
@@ -848,16+911,19 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
                sinfo_out->ino = vf.ino;
 
                PRINTK(("vfat_find: Debug 2\n"));
-               return 0;
+               res = 0;
+               goto cleanup;
        }
 
        PRINTK(("vfat_find: Debug 3\n"));
-       if (!vf.found && !new_filename)
-               return -ENOENT;
+       if (!vf.found && !new_filename) {
+               res = -ENOENT;
+               goto cleanup;
+       }
        
        res = vfat_build_slots(dir, qname->name, qname->len, ds, 
                               &slots, &is_long);
-       if (res < 0) return res;
+       if (res < 0) goto cleanup;
 
        de = (struct msdos_dir_entry *) ds;
 
@@ -867,7+933,8 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
                if (is_long) slots++;
                offset = vfat_find_free_slots(dir, slots);
                if (offset < 0) {
-                       return offset;
+                       res = offset;
+                       goto cleanup;
                }
 
                PRINTK(("vfat_find: create file 2\n"));
@@ -878,7+945,8 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
                        sinfo_out->ino = fat_get_entry(dir,&offset,&bh,&de);
                        if (sinfo_out->ino < 0) {
                                PRINTK(("vfat_find: problem\n"));
-                               return sinfo_out->ino;
+                               res = sinfo_out->ino;
+                               goto cleanup;
                        }
                        memcpy(de, ps, sizeof(struct msdos_dir_slot));
                        fat_mark_buffer_dirty(sb, bh, 1);
@@ -890,12+958,12 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
 
                PRINTK(("vfat_find: create file 5\n"));
 
-               memset(de->unused, 0, sizeof(de->unused));
                fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
                de->ctime_ms = 0;
                de->ctime = de->time;
                de->adate = de->cdate = de->date;
                de->start = 0;
+               de->starthi = 0;
                de->size = 0;
                de->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
                de->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT;
@@ -913,10+981,15 @@ static int vfat_find(struct inode *dir,struct qstr* qname,
                sinfo_out->total_slots = slots;
                sinfo_out->shortname_offset = offset - sizeof(struct msdos_dir_slot);
                sinfo_out->longname_offset = offset - sizeof(struct msdos_dir_slot) * slots;
+               res = 0;
                return 0;
+       } else {
+               res = -ENOENT;
        }
 
-       return -ENOENT;
+cleanup:
+       kfree(ds);
+       return res;
 }
 
 int vfat_lookup(struct inode *dir,struct dentry *dentry)
@@ -1040,10+1113,10 @@ static int vfat_create_a_dotdir(struct inode *dir,struct inode *parent,
        dir->i_atime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        mark_inode_dirty(dir);
        memcpy(de->name,name,MSDOS_NAME);
-       memset(de->unused, 0, sizeof(de->unused));
        de->lcase = 0;
        de->attr = ATTR_DIR;
        de->start = 0;
+       de->starthi = 0;
        fat_date_unix2dos(dir->i_mtime,&de->time,&de->date);
        de->ctime_ms = 0;
        de->ctime = de->time;
@@ -1058,10+1131,12 @@ static int vfat_create_a_dotdir(struct inode *dir,struct inode *parent,
        if (isdot) {
                dot->i_size = dir->i_size;
                MSDOS_I(dot)->i_start = MSDOS_I(dir)->i_start;
+               MSDOS_I(dot)->i_logstart = MSDOS_I(dir)->i_logstart;
                dot->i_nlink = dir->i_nlink;
        } else {
                dot->i_size = parent->i_size;
                MSDOS_I(dot)->i_start = MSDOS_I(parent)->i_start;
+               MSDOS_I(dot)->i_logstart = MSDOS_I(parent)->i_logstart;
                dot->i_nlink = parent->i_nlink;
        }
 
@@ -1244,10+1319,8 @@ static int vfat_rmdirx(struct inode *dir,struct dentry* dentry)
                if (res > 0) {
                        res = 0;
                }
-       } else {
-               printk("Problem in vfat_rmdirx\n");
+               dir->i_version = ++event;
        }
-       dir->i_version = ++event;
 
 rmdir_done:
        fat_brelse(sb, bh);
@@ -1275,19+1348,15 @@ static int vfat_unlinkx(
        struct slot_info sinfo;
 
        bh = NULL;
-       if ((res = vfat_find(dir,&dentry->d_name,1,0,0,&sinfo)) < 0)
-               goto unlink_done;
+       res = vfat_find(dir,&dentry->d_name,1,0,0,&sinfo);
 
        if (res >= 0 && sinfo.total_slots > 0) {
                res = vfat_remove_entry(dir,&sinfo,&bh,dentry,0,nospc);
                if (res > 0) {
                        res = 0;
                }
-       } else {
-               printk("Problem in vfat_unlinkx: res=%d, total_slots=%d\n",res, sinfo.total_slots);
        }
 
-unlink_done:
        fat_brelse(sb, bh);
        return res;
 }
@@ -1329,7+1398,16 @@ int vfat_unlink(struct inode *dir,struct dentry* dentry)
        return res;
 }
 
+/***** Unlink, as called for uvfatfs */
+int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry)
+{
+       int res;
 
+       res = vfat_unlinkx (dir,dentry,0);
+       iput(dir);
+       return res;
+}
 int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
                struct inode *new_dir,struct dentry *new_dentry)
 {
@@ -1417,10+1495,13 @@ int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
                        PRINTK(("vfat_rename 8\n"));
                        if (res < 0) goto rename_done;
                } else {
-                       PRINTK(("vfat_rename 9\n"));
-                       res = vfat_unlinkx(new_dir,new_dentry,1);
-                       PRINTK(("vfat_rename 10\n"));
-                       if (res < 0) goto rename_done;
+                       /* Is this the same file, different case? */
+                       if (new_inode != old_inode) {
+                               PRINTK(("vfat_rename 9\n"));
+                               res = vfat_unlinkx(new_dir,new_dentry,1);
+                               PRINTK(("vfat_rename 10\n"));
+                               if (res < 0) goto rename_done;
+                       }
                }
        }
 
@@ -1444,6+1525,7 @@ int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
        new_de->cdate = old_de->cdate;
        new_de->adate = old_de->adate;
        new_de->start = old_de->start;
+       new_de->starthi = old_de->starthi;
        new_de->size = old_de->size;
 
        if (!(new_inode = iget(new_dir->i_sb,new_ino))) goto rename_done;
@@ -1492,8+1574,10 @@ int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
                        res = -EIO;
                        goto rename_done;
                }
-               dotdot_de->start = MSDOS_I(dotdot_inode)->i_start =
-                   MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_start = MSDOS_I(new_dir)->i_start;
+               MSDOS_I(dotdot_inode)->i_logstart = MSDOS_I(new_dir)->i_logstart;
+               dotdot_de->start = CT_LE_W(MSDOS_I(new_dir)->i_logstart);
+               dotdot_de->starthi = CT_LE_W((MSDOS_I(new_dir)->i_logstart) >> 16);
                mark_inode_dirty(dotdot_inode);
                fat_mark_buffer_dirty(sb, dotdot_bh, 1);
                old_dir->i_nlink--;
@@ -1547,28+1631,6 @@ void vfat_read_inode(struct inode *inode)
        fat_read_inode(inode, &vfat_dir_inode_operations);
 }
 
-static struct file_system_type vfat_fs_type = {
-       "vfat",
-       FS_REQUIRES_DEV,
-       vfat_read_super,
-       NULL
-};
-
-EXPORT_SYMBOL(vfat_create);
-EXPORT_SYMBOL(vfat_unlink);
-EXPORT_SYMBOL(vfat_mkdir);
-EXPORT_SYMBOL(vfat_rmdir);
-EXPORT_SYMBOL(vfat_rename);
-EXPORT_SYMBOL(vfat_put_super);
-EXPORT_SYMBOL(vfat_read_super);
-EXPORT_SYMBOL(vfat_read_inode);
-EXPORT_SYMBOL(vfat_lookup);
-
-__initfunc(int init_vfat_fs(void))
-{
-       return register_filesystem(&vfat_fs_type);
-}
-
 #ifdef MODULE
 int init_module(void)
 {
diff --git a/fs/vfat/vfatfs_syms.c b/fs/vfat/vfatfs_syms.c
new file mode 100644 (file)
index 0000000..739d8ea
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * linux/fs/msdos/vfatfs_syms.c
+ *
+ * Exported kernel symbols for the VFAT filesystem.
+ * These symbols are used by dmsdos.
+ */
+
+#define ASC_LINUX_VERSION(V, P, S)     (((V) * 65536) + ((P) * 256) + (S))
+#include <linux/version.h>
+#include <linux/module.h>
+
+#include <linux/mm.h>
+#include <linux/msdos_fs.h>
+
+struct file_system_type vfat_fs_type = {
+       "vfat",
+       FS_REQUIRES_DEV,
+       vfat_read_super,
+       NULL
+};
+
+EXPORT_SYMBOL(vfat_create);
+EXPORT_SYMBOL(vfat_unlink);
+EXPORT_SYMBOL(vfat_unlink_uvfat);
+EXPORT_SYMBOL(vfat_mkdir);
+EXPORT_SYMBOL(vfat_rmdir);
+EXPORT_SYMBOL(vfat_rename);
+EXPORT_SYMBOL(vfat_put_super);
+EXPORT_SYMBOL(vfat_read_super);
+EXPORT_SYMBOL(vfat_read_inode);
+EXPORT_SYMBOL(vfat_lookup);
+
+int init_vfat_fs(void)
+{
+       return register_filesystem(&vfat_fs_type);
+}
+
index a32bb72..b33e93d 100644 (file)
 #define __NR_pciconfig_write           346
 #define __NR_query_module              347
 #define __NR_prctl                     348
+#define __NR_pread                     349
+#define __NR_pwrite                    350
 
 #if defined(__LIBRARY__) && defined(__GNUC__)
 
index 7feef8a..c6a15bb 100644 (file)
@@ -58,7+58,7 @@ extern int init_misc_binfmt(void);
 extern int prepare_binprm(struct linux_binprm *);
 extern void remove_arg_zero(struct linux_binprm *);
 extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
-extern void flush_old_exec(struct linux_binprm * bprm);
+extern int flush_old_exec(struct linux_binprm * bprm);
 extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
 extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
                unsigned long p, int from_kmem);
index 7654b2f..34a54bc 100644 (file)
@@ -109,6+109,12 @@ extern int d_invalidate(struct dentry *);
 
 #define shrink_dcache() prune_dcache(0)
 
+/* dcache memory management */
+extern int  select_dcache(int, int);
+extern void shrink_dcache_memory(void);
+extern void check_dcache_memory(void);
+extern void free_inode_memory(int);    /* defined in fs/inode.c */
+
 /* only used at mount-time */
 extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);
 
index c9c985f..2fd95be 100644 (file)
@@ -438,8+438,8 @@ extern void posix_unblock_lock(struct file_lock *);
 
 extern int locks_mandatory_locked(struct inode *inode);
 extern int locks_mandatory_area(int read_write, struct inode *inode,
-                               struct file *filp, unsigned int offset,
-                               unsigned int count);
+                               struct file *filp, loff_t offset,
+                               size_t count);
 
 extern inline int locks_verify_locked(struct inode *inode)
 {
@@ -451,9+451,10 @@ extern inline int locks_verify_locked(struct inode *inode)
                return (locks_mandatory_locked(inode));
        return (0);
 }
+
 extern inline int locks_verify_area(int read_write, struct inode *inode,
-                                   struct file *filp, unsigned int offset,
-                                   unsigned int count)
+                                   struct file *filp, loff_t offset,
+                                   size_t count)
 {
        /* Candidates for mandatory locking have the setgid bit set
         * but no group execute bit -  an otherwise meaningless combination.
@@ -533,9+534,9 @@ struct super_block {
 typedef int (*filldir_t)(void *, const char *, int, off_t, ino_t);
        
 struct file_operations {
-       long long (*llseek) (struct file *, long long, int);
-       long (*read) (struct inode *, struct file *, char *, unsigned long);
-       long (*write) (struct inode *, struct file *, const char *, unsigned long);
+       loff_t (*llseek) (struct file *, loff_t, int);
+       ssize_t (*read) (struct file *, char *, size_t, loff_t *);
+       ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
        int (*readdir) (struct file *, void *, filldir_t);
        unsigned int (*poll) (struct file *, poll_table *);
        int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
@@ -643,8+644,6 @@ extern struct file_operations rdwr_pipe_fops;
 
 extern struct file_system_type *get_fs_type(const char *name);
 
-extern int fs_may_mount(kdev_t dev);
-extern int fs_may_umount(struct super_block *, struct dentry * root);
 extern int fs_may_remount_ro(struct super_block *);
 
 extern struct file *inuse_filps;
@@ -745,32+744,23 @@ extern inline void vfs_unlock(void)
 #endif
 }
 
-/* Not to be used by ordinary vfs users */
-extern void _get_inode(struct inode * inode);
-extern void iput(struct inode * inode);
-
-extern struct inode * iget(struct super_block * sb, unsigned long nr);
-extern void clear_inode(struct inode * inode);
+extern void iput(struct inode *);
+extern struct inode * iget(struct super_block *, unsigned long);
+extern void clear_inode(struct inode *);
 extern struct inode * get_empty_inode(void);
 
-/* Please prefer to use this function in future, instead of using
- * a get_empty_inode()/insert_inode_hash() combination.
- * It allows for better checking and less race conditions.
- */
-extern struct inode * get_empty_inode_hashed(dev_t i_dev, unsigned long i_ino);
-
 extern void insert_inode_hash(struct inode *);
 extern int get_unused_fd(void);
 extern void put_unused_fd(int);
 extern struct file * get_empty_filp(void);
-extern int close_fp(struct file *filp);
-extern struct buffer_head * get_hash_table(kdev_t dev, int block, int size);
-extern struct buffer_head * getblk(kdev_t dev, int block, int size);
-extern void ll_rw_block(int rw, int nr, struct buffer_head * bh[]);
-extern void ll_rw_page(int rw, kdev_t dev, unsigned long nr, char * buffer);
-extern void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char *buffer);
-extern int is_read_only(kdev_t dev);
-extern void __brelse(struct buffer_head *buf);
+extern int close_fp(struct file *);
+extern struct buffer_head * get_hash_table(kdev_t, int, int);
+extern struct buffer_head * getblk(kdev_t, int, int);
+extern void ll_rw_block(int, int, struct buffer_head * bh[]);
+extern void ll_rw_page(int, kdev_t, unsigned long, char *);
+extern void ll_rw_swap_file(int, kdev_t, unsigned int *, int, char *);
+extern int is_read_only(kdev_t);
+extern void __brelse(struct buffer_head *);
 extern inline void brelse(struct buffer_head *buf)
 {
        if (buf)
@@ -792,8+782,8 @@ extern int brw_page(int, struct page *, kdev_t, int [], int, int);
 
 extern int generic_readpage(struct inode *, struct page *);
 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
-extern long generic_file_read(struct inode *, struct file *, char *, unsigned long);
-extern long generic_file_write(struct inode *, struct file *, const char *, unsigned long);
+extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
+extern ssize_t generic_file_write(struct file *, const char*, size_t, loff_t*);
 
 extern struct super_block *get_super(kdev_t dev);
 extern void put_super(kdev_t dev);
@@ -809,19+799,16 @@ extern kdev_t real_root_dev;
 extern int change_root(kdev_t new_root_dev,const char *put_old);
 #endif
 
-extern long char_read(struct inode *, struct file *, char *, unsigned long);
-extern long block_read(struct inode *, struct file *, char *, unsigned long);
+extern ssize_t char_read(struct file *, char *, size_t, loff_t *);
+extern ssize_t block_read(struct file *, char *, size_t, loff_t *);
 extern int read_ahead[];
 
-extern long char_write(struct inode *, struct file *, const char *, unsigned long);
-extern long block_write(struct inode *, struct file *, const char *, unsigned long);
+extern ssize_t char_write(struct file *, const char *, size_t, loff_t *);
+extern ssize_t block_write(struct file *, const char *, size_t, loff_t *);
 
 extern int block_fsync(struct file *, struct dentry *dir);
 extern int file_fsync(struct file *, struct dentry *dir);
 
-extern void dcache_add(struct inode *, const char *, int, unsigned long);
-extern int dcache_lookup(struct inode *, const char *, int, unsigned long *);
-
 extern int inode_change_ok(struct inode *, struct iattr *);
 extern void inode_setattr(struct inode *, struct iattr *);
 extern int notify_change(struct inode * inode, struct iattr * attr);
index 0996e2d..afd3338 100644 (file)
 #ifndef _LINUX_IN6_H
 #define _LINUX_IN6_H
 
+#include <linux/types.h>
 
 /*
  *     IPv6 address structure
index 708516a..b5eef44 100644 (file)
@@ -29,7+29,6 @@ extern unsigned long occupy_region(unsigned long base, unsigned long end,
 #endif
 
 #define HAVE_AUTOIRQ
-extern void *irq2dev_map[16];          /* Use only if you own the IRQ. */
 extern void autoirq_setup(int waittime);
 extern int autoirq_report(int waittime);
 
index 011edfe..a8a3cbe 100644 (file)
@@ -19,6+19,7 @@ struct iso_volume_descriptor {
 
 /* volume descriptor types */
 #define ISO_VD_PRIMARY 1
+#define ISO_VD_SUPPLEMENTARY 2
 #define ISO_VD_END 255
 
 #define ISO_STANDARD_ID "CD001"
@@ -59,6+60,43 @@ struct iso_primary_descriptor {
        char unused5                    [ISODCL (1396, 2048)];
 };
 
+/* Almost the same as the primary descriptor but two fields are specified */
+struct iso_supplementary_descriptor {
+       char type                       [ISODCL (  1,   1)]; /* 711 */
+       char id                         [ISODCL (  2,   6)];
+       char version                    [ISODCL (  7,   7)]; /* 711 */
+       char flags                      [ISODCL (  8,   8)]; /* 853 */
+       char system_id                  [ISODCL (  9,  40)]; /* achars */
+       char volume_id                  [ISODCL ( 41,  72)]; /* dchars */
+       char unused2                    [ISODCL ( 73,  80)];
+       char volume_space_size          [ISODCL ( 81,  88)]; /* 733 */
+       char escape                     [ISODCL ( 89, 120)]; /* 856 */
+       char volume_set_size            [ISODCL (121, 124)]; /* 723 */
+       char volume_sequence_number     [ISODCL (125, 128)]; /* 723 */
+       char logical_block_size         [ISODCL (129, 132)]; /* 723 */
+       char path_table_size            [ISODCL (133, 140)]; /* 733 */
+       char type_l_path_table          [ISODCL (141, 144)]; /* 731 */
+       char opt_type_l_path_table      [ISODCL (145, 148)]; /* 731 */
+       char type_m_path_table          [ISODCL (149, 152)]; /* 732 */
+       char opt_type_m_path_table      [ISODCL (153, 156)]; /* 732 */
+       char root_directory_record      [ISODCL (157, 190)]; /* 9.1 */
+       char volume_set_id              [ISODCL (191, 318)]; /* dchars */
+       char publisher_id               [ISODCL (319, 446)]; /* achars */
+       char preparer_id                [ISODCL (447, 574)]; /* achars */
+       char application_id             [ISODCL (575, 702)]; /* achars */
+       char copyright_file_id          [ISODCL (703, 739)]; /* 7.5 dchars */
+       char abstract_file_id           [ISODCL (740, 776)]; /* 7.5 dchars */
+       char bibliographic_file_id      [ISODCL (777, 813)]; /* 7.5 dchars */
+       char creation_date              [ISODCL (814, 830)]; /* 8.4.26.1 */
+       char modification_date          [ISODCL (831, 847)]; /* 8.4.26.1 */
+       char expiration_date            [ISODCL (848, 864)]; /* 8.4.26.1 */
+       char effective_date             [ISODCL (865, 881)]; /* 8.4.26.1 */
+       char file_structure_version     [ISODCL (882, 882)]; /* 711 */
+       char unused4                    [ISODCL (883, 883)];
+       char application_data           [ISODCL (884, 1395)];
+       char unused5                    [ISODCL (1396, 2048)];
+};
+
 
 #define HS_STANDARD_ID "CDROM"
 
@@ -142,11+180,13 @@ extern int isonum_733(char *);
 extern int iso_date(char *, int);
 
 extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *);
-extern int get_rock_ridge_filename(struct iso_directory_record *, char ** name, int * len, struct inode *);
+extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *);
 
 extern char * get_rock_ridge_symlink(struct inode *);
 extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *);
 
+int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *);
+
 /* The stuff that follows may be totally unneeded. I have not checked to see 
  which prototypes we are still using.  */
 
dissimilarity index 81%
index 25ebdb8..35bd292 100644 (file)
-#ifndef _ISOFS_FS_SB
-#define _ISOFS_FS_SB
-
-/*
- * iso9660 super-block data in memory
- */
-struct isofs_sb_info {
-                       unsigned long s_ninodes;
-                       unsigned long s_nzones;
-                       unsigned long s_firstdatazone;
-                       unsigned long s_log_zone_size;
-                       unsigned long s_max_size;
-
-                       unsigned char s_high_sierra; /* A simple flag */
-                       unsigned char s_mapping;
-                       unsigned char s_conversion;
-                       unsigned char s_rock;
-                       unsigned char s_name_check; /* r = relaxed, s = strict */
-                       unsigned char s_cruft; /* Broken disks with high
-                                                 byte of length containing
-                                                 junk */
-                       unsigned char s_unhide;
-                       unsigned char s_nosuid;
-                       unsigned char s_nodev;
-                       mode_t s_mode;
-                       gid_t s_gid;
-                       uid_t s_uid;
-};
-
-#endif
-
-
-
-
-
-
-
+#ifndef _ISOFS_FS_SB
+#define _ISOFS_FS_SB
+
+/*
+ * iso9660 super-block data in memory
+ */
+struct isofs_sb_info {
+       unsigned long s_ninodes;
+       unsigned long s_nzones;
+       unsigned long s_firstdatazone;
+       unsigned long s_log_zone_size;
+       unsigned long s_max_size;
+       
+       unsigned char s_high_sierra; /* A simple flag */
+       unsigned char s_mapping;
+       unsigned char s_conversion;
+       unsigned char s_rock;
+       unsigned char s_joliet_level;
+       unsigned char s_utf8;
+       unsigned char s_name_check; /* r = relaxed, s = strict */
+       unsigned char s_cruft; /* Broken disks with high
+                                 byte of length containing
+                                 junk */
+       unsigned char s_unhide;
+       unsigned char s_nosuid;
+       unsigned char s_nodev;
+       mode_t s_mode;
+       gid_t s_gid;
+       uid_t s_uid;
+       struct nls_table *s_nls_iocharset; /* Native language support table */
+};
+
+#endif
+
+
+
+
+
+
+
index 48fc78e..483aea5 100644 (file)
@@ -130,6+130,9 @@ struct module_info
 #define __MODULE_STRING_1(x)   #x
 #define __MODULE_STRING(x)     __MODULE_STRING_1(x)
 
+/* Find a symbol exported by the kernel or another module */
+extern unsigned long get_module_symbol(char *, char *);
+
 #if defined(MODULE) && !defined(__GENKSYMS__)
 
 /* Embedded module documentation macros.  */
index 08ab350..de0e47a 100644 (file)
 
 #define EOF_FAT12 0xFF8                /* standard EOF */
 #define EOF_FAT16 0xFFF8
-#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 16 ? 0xFFF8 : 0xFF8)
+#define EOF_FAT32 0xFFFFFF8
+#define EOF_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? EOF_FAT32 : \
+       MSDOS_SB(s)->fat_bits == 16 ? EOF_FAT16 : EOF_FAT12)
 
 /*
  * Inode flags
 /*
  * ioctl commands
  */
-#define        VFAT_IOCTL_READDIR_BOTH         _IOR('r', 1, long)
-#define        VFAT_IOCTL_READDIR_SHORT        _IOW('r', 2, long)
+#define        VFAT_IOCTL_READDIR_BOTH         _IOR('r', 1, struct dirent [2])
+#define        VFAT_IOCTL_READDIR_SHORT        _IOR('r', 2, struct dirent [2])
 
 /*
  * Conversion from and to little-endian byte order. (no-op on i386/i486)
 #define CT_LE_W(v) cpu_to_le16(v)
 #define CT_LE_L(v) cpu_to_le32(v)
 
-struct msdos_boot_sector {
+struct fat_boot_sector {
        __s8    ignored[3];     /* Boot strap short or near jump */
        __s8    system_id[8];   /* Name - can be used to special case
                                   partition manager volumes */
@@ -114,6+116,24 @@ struct msdos_boot_sector {
        __u16   heads;          /* number of heads */
        __u32   hidden;         /* hidden sectors (unused) */
        __u32   total_sect;     /* number of sectors (if sectors == 0) */
+
+       /* The following fields are only used by FAT32 */
+       __u32   fat32_length;   /* sectors/FAT */
+       __u16   flags;          /* bit 8: fat mirroring, low 4: active fat */
+       __u8    version[2];     /* major, minor filesystem version */
+       __u32   root_cluster;   /* first cluster in root directory */
+       __u16   info_sector;    /* filesystem info sector */
+       __u16   backup_boot;    /* backup boot sector */
+       __u16   reserved2[6];   /* Unused */
+};
+
+struct fat_boot_fsinfo {
+       __u32   reserved1;      /* Nothing as far as I can tell */
+       __u32   signature;      /* 0x61417272L */
+       __u32   free_clusters;  /* Free cluster count.  -1 if unknown */
+       __u32   next_cluster;   /* Most recently allocated cluster.
+                                * Unused under Linux. */
+       __u32   reserved2[4];
 };
 
 struct msdos_dir_entry {
@@ -124,7+144,7 @@ struct msdos_dir_entry {
        __u16   ctime;          /* Creation time */
        __u16   cdate;          /* Creation date */
        __u16   adate;          /* Last access date */
-       __u8    unused[2];
+       __u16   starthi;        /* High 16 bits of cluster in FAT32 */
        __u16   time,date,start;/* time, date and first cluster */
        __u32   size;           /* file size (in bytes) */
 };
@@ -137,7+157,7 @@ struct msdos_dir_slot {
        __u8    reserved;       /* always 0 */
        __u8    alias_checksum; /* checksum for 8.3 alias */
        __u8    name5_10[12];   /* 6 more characters in name */
-       __u8    start[2];       /* starting cluster number */
+       __u16   start;          /* starting cluster number, 0 in long slots */
        __u8    name11_12[4];   /* last 2 characters in name */
 };
 
@@ -190,6+210,7 @@ extern int fat_scan(struct inode *dir,const char *name,struct buffer_head **res_
                    struct msdos_dir_entry **res_de,int *ino,char scantype);
 extern int fat_parent_ino(struct inode *dir,int locked);
 extern int fat_subdirs(struct inode *dir);
+void fat_clusters_flush(struct super_block *sb);
 
 /* fat.c */
 extern int fat_access(struct super_block *sb,int nr,int new_value);
@@ -227,8+248,8 @@ extern int fat_dir_ioctl(struct inode * inode, struct file * filp,
 /* file.c */
 extern struct inode_operations fat_file_inode_operations;
 extern struct inode_operations fat_file_inode_operations_1024;
-extern long fat_file_read(struct inode *, struct file *, char *, unsigned long);
-extern long fat_file_write(struct inode *, struct file *, const char *, unsigned long);
+extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *);
+extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *);
 extern void fat_truncate(struct inode *inode);
 
 /* mmap.c */
@@ -257,12+278,30 @@ extern int msdos_unlink_umsdos(struct inode *dir,struct dentry *dentry);
 extern int msdos_rename(struct inode *old_dir,struct dentry *old_dentry,
                        struct inode *new_dir,struct dentry *new_dentry);
 
+/* nls.c */
+extern int init_fat_nls(void);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+
+/* tables.c */
+extern unsigned char fat_uni2esc[];
+extern unsigned char fat_esc2uni[];
+
 /* fatfs_syms.c */
 extern int init_fat_fs(void);
+extern void cleanup_fat_fs(void);
+
+/* nls.c */
+extern int fat_register_nls(struct fat_nls_table * fmt);
+extern int fat_unregister_nls(struct fat_nls_table * fmt);
+extern struct fat_nls_table *fat_find_nls(int codepage);
+extern struct fat_nls_table *fat_load_nls(int codepage);
+extern void fat_unload_nls(int codepage);
+extern int init_fat_nls(void);
 
 /* vfat/namei.c - these are for dmsdos */
 extern int vfat_create(struct inode *dir,struct dentry *dentry,int mode);
 extern int vfat_unlink(struct inode *dir,struct dentry *dentry);
+extern int vfat_unlink_uvfat(struct inode *dir,struct dentry *dentry);
 extern int vfat_mkdir(struct inode *dir,struct dentry *dentry,int mode);
 extern int vfat_rmdir(struct inode *dir,struct dentry *dentry);
 extern int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
@@ -273,6+312,9 @@ extern struct super_block *vfat_read_super(struct super_block *sb,void *data,
 extern void vfat_read_inode(struct inode *inode);
 extern int vfat_lookup(struct inode *dir,struct dentry *);
 
+/* vfat/vfatfs_syms.c */
+extern struct file_system_type vfat_fs_type;
+
 #endif /* __KERNEL__ */
 
 #endif
index cc9d9ac..530930e 100644 (file)
@@ -26,6+26,7 @@ struct msdos_inode_info {
        */
        struct pipe_inode_info reserved;
        int i_start;    /* first cluster or 0 */
+       int i_logstart; /* logical first cluster */
        int i_attrs;    /* unused attribute bits */
        int i_busy;     /* file is either deleted but still open, or
                           inconsistent (mkdir) */
index 4cc2248..fe584a8 100644 (file)
@@ -9,6+9,8 @@ struct fat_mount_options {
        uid_t fs_uid;
        gid_t fs_gid;
        unsigned short fs_umask;
+       unsigned short codepage;  /* Codepage for shortname conversions */
+       char *iocharset;          /* Charset used for filename input/display */
        unsigned char name_check; /* r = relaxed, n = normal, s = strict */
        unsigned char conversion; /* b = binary, t = text, a = auto */
        unsigned quiet:1,         /* set = fake successful chmods and chowns */
@@ -16,12+18,18 @@ struct fat_mount_options {
                 sys_immutable:1, /* set = system files are immutable */
                 dotsOK:1,        /* set = hidden and system files are named '.filename' */
                 isvfat:1,        /* 0=no vfat long filename support, 1=vfat support */
+                utf8:1,          /* Use of UTF8 character set (Default) */
                 unicode_xlate:1, /* create escape sequences for unhandled Unicode */
                 posixfs:1,       /* Allow names like makefile and Makefile to coexist */
                 numtail:1,       /* Does first alias have a numeric '~1' type tail? */
-                atari:1;         /* Use Atari GEMDOS variation of MS-DOS fs */
+                atari:1,         /* Use Atari GEMDOS variation of MS-DOS fs */
+                fat32:1;         /* Is this a FAT32 partition? */
 };
 
+struct vfat_unicode {
+       unsigned char uni1;
+       unsigned char uni2;
+};
 
 struct msdos_sb_info {
        unsigned short cluster_size; /* sectors/cluster */
@@ -30,11+38,15 @@ struct msdos_sb_info {
        unsigned short dir_start,dir_entries; /* root dir start & entries */
        unsigned short data_start;   /* first data sector */
        unsigned long clusters;      /* number of clusters */
+       unsigned long root_cluster;  /* first cluster of the root directory */
+       unsigned long fsinfo_offset; /* FAT32 fsinfo offset from start of disk */
        struct wait_queue *fat_wait;
        int fat_lock;
        int prev_free;               /* previously returned free cluster number */
        int free_clusters;           /* -1 if undefined */
        struct fat_mount_options options;
+       struct nls_table *nls_disk;  /* Codepage used on disk */
+       struct nls_table *nls_io;    /* Charset used for input and display */
 };
 
 #endif
diff --git a/include/linux/nls.h b/include/linux/nls.h
new file mode 100644 (file)
index 0000000..73f8363
--- /dev/null
@@ -0,0 +1,54 @@
+struct nls_unicode {
+       unsigned char uni1;
+       unsigned char uni2;
+};
+
+struct nls_table {
+       char *charset;
+       unsigned char **page_uni2charset;
+       struct nls_unicode *charset2uni;
+
+       void (*inc_use_count) (void);
+       void (*dec_use_count) (void);
+       struct nls_table *next;
+};
+
+/* nls.c */
+extern int init_nls(void);
+extern int register_nls(struct nls_table *);
+extern int unregister_nls(struct nls_table *);
+extern struct nls_table *find_nls(char *);
+extern struct nls_table *load_nls(char *);
+extern void unload_nls(struct nls_table *);
+extern struct nls_table *load_nls_default(void);
+
+extern int utf8_mbtowc(__u16 *, const __u8 *, int);
+extern int utf8_mbstowcs(__u16 *, const __u8 *, int);
+extern int utf8_wctomb(__u8 *, __u16, int);
+extern int utf8_wcstombs(__u8 *, const __u16 *, int);
+
+extern int init_nls_iso8859_1(void);
+extern int init_nls_iso8859_2(void);
+extern int init_nls_iso8859_3(void);
+extern int init_nls_iso8859_4(void);
+extern int init_nls_iso8859_5(void);
+extern int init_nls_iso8859_6(void);
+extern int init_nls_iso8859_7(void);
+extern int init_nls_iso8859_8(void);
+extern int init_nls_iso8859_9(void);
+extern int init_nls_cp437(void);
+extern int init_nls_cp737(void);
+extern int init_nls_cp775(void);
+extern int init_nls_cp850(void);
+extern int init_nls_cp852(void);
+extern int init_nls_cp855(void);
+extern int init_nls_cp857(void);
+extern int init_nls_cp860(void);
+extern int init_nls_cp861(void);
+extern int init_nls_cp862(void);
+extern int init_nls_cp863(void);
+extern int init_nls_cp864(void);
+extern int init_nls_cp865(void);
+extern int init_nls_cp866(void);
+extern int init_nls_cp869(void);
+extern int init_nls_cp874(void);
index 13d0649..b702a64 100644 (file)
  */
 #define PCI_VENDOR_ID_COMPAQ           0x0e11
 #define PCI_DEVICE_ID_COMPAQ_1280      0x3033
-#define PCI_DEVICE_ID_COMPAQ_NETELL100 0xae32
-#define PCI_DEVICE_ID_COMPAQ_NETELL10  0xae34
-#define PCI_DEVICE_ID_COMPAQ_NETFLEX3  0xae35
+#define PCI_DEVICE_ID_COMPAQ_SMART2P   0xae10
+#define PCI_DEVICE_ID_COMPAQ_NETEL100  0xae32
+#define PCI_DEVICE_ID_COMPAQ_NETEL10   0xae34
+#define PCI_DEVICE_ID_COMPAQ_NETFLEX3I 0xae35
+#define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40
+#define PCI_DEVICE_ID_COMPAQ_NETEL100PI        0xae43
+#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011
 #define PCI_DEVICE_ID_COMPAQ_THUNDER   0xf130
+#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150
 
 #define PCI_VENDOR_ID_NCR              0x1000
 #define PCI_DEVICE_ID_NCR_53C810       0x0001
 #define PCI_DEVICE_ID_ATI_68800                0x4158
 #define PCI_DEVICE_ID_ATI_215CT222     0x4354
 #define PCI_DEVICE_ID_ATI_210888CX     0x4358
+#define PCI_DEVICE_ID_ATI_215GP                0x4750
 #define PCI_DEVICE_ID_ATI_215GT                0x4754
+#define PCI_DEVICE_ID_ATI_215GTB       0x4755
 #define PCI_DEVICE_ID_ATI_210888GX     0x4758
 #define PCI_DEVICE_ID_ATI_264VT                0x5654
 
 #define PCI_VENDOR_ID_MIRO             0x1031
 #define PCI_DEVICE_ID_MIRO_36050       0x5601
 
+#define PCI_VENDOR_ID_NEC              0x1033
+
 #define PCI_VENDOR_ID_FD               0x1036
 #define PCI_DEVICE_ID_FD_36C70         0x0000
 
 #define PCI_VENDOR_ID_PROMISE          0x105a
 #define PCI_DEVICE_ID_PROMISE_5300     0x5300
 
-#define PCI_VENDOR_ID_APPLE            0x106b
-#define PCI_DEVICE_ID_APPLE_BANDIT     0x0001
-#define PCI_DEVICE_ID_APPLE_GC         0x0002
-#define PCI_DEVICE_ID_APPLE_HYDRA      0x000e
-
 #define PCI_VENDOR_ID_N9               0x105d
 #define PCI_DEVICE_ID_N9_I128          0x2309
 #define PCI_DEVICE_ID_N9_I128_2                0x2339
 #define PCI_VENDOR_ID_X                        0x1061
 #define PCI_DEVICE_ID_X_AGX016         0x0001
 
+#define PCI_VENDOR_ID_PICOP            0x1066
+#define PCI_DEVICE_ID_PICOP_PT86C52X   0x0001
+
+#define PCI_VENDOR_ID_APPLE            0x106b
+#define PCI_DEVICE_ID_APPLE_BANDIT     0x0001
+#define PCI_DEVICE_ID_APPLE_GC         0x0002
+#define PCI_DEVICE_ID_APPLE_HYDRA      0x000e
+
 #define PCI_VENDOR_ID_NEXGEN           0x1074
 #define PCI_DEVICE_ID_NEXGEN_82C501    0x4e78
 
 #define PCI_DEVICE_ID_VISION_QD8580    0x0002
 
 #define PCI_VENDOR_ID_BROOKTREE                0x109e
-#define PCI_DEVICE_ID_BT848            0x0350     /* 0x350 = 848 */
+#define PCI_DEVICE_ID_BROOKTREE_848    0x0350
 
 #define PCI_VENDOR_ID_SIERRA           0x10a8
 #define PCI_DEVICE_ID_SIERRA_STB       0x0000
 #define PCI_DEVICE_ID_3COM_3C905TX     0x9050
 
 #define PCI_VENDOR_ID_SMC              0x10b8
+#define PCI_DEVICE_ID_SMC_EPIC100      0x0005
 
 #define PCI_VENDOR_ID_AL               0x10b9
 #define PCI_DEVICE_ID_AL_M1445         0x1445
 #define PCI_DEVICE_ID_AL_M1489         0x1489
 #define PCI_DEVICE_ID_AL_M1511         0x1511
 #define PCI_DEVICE_ID_AL_M1513         0x1513
+#define PCI_DEVICE_ID_AL_M1521         0x1521
+#define PCI_DEVICE_ID_AL_M1523         0x1523
+#define PCI_DEVICE_ID_AL_M1531         0x1531
+#define PCI_DEVICE_ID_AL_M1533         0x1533
 #define PCI_DEVICE_ID_AL_M4803         0x5215
+#define PCI_DEVICE_ID_AL_M5219         0x5219
+#define PCI_DEVICE_ID_AL_M5229         0x5229
 
 #define PCI_VENDOR_ID_MITSUBISHI       0x10ba
 
 #define PCI_VENDOR_ID_NEOMAGIC          0x10c8
 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001
 #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002
+#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003
 
 #define PCI_VENDOR_ID_ASP              0x10cd
 #define PCI_DEVICE_ID_ASP_ABP940       0x1200
 #define PCI_DEVICE_ID_VIA_82C586_1     0x0571
 #define PCI_DEVICE_ID_VIA_82C576       0x0576
 #define PCI_DEVICE_ID_VIA_82C585       0x0585
-#define PCI_DEVICE_ID_VIA_82C586       0x0586
+#define PCI_DEVICE_ID_VIA_82C586_0     0x0586
 #define PCI_DEVICE_ID_VIA_82C926       0x0926
+#define PCI_DEVICE_ID_VIA_82C595       0x0595
 #define PCI_DEVICE_ID_VIA_82C416       0x1571
+#define PCI_DEVICE_ID_VIA_82C595_97    0x1595
+#define PCI_DEVICE_ID_VIA_82C586_2     0x3038
+#define PCI_DEVICE_ID_VIA_82C586_3     0x3040
 
 #define PCI_VENDOR_ID_VORTEX           0x1119
 #define PCI_DEVICE_ID_VORTEX_GDT60x0   0x0000
 #define PCI_DEVICE_ID_VORTEX_GDT6x25   0x000b
 #define PCI_DEVICE_ID_VORTEX_GDT6535   0x000c
 #define PCI_DEVICE_ID_VORTEX_GDT6555   0x000d
+#define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x0100
+#define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x0101
+#define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x0102
+#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103
+#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104
+#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105
+#define PCI_DEVICE_ID_VORTEX_GDT6x17RP1        0x0110
+#define PCI_DEVICE_ID_VORTEX_GDT6x27RP1        0x0111
+#define PCI_DEVICE_ID_VORTEX_GDT6537RP1        0x0112
+#define PCI_DEVICE_ID_VORTEX_GDT6557RP1        0x0113
+#define PCI_DEVICE_ID_VORTEX_GDT6x11RP1        0x0114
+#define PCI_DEVICE_ID_VORTEX_GDT6x21RP1        0x0115
+#define PCI_DEVICE_ID_VORTEX_GDT6x17RP2        0x0120
+#define PCI_DEVICE_ID_VORTEX_GDT6x27RP2        0x0121
+#define PCI_DEVICE_ID_VORTEX_GDT6537RP2        0x0122
+#define PCI_DEVICE_ID_VORTEX_GDT6557RP2        0x0123
+#define PCI_DEVICE_ID_VORTEX_GDT6x11RP2        0x0124
+#define PCI_DEVICE_ID_VORTEX_GDT6x21RP2        0x0125
 
 #define PCI_VENDOR_ID_EF               0x111a
 #define PCI_DEVICE_ID_EF_ATM_FPGA      0x0000
 #define PCI_VENDOR_ID_ALLIANCE         0x1142
 #define PCI_DEVICE_ID_ALLIANCE_PROMOTIO        0x3210
 #define PCI_DEVICE_ID_ALLIANCE_PROVIDEO        0x6422
+#define PCI_DEVICE_ID_ALLIANCE_AT24    0x6424
 
 #define PCI_VENDOR_ID_VMIC             0x114a
 #define PCI_DEVICE_ID_VMIC_VME         0x7587
 #define PCI_DEVICE_ID_ZORAN_36120      0x6120
 
 #define PCI_VENDOR_ID_COMPEX           0x11f6
+#define PCI_DEVICE_ID_COMPEX_ENET100VG4        0x0112
 #define PCI_DEVICE_ID_COMPEX_RL2000    0x1401
 
 #define PCI_VENDOR_ID_RP               0x11fe
 #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120
 #define PCI_DEVICE_ID_OPTIBASE_VQUEST  0x2130
 
+#define PCI_VENDOR_ID_ENSONIQ          0x1274
+#define PCI_DEVICE_ID_ENSONIQ_AUDIOPCI 0x5000
+
+#define PCI_VENDOR_ID_PICTUREL         0x12c5
+#define PCI_DEVICE_ID_PICTUREL_PCIVST  0x0081
+
+#define PCI_VENDOR_ID_NVIDIA           0x12d2
+#define PCI_DEVICE_ID_NVIDIA_RIVA128   0x0018
+
 #define PCI_VENDOR_ID_SYMPHONY         0x1c1c
 #define PCI_DEVICE_ID_SYMPHONY_101     0x0001
 
 #define PCI_DEVICE_ID_AVANCE_ALG2064   0x2064
 #define PCI_DEVICE_ID_AVANCE_2302      0x2302
 
+#define PCI_VENDOR_ID_NETVIN           0x4a14
+#define PCI_DEVICE_ID_NETVIN_NV5000SC  0x5000
+
 #define PCI_VENDOR_ID_S3               0x5333
+#define PCI_DEVICE_ID_S3_PLATO_PXS     0x0551
 #define PCI_DEVICE_ID_S3_ViRGE         0x5631
 #define PCI_DEVICE_ID_S3_TRIO          0x8811
 #define PCI_DEVICE_ID_S3_AURORA64VP    0x8812
 #define PCI_DEVICE_ID_S3_TRIO64V2      0x8901
 #define PCI_DEVICE_ID_S3_PLATO_PXG     0x8902
 #define PCI_DEVICE_ID_S3_ViRGE_DXGX    0x8a01
+#define PCI_DEVICE_ID_S3_ViRGE_GX2     0x8a10
 
 #define PCI_VENDOR_ID_INTEL            0x8086
 #define PCI_DEVICE_ID_INTEL_82375      0x0482
 #define PCI_DEVICE_ID_INTEL_82371AB_2  0x7112
 #define PCI_DEVICE_ID_INTEL_82371AB_3  0x7113
 #define PCI_DEVICE_ID_INTEL_P6         0x84c4
-#define PCI_DEVICE_ID_INTEL_P6_2       0x84c5
+#define PCI_DEVICE_ID_INTEL_82450GX    0x84c5
 
 #define PCI_VENDOR_ID_KTI              0x8e2e
 #define PCI_DEVICE_ID_KTI_ET32P2       0x3000
index 1e18516..587aaa8 100644 (file)
@@ -69,7+69,8 @@ enum
        KERN_CTLALTDEL,         /* int: allow ctl-alt-del to reboot */
        KERN_PRINTK,            /* sturct: control printk logging parameters */
        KERN_NAMETRANS,         /* Name translation */
-       KERN_STATINODE
+       KERN_STATINODE,
+       KERN_DENTRY             /* dentry statistics */
 };
 
 
index 93e4400..eb443b2 100644 (file)
@@ -385,7+385,7 @@ extern int sysv_bmap(struct inode *,int);
 
 extern struct buffer_head * sysv_getblk(struct inode *, unsigned int, int);
 extern struct buffer_head * sysv_file_bread(struct inode *, int, int);
-extern long sysv_file_read(struct inode *, struct file *, char *, unsigned long);
+extern ssize_t sysv_file_read(struct file *, char *, size_t, loff_t *);
 
 extern void sysv_truncate(struct inode *);
 extern void sysv_put_super(struct super_block *);
index bc8e912..f5f3296 100644 (file)
  *     buffers of any input characters it may have queued to be
  *     delivered to the user mode process.
  * 
- * int (*chars_in_buffer)(struct tty_struct *tty);
+ * ssize_t (*chars_in_buffer)(struct tty_struct *tty);
  *
  *     This function returns the number of input characters the line
  *     iscpline may have queued up to be delivered to the user mode
  *     process.
  * 
- * int (*read)(struct tty_struct * tty, struct file * file,
- *             unsigned char * buf, unsigned int nr);
+ * ssize_t (*read)(struct tty_struct * tty, struct file * file,
+ *                unsigned char * buf, size_t nr);
  *
  *     This function is called when the user requests to read from
  *     the tty.  The line discpline will return whatever characters
  *     it has buffered up for the user.  If this function is not
  *     defined, the user will receive an EIO error.
  * 
- * int (*write)(struct tty_struct * tty, struct file * file,
- *              const unsigned char * buf, unsigned int nr);
+ * ssize_t (*write)(struct tty_struct * tty, struct file * file,
+ *                 const unsigned char * buf, size_t nr);
  *
  *     This function is called when the user requests to write to the
  *     tty.  The line discpline will deliver the characters to the
@@ -111,11+111,11 @@ struct tty_ldisc {
        int     (*open)(struct tty_struct *);
        void    (*close)(struct tty_struct *);
        void    (*flush_buffer)(struct tty_struct *tty);
-       int     (*chars_in_buffer)(struct tty_struct *tty);
-       int     (*read)(struct tty_struct * tty, struct file * file,
-                       unsigned char * buf, unsigned int nr);
-       int     (*write)(struct tty_struct * tty, struct file * file,
-                        const unsigned char * buf, unsigned int nr);   
+       ssize_t (*chars_in_buffer)(struct tty_struct *tty);
+       ssize_t (*read)(struct tty_struct * tty, struct file * file,
+                       unsigned char * buf, size_t nr);
+       ssize_t (*write)(struct tty_struct * tty, struct file * file,
+                        const unsigned char * buf, size_t nr); 
        int     (*ioctl)(struct tty_struct * tty, struct file * file,
                         unsigned int cmd, unsigned long arg);
        void    (*set_termios)(struct tty_struct *tty, struct termios * old);
index 84f8bbf..5194d69 100644 (file)
@@ -90,6+90,9 @@ __attribute__((section("__ksymtab"))) = {
 };
 #endif
 
+#ifdef CONFIG_MODULES
+EXPORT_SYMBOL(get_module_symbol);
+#endif
 #ifdef CONFIG_KERNELD
 EXPORT_SYMBOL(kerneld_send);
 #endif
index 60e2f04..c346a4a 100644 (file)
@@ -871,7+871,6 @@ int get_module_list(char *p)
                        }
                        safe_copy_cstr("]");
                }
-
                safe_copy_cstr("\n");
 
 #undef safe_copy_str
@@ -932,6+931,34 @@ leave_the_loop:
        return len;
 }
 
+/*
+ * Gets the address for a symbol in the given module.  If modname is
+ * NULL, it looks for the name in any registered symbol table.  If the
+ * modname is an empty string, it looks for the symbol in kernel exported
+ * symbol tables.
+ */
+unsigned long
+get_module_symbol(char *modname, char *symname)
+{
+       struct module *mp;
+       struct module_symbol *sym;
+       int i;
+
+       for (mp = module_list; mp; mp = mp->next) {
+               if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) &&
+                       (mp->flags == MOD_RUNNING) && (mp->nsyms > 0)) {
+                       for (i = mp->nsyms, sym = mp->syms;
+                               i > 0; --i, ++sym) {
+
+                               if (strcmp(sym->name, symname) == 0) {
+                                       return sym->value;
+                               }
+                       }
+               }
+       }
+       return 0;
+}
+
 #else          /* CONFIG_MODULES */
 
 /* Dummy syscalls for people who don't want modules */
index 9416811..f28c993 100644 (file)
@@ -358,8+358,8 @@ int acct_process(long exitcode)
       fs = get_fs();
       set_fs(KERNEL_DS);
 
-      acct_file.f_op->write(acct_file.f_dentry->d_inode, &acct_file,
-                             (char *)&ac, sizeof(struct acct));
+      acct_file.f_op->write(&acct_file, (char *)&ac, sizeof(struct acct),
+                           &acct_file.f_pos);
       set_fs(fs);
    }
    return 0;
index 5c5231a..12abcef 100644 (file)
@@ -69,10+69,8 @@ static ctl_table dev_table[];
 
 #ifdef CONFIG_PROC_FS
 
-static long proc_readsys(struct inode * inode, struct file * file,
-                       char * buf, unsigned long count);
-static long proc_writesys(struct inode * inode, struct file * file,
-                        const char * buf, unsigned long count);
+static ssize_t proc_readsys(struct file *, char *, size_t, loff_t *);
+static ssize_t proc_writesys(struct file *, const char *, size_t, loff_t *);
 static int proc_sys_permission(struct inode *, int);
 
 struct file_operations proc_sys_file_operations =
@@ -113,6+111,7 @@ struct inode_operations proc_sys_inode_operations =
 extern struct proc_dir_entry proc_sys_root;
 
 extern int inodes_stat[];
+extern int dentry_stat[];
 static void register_proc_table(ctl_table *, struct proc_dir_entry *);
 static void unregister_proc_table(ctl_table *, struct proc_dir_entry *);
 #endif
@@ -151,6+150,8 @@ static ctl_table kern_table[] = {
         0444, NULL, &proc_dointvec},
        {KERN_MAXFILE, "file-max", &max_files, sizeof(int),
         0644, NULL, &proc_dointvec},
+       {KERN_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int),
+        0444, NULL, &proc_dointvec},
        {KERN_SECURELVL, "securelevel", &securelevel, sizeof(int),
         0444, NULL, &proc_dointvec, (ctl_handler *)&do_securelevel_strategy},
        {KERN_PANIC, "panic", &panic_timeout, sizeof(int),
@@ -522,17+523,16 @@ static void unregister_proc_table(ctl_table * table, struct proc_dir_entry *root
        }
 }
 
-
-static long do_rw_proc(int write, struct inode * inode, struct file * file,
-                     char * buf, unsigned long count)
+static ssize_t do_rw_proc(int write, struct file * file, char * buf,
+                         size_t count, loff_t *ppos)
 {
        int op;
        struct proc_dir_entry *de;
        struct ctl_table *table;
        size_t res;
-       long error;
+       ssize_t error;
        
-       de = (struct proc_dir_entry*) inode->u.generic_ip;
+       de = (struct proc_dir_entry*) file->f_dentry->d_inode->u.generic_ip;
        if (!de || !de->data)
                return -ENOTDIR;
        table = (struct ctl_table *) de->data;
@@ -543,22+543,27 @@ static long do_rw_proc(int write, struct inode * inode, struct file * file,
                return -EPERM;
        
        res = count;
+
+       /*
+        * FIXME: we need to pass on ppos to the handler.
+        */
+
        error = (*table->proc_handler) (table, write, file, buf, &res);
        if (error)
                return error;
        return res;
 }
 
-static long proc_readsys(struct inode * inode, struct file * file,
-                       char * buf, unsigned long count)
+static ssize_t proc_readsys(struct file * file, char * buf,
+                           size_t count, loff_t *ppos)
 {
-       return do_rw_proc(0, inode, file, buf, count);
+       return do_rw_proc(0, file, buf, count, ppos);
 }
 
-static long proc_writesys(struct inode * inode, struct file * file,
-                        const char * buf, unsigned long count)
+static ssize_t proc_writesys(struct file * file, const char * buf,
+                            size_t count, loff_t *ppos)
 {
-       return do_rw_proc(1, inode, file, (char *) buf, count);
+       return do_rw_proc(1, file, (char *) buf, count, ppos);
 }
 
 static int proc_sys_permission(struct inode *inode, int op)
index dab0bcb..5e20e4b 100644 (file)
@@ -555,11+555,12 @@ static inline unsigned long generic_file_readahead(int reada_ok, struct file * f
  * of the logic when it comes to error handling etc.
  */
 
-long generic_file_read(struct inode * inode, struct file * filp,
-       char * buf, unsigned long count)
+ssize_t generic_file_read(struct file * filp, char * buf,
+                         size_t count, loff_t *ppos)
 {
-       int error, read;
-       unsigned long pos, ppos, page_cache;
+       struct inode *inode = filp->f_dentry->d_inode;
+       ssize_t error, read;
+       size_t pos, pgpos, page_cache;
        int reada_ok;
 
        if (!access_ok(VERIFY_WRITE, buf, count))
@@ -570,8+571,8 @@ long generic_file_read(struct inode * inode, struct file * filp,
        read = 0;
        page_cache = 0;
 
-       pos = filp->f_pos;
-       ppos = pos & PAGE_MASK;
+       pos = *ppos;
+       pgpos = pos & PAGE_MASK;
 /*
  * If the current position is outside the previous read-ahead window, 
  * we reset the current read-ahead context and set read ahead max to zero
@@ -579,7+580,7 @@ long generic_file_read(struct inode * inode, struct file * filp,
  * otherwise, we assume that the file accesses are sequential enough to
  * continue read-ahead.
  */
-       if (ppos > filp->f_raend || ppos + filp->f_rawin < filp->f_raend) {
+       if (pgpos > filp->f_raend || pgpos + filp->f_rawin < filp->f_raend) {
                reada_ok = 0;
                filp->f_raend = 0;
                filp->f_ralen = 0;
@@ -600,7+601,7 @@ long generic_file_read(struct inode * inode, struct file * filp,
        } else {
                unsigned long needed;
 
-               needed = ((pos + count) & PAGE_MASK) - ppos;
+               needed = ((pos + count) & PAGE_MASK) - pgpos;
 
                if (filp->f_ramax < needed)
                        filp->f_ramax = needed;
@@ -736,7+737,7 @@ page_read_error:
                break;
        }
 
-       filp->f_pos = pos;
+       *ppos = pos;
        filp->f_reada = 1;
        if (page_cache)
                free_page(page_cache);
@@ -909,7+910,8 @@ static inline int do_write_page(struct inode * inode, struct file * file,
        old_fs = get_fs();
        set_fs(KERNEL_DS);
        retval = -EIO;
-       if (size == file->f_op->write(inode, file, (const char *) page, size))
+       if (size == file->f_op->write(file, (const char *) page,
+                                     size, &file->f_pos))
                retval = 0;
        set_fs(old_fs);
        return retval;
@@ -1299,21+1301,23 @@ out:
  * file system has to do this all by itself, unfortunately.
  *                                                     okir@monad.swb.de
  */
-long
-generic_file_write(struct inode *inode, struct file *file, const char *buf, unsigned long count)
+ssize_t
+generic_file_write(struct file *file, const char *buf,
+                  size_t count, loff_t *ppos)
 {
+       struct inode    *inode = file->f_dentry->d_inode; 
        struct page     *page, **hash;
        unsigned long   page_cache = 0;
-       unsigned long   ppos, offset;
-       unsigned int    bytes, written;
+       unsigned long   pgpos, offset;
+       unsigned long   bytes, written;
        unsigned long   pos;
-       int             status, sync, didread;
+       long            status, sync, didread;
 
        if (!inode->i_op || !inode->i_op->updatepage)
                return -EIO;
 
        sync    = file->f_flags & O_SYNC;
-       pos     = file->f_pos;
+       pos     = *ppos;
        written = 0;
        status  = 0;
 
@@ -1326,13+1330,13 @@ generic_file_write(struct inode *inode, struct file *file, const char *buf, unsi
                 * allocate a free page.
                 */
                offset = (pos & ~PAGE_MASK);
-               ppos = pos & PAGE_MASK;
+               pgpos = pos & PAGE_MASK;
 
                if ((bytes = PAGE_SIZE - offset) > count)
                        bytes = count;
 
-               hash = page_hash(inode, ppos);
-               if (!(page = __find_page(inode, ppos, *hash))) {
+               hash = page_hash(inode, pgpos);
+               if (!(page = __find_page(inode, pgpos, *hash))) {
                        if (!page_cache) {
                                page_cache = __get_free_page(GFP_KERNEL);
                                if (!page_cache) {
@@ -1342,7+1346,7 @@ generic_file_write(struct inode *inode, struct file *file, const char *buf, unsi
                                continue;
                        }
                        page = mem_map + MAP_NR(page_cache);
-                       add_to_page_cache(page, inode, ppos, hash);
+                       add_to_page_cache(page, inode, pgpos, hash);
                        page_cache = 0;
                }
 
@@ -1362,7+1366,7 @@ page_wait:
                 * after the current end of file.
                 */
                if (!PageUptodate(page)) {
-                       if (bytes < PAGE_SIZE && ppos < inode->i_size) {
+                       if (bytes < PAGE_SIZE && pgpos < inode->i_size) {
                                if (didread < 2)
                                    status = inode->i_op->readpage(inode, page);
                                else 
@@ -1388,7+1392,7 @@ done_with_page:
                pos += status;
                buf += status;
        }
-       file->f_pos = pos;
+       *ppos = pos;
        if (pos > inode->i_size)
                inode->i_size = pos;
 
index 6016620..53c4e58 100644 (file)
 #include <linux/kernel_stat.h>
 #include <linux/errno.h>
 #include <linux/string.h>
-#include <linux/stat.h>
 #include <linux/swap.h>
-#include <linux/fs.h>
 #include <linux/swapctl.h>
 #include <linux/smp_lock.h>
 #include <linux/slab.h>
+#include <linux/dcache.h>
 
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
@@ -352,6+351,8 @@ static inline int do_try_to_free_page(int priority, int dma, int wait)
        int i=6;
        int stop;
 
+       /* Let the dcache know we're looking for memory ... */
+       shrink_dcache_memory();
        /* Always trim SLAB caches when memory gets low. */
        (void) kmem_cache_reap(0, dma, wait);
 
index 9ab63c5..089d6eb 100644 (file)
@@ -319,7+319,6 @@ EXPORT_SYMBOL(skb_copy);
 EXPORT_SYMBOL(dev_alloc_skb);
 EXPORT_SYMBOL(netif_rx);
 EXPORT_SYMBOL(dev_tint);
-EXPORT_SYMBOL(irq2dev_map);
 EXPORT_SYMBOL(dev_add_pack);
 EXPORT_SYMBOL(dev_remove_pack);
 EXPORT_SYMBOL(dev_get);
index 3405677..ee19a84 100644 (file)
 
 
 static long long sock_lseek(struct file *file, long long offset, int whence);
-static long sock_read(struct inode *inode, struct file *file,
-                     char *buf, unsigned long size);
-static long sock_write(struct inode *inode, struct file *file,
-                      const char *buf, unsigned long size);
+static ssize_t sock_read(struct file *file, char *buf,
+                        size_t size, loff_t *ppos);
+static ssize_t sock_write(struct file *file, const char *buf,
+                         size_t size, loff_t *ppos);
 
 static int sock_close(struct inode *inode, struct file *file);
 static unsigned int sock_poll(struct file *file, poll_table *wait);
@@ -362,18+362,20 @@ static long long sock_lseek(struct file *file,long long offset, int whence)
  *     area ubuf...ubuf+size-1 is writable before asking the protocol.
  */
 
-static long sock_read(struct inode *inode, struct file *file,
-                     char *ubuf, unsigned long size)
+static ssize_t sock_read(struct file *file, char *ubuf,
+                        size_t size, loff_t *ppos)
 {
        struct socket *sock;
        struct iovec iov;
        struct msghdr msg;
 
-       sock = socki_lookup(inode); 
-  
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
        if (size==0)            /* Match SYS5 behaviour */
                return 0;
 
+       sock = socki_lookup(file->f_dentry->d_inode); 
+
        msg.msg_name=NULL;
        msg.msg_namelen=0;
        msg.msg_iov=&iov;
@@ -389,22+391,24 @@ static long sock_read(struct inode *inode, struct file *file,
 
 
 /*
- *     Write data to a socket. We verify that the user area ubuf..ubuf+size-1 is
- *     readable by the user process.
+ *     Write data to a socket. We verify that the user area ubuf..ubuf+size-1
+ *     is readable by the user process.
  */
 
-static long sock_write(struct inode *inode, struct file *file,
-                      const char *ubuf, unsigned long size)
+static ssize_t sock_write(struct file *file, const char *ubuf,
+                         size_t size, loff_t *ppos)
 {
        struct socket *sock;
        struct msghdr msg;
        struct iovec iov;
        
-       sock = socki_lookup(inode); 
-
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
        if(size==0)             /* Match SYS5 behaviour */
                return 0;
 
+       sock = socki_lookup(file->f_dentry->d_inode); 
+
        msg.msg_name=NULL;
        msg.msg_namelen=0;
        msg.msg_iov=&iov;
close