xref: /linux/fs/nls/mac-inuit.c (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
18b8c0daaSLinus Torvalds /*
28b8c0daaSLinus Torvalds  * linux/fs/nls/mac-inuit.c
38b8c0daaSLinus Torvalds  *
48b8c0daaSLinus Torvalds  * Charset macinuit translation tables.
58b8c0daaSLinus Torvalds  * Generated automatically from the Unicode and charset
68b8c0daaSLinus Torvalds  * tables from the Unicode Organization (www.unicode.org).
78b8c0daaSLinus Torvalds  * The Unicode to charset table has only exact mappings.
88b8c0daaSLinus Torvalds  */
98b8c0daaSLinus Torvalds 
108b8c0daaSLinus Torvalds /*
118b8c0daaSLinus Torvalds  * COPYRIGHT AND PERMISSION NOTICE
128b8c0daaSLinus Torvalds  *
138b8c0daaSLinus Torvalds  * Copyright 1991-2012 Unicode, Inc.  All rights reserved.  Distributed under
148b8c0daaSLinus Torvalds  * the Terms of Use in http://www.unicode.org/copyright.html.
158b8c0daaSLinus Torvalds  *
168b8c0daaSLinus Torvalds  * Permission is hereby granted, free of charge, to any person obtaining a
178b8c0daaSLinus Torvalds  * copy of the Unicode data files and any associated documentation (the "Data
188b8c0daaSLinus Torvalds  * Files") or Unicode software and any associated documentation (the
198b8c0daaSLinus Torvalds  * "Software") to deal in the Data Files or Software without restriction,
208b8c0daaSLinus Torvalds  * including without limitation the rights to use, copy, modify, merge,
218b8c0daaSLinus Torvalds  * publish, distribute, and/or sell copies of the Data Files or Software, and
228b8c0daaSLinus Torvalds  * to permit persons to whom the Data Files or Software are furnished to do
238b8c0daaSLinus Torvalds  * so, provided that (a) the above copyright notice(s) and this permission
248b8c0daaSLinus Torvalds  * notice appear with all copies of the Data Files or Software, (b) both the
258b8c0daaSLinus Torvalds  * above copyright notice(s) and this permission notice appear in associated
268b8c0daaSLinus Torvalds  * documentation, and (c) there is clear notice in each modified Data File or
278b8c0daaSLinus Torvalds  * in the Software as well as in the documentation associated with the Data
288b8c0daaSLinus Torvalds  * File(s) or Software that the data or software has been modified.
298b8c0daaSLinus Torvalds  *
308b8c0daaSLinus Torvalds  * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
318b8c0daaSLinus Torvalds  * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
328b8c0daaSLinus Torvalds  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
338b8c0daaSLinus Torvalds  * THIRD PARTY RIGHTS.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
348b8c0daaSLinus Torvalds  * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
358b8c0daaSLinus Torvalds  * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
368b8c0daaSLinus Torvalds  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
378b8c0daaSLinus Torvalds  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
388b8c0daaSLinus Torvalds  * PERFORMANCE OF THE DATA FILES OR SOFTWARE.
398b8c0daaSLinus Torvalds  *
408b8c0daaSLinus Torvalds  * Except as contained in this notice, the name of a copyright holder shall
418b8c0daaSLinus Torvalds  * not be used in advertising or otherwise to promote the sale, use or other
428b8c0daaSLinus Torvalds  * dealings in these Data Files or Software without prior written
438b8c0daaSLinus Torvalds  * authorization of the copyright holder.
448b8c0daaSLinus Torvalds  */
458b8c0daaSLinus Torvalds 
468b8c0daaSLinus Torvalds #include <linux/module.h>
478b8c0daaSLinus Torvalds #include <linux/kernel.h>
488b8c0daaSLinus Torvalds #include <linux/string.h>
498b8c0daaSLinus Torvalds #include <linux/nls.h>
508b8c0daaSLinus Torvalds #include <linux/errno.h>
518b8c0daaSLinus Torvalds 
528b8c0daaSLinus Torvalds static const wchar_t charset2uni[256] = {
538b8c0daaSLinus Torvalds 	/* 0x00 */
548b8c0daaSLinus Torvalds 	0x0000, 0x0001, 0x0002, 0x0003,
558b8c0daaSLinus Torvalds 	0x0004, 0x0005, 0x0006, 0x0007,
568b8c0daaSLinus Torvalds 	0x0008, 0x0009, 0x000a, 0x000b,
578b8c0daaSLinus Torvalds 	0x000c, 0x000d, 0x000e, 0x000f,
588b8c0daaSLinus Torvalds 	/* 0x10 */
598b8c0daaSLinus Torvalds 	0x0010, 0x0011, 0x0012, 0x0013,
608b8c0daaSLinus Torvalds 	0x0014, 0x0015, 0x0016, 0x0017,
618b8c0daaSLinus Torvalds 	0x0018, 0x0019, 0x001a, 0x001b,
628b8c0daaSLinus Torvalds 	0x001c, 0x001d, 0x001e, 0x001f,
638b8c0daaSLinus Torvalds 	/* 0x20 */
648b8c0daaSLinus Torvalds 	0x0020, 0x0021, 0x0022, 0x0023,
658b8c0daaSLinus Torvalds 	0x0024, 0x0025, 0x0026, 0x0027,
668b8c0daaSLinus Torvalds 	0x0028, 0x0029, 0x002a, 0x002b,
678b8c0daaSLinus Torvalds 	0x002c, 0x002d, 0x002e, 0x002f,
688b8c0daaSLinus Torvalds 	/* 0x30 */
698b8c0daaSLinus Torvalds 	0x0030, 0x0031, 0x0032, 0x0033,
708b8c0daaSLinus Torvalds 	0x0034, 0x0035, 0x0036, 0x0037,
718b8c0daaSLinus Torvalds 	0x0038, 0x0039, 0x003a, 0x003b,
728b8c0daaSLinus Torvalds 	0x003c, 0x003d, 0x003e, 0x003f,
738b8c0daaSLinus Torvalds 	/* 0x40 */
748b8c0daaSLinus Torvalds 	0x0040, 0x0041, 0x0042, 0x0043,
758b8c0daaSLinus Torvalds 	0x0044, 0x0045, 0x0046, 0x0047,
768b8c0daaSLinus Torvalds 	0x0048, 0x0049, 0x004a, 0x004b,
778b8c0daaSLinus Torvalds 	0x004c, 0x004d, 0x004e, 0x004f,
788b8c0daaSLinus Torvalds 	/* 0x50 */
798b8c0daaSLinus Torvalds 	0x0050, 0x0051, 0x0052, 0x0053,
808b8c0daaSLinus Torvalds 	0x0054, 0x0055, 0x0056, 0x0057,
818b8c0daaSLinus Torvalds 	0x0058, 0x0059, 0x005a, 0x005b,
828b8c0daaSLinus Torvalds 	0x005c, 0x005d, 0x005e, 0x005f,
838b8c0daaSLinus Torvalds 	/* 0x60 */
848b8c0daaSLinus Torvalds 	0x0060, 0x0061, 0x0062, 0x0063,
858b8c0daaSLinus Torvalds 	0x0064, 0x0065, 0x0066, 0x0067,
868b8c0daaSLinus Torvalds 	0x0068, 0x0069, 0x006a, 0x006b,
878b8c0daaSLinus Torvalds 	0x006c, 0x006d, 0x006e, 0x006f,
888b8c0daaSLinus Torvalds 	/* 0x70 */
898b8c0daaSLinus Torvalds 	0x0070, 0x0071, 0x0072, 0x0073,
908b8c0daaSLinus Torvalds 	0x0074, 0x0075, 0x0076, 0x0077,
918b8c0daaSLinus Torvalds 	0x0078, 0x0079, 0x007a, 0x007b,
928b8c0daaSLinus Torvalds 	0x007c, 0x007d, 0x007e, 0x007f,
938b8c0daaSLinus Torvalds 	/* 0x80 */
948b8c0daaSLinus Torvalds 	0x1403, 0x1404, 0x1405, 0x1406,
958b8c0daaSLinus Torvalds 	0x140a, 0x140b, 0x1431, 0x1432,
968b8c0daaSLinus Torvalds 	0x1433, 0x1434, 0x1438, 0x1439,
978b8c0daaSLinus Torvalds 	0x1449, 0x144e, 0x144f, 0x1450,
988b8c0daaSLinus Torvalds 	/* 0x90 */
998b8c0daaSLinus Torvalds 	0x1451, 0x1455, 0x1456, 0x1466,
1008b8c0daaSLinus Torvalds 	0x146d, 0x146e, 0x146f, 0x1470,
1018b8c0daaSLinus Torvalds 	0x1472, 0x1473, 0x1483, 0x148b,
1028b8c0daaSLinus Torvalds 	0x148c, 0x148d, 0x148e, 0x1490,
1038b8c0daaSLinus Torvalds 	/* 0xa0 */
1048b8c0daaSLinus Torvalds 	0x1491, 0x00b0, 0x14a1, 0x14a5,
1058b8c0daaSLinus Torvalds 	0x14a6, 0x2022, 0x00b6, 0x14a7,
1068b8c0daaSLinus Torvalds 	0x00ae, 0x00a9, 0x2122, 0x14a8,
1078b8c0daaSLinus Torvalds 	0x14aa, 0x14ab, 0x14bb, 0x14c2,
1088b8c0daaSLinus Torvalds 	/* 0xb0 */
1098b8c0daaSLinus Torvalds 	0x14c3, 0x14c4, 0x14c5, 0x14c7,
1108b8c0daaSLinus Torvalds 	0x14c8, 0x14d0, 0x14ef, 0x14f0,
1118b8c0daaSLinus Torvalds 	0x14f1, 0x14f2, 0x14f4, 0x14f5,
1128b8c0daaSLinus Torvalds 	0x1505, 0x14d5, 0x14d6, 0x14d7,
1138b8c0daaSLinus Torvalds 	/* 0xc0 */
1148b8c0daaSLinus Torvalds 	0x14d8, 0x14da, 0x14db, 0x14ea,
1158b8c0daaSLinus Torvalds 	0x1528, 0x1529, 0x152a, 0x152b,
1168b8c0daaSLinus Torvalds 	0x152d, 0x2026, 0x00a0, 0x152e,
1178b8c0daaSLinus Torvalds 	0x153e, 0x1555, 0x1556, 0x1557,
1188b8c0daaSLinus Torvalds 	/* 0xd0 */
1198b8c0daaSLinus Torvalds 	0x2013, 0x2014, 0x201c, 0x201d,
1208b8c0daaSLinus Torvalds 	0x2018, 0x2019, 0x1558, 0x1559,
1218b8c0daaSLinus Torvalds 	0x155a, 0x155d, 0x1546, 0x1547,
1228b8c0daaSLinus Torvalds 	0x1548, 0x1549, 0x154b, 0x154c,
1238b8c0daaSLinus Torvalds 	/* 0xe0 */
1248b8c0daaSLinus Torvalds 	0x1550, 0x157f, 0x1580, 0x1581,
1258b8c0daaSLinus Torvalds 	0x1582, 0x1583, 0x1584, 0x1585,
1268b8c0daaSLinus Torvalds 	0x158f, 0x1590, 0x1591, 0x1592,
1278b8c0daaSLinus Torvalds 	0x1593, 0x1594, 0x1595, 0x1671,
1288b8c0daaSLinus Torvalds 	/* 0xf0 */
1298b8c0daaSLinus Torvalds 	0x1672, 0x1673, 0x1674, 0x1675,
1308b8c0daaSLinus Torvalds 	0x1676, 0x1596, 0x15a0, 0x15a1,
1318b8c0daaSLinus Torvalds 	0x15a2, 0x15a3, 0x15a4, 0x15a5,
1328b8c0daaSLinus Torvalds 	0x15a6, 0x157c, 0x0141, 0x0142,
1338b8c0daaSLinus Torvalds };
1348b8c0daaSLinus Torvalds 
1358b8c0daaSLinus Torvalds static const unsigned char page00[256] = {
1368b8c0daaSLinus Torvalds 	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */
1378b8c0daaSLinus Torvalds 	0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */
1388b8c0daaSLinus Torvalds 	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */
1398b8c0daaSLinus Torvalds 	0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18-0x1f */
1408b8c0daaSLinus Torvalds 	0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20-0x27 */
1418b8c0daaSLinus Torvalds 	0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28-0x2f */
1428b8c0daaSLinus Torvalds 	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30-0x37 */
1438b8c0daaSLinus Torvalds 	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38-0x3f */
1448b8c0daaSLinus Torvalds 	0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40-0x47 */
1458b8c0daaSLinus Torvalds 	0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* 0x48-0x4f */
1468b8c0daaSLinus Torvalds 	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50-0x57 */
1478b8c0daaSLinus Torvalds 	0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, /* 0x58-0x5f */
1488b8c0daaSLinus Torvalds 	0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60-0x67 */
1498b8c0daaSLinus Torvalds 	0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, /* 0x68-0x6f */
1508b8c0daaSLinus Torvalds 	0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70-0x77 */
1518b8c0daaSLinus Torvalds 	0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, /* 0x78-0x7f */
1528b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
1538b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
1548b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
1558b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
1568b8c0daaSLinus Torvalds 	0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
1578b8c0daaSLinus Torvalds 	0x00, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, /* 0xa8-0xaf */
1588b8c0daaSLinus Torvalds 	0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, /* 0xb0-0xb7 */
1598b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
1608b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
1618b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
1628b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
1638b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
1648b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
1658b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
1668b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
1678b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
1688b8c0daaSLinus Torvalds };
1698b8c0daaSLinus Torvalds 
1708b8c0daaSLinus Torvalds static const unsigned char page01[256] = {
1718b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
1728b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
1738b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
1748b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
1758b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
1768b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
1778b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
1788b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
1798b8c0daaSLinus Torvalds 	0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
1808b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
1818b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
1828b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
1838b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
1848b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
1858b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
1868b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
1878b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
1888b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
1898b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
1908b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
1918b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
1928b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
1938b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
1948b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
1958b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
1968b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
1978b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
1988b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
1998b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2008b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
2018b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
2028b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2038b8c0daaSLinus Torvalds };
2048b8c0daaSLinus Torvalds 
2058b8c0daaSLinus Torvalds static const unsigned char page14[256] = {
2068b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x80, 0x81, 0x82, 0x83, 0x00, /* 0x00-0x07 */
2078b8c0daaSLinus Torvalds 	0x00, 0x00, 0x84, 0x85, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
2088b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
2098b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
2108b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
2118b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
2128b8c0daaSLinus Torvalds 	0x00, 0x86, 0x87, 0x88, 0x89, 0x00, 0x00, 0x00, /* 0x30-0x37 */
2138b8c0daaSLinus Torvalds 	0x8a, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
2148b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
2158b8c0daaSLinus Torvalds 	0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x8d, 0x8e, /* 0x48-0x4f */
2168b8c0daaSLinus Torvalds 	0x8f, 0x90, 0x00, 0x00, 0x00, 0x91, 0x92, 0x00, /* 0x50-0x57 */
2178b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
2188b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x93, 0x00, /* 0x60-0x67 */
2198b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x95, 0x96, /* 0x68-0x6f */
2208b8c0daaSLinus Torvalds 	0x97, 0x00, 0x98, 0x99, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
2218b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
2228b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
2238b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x9b, 0x9c, 0x9d, 0x9e, 0x00, /* 0x88-0x8f */
2248b8c0daaSLinus Torvalds 	0x9f, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
2258b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2268b8c0daaSLinus Torvalds 	0x00, 0xa2, 0x00, 0x00, 0x00, 0xa3, 0xa4, 0xa7, /* 0xa0-0xa7 */
2278b8c0daaSLinus Torvalds 	0xab, 0x00, 0xac, 0xad, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2288b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2298b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0xae, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
2308b8c0daaSLinus Torvalds 	0x00, 0x00, 0xaf, 0xb0, 0xb1, 0xb2, 0x00, 0xb3, /* 0xc0-0xc7 */
2318b8c0daaSLinus Torvalds 	0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
2328b8c0daaSLinus Torvalds 	0xb5, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbe, 0xbf, /* 0xd0-0xd7 */
2338b8c0daaSLinus Torvalds 	0xc0, 0x00, 0xc1, 0xc2, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
2348b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2358b8c0daaSLinus Torvalds 	0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xb6, /* 0xe8-0xef */
2368b8c0daaSLinus Torvalds 	0xb7, 0xb8, 0xb9, 0x00, 0xba, 0xbb, 0x00, 0x00, /* 0xf0-0xf7 */
2378b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2388b8c0daaSLinus Torvalds };
2398b8c0daaSLinus Torvalds 
2408b8c0daaSLinus Torvalds static const unsigned char page15[256] = {
2418b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, /* 0x00-0x07 */
2428b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
2438b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
2448b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
2458b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
2468b8c0daaSLinus Torvalds 	0xc4, 0xc5, 0xc6, 0xc7, 0x00, 0xc8, 0xcb, 0x00, /* 0x28-0x2f */
2478b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
2488b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, /* 0x38-0x3f */
2498b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, 0xdb, /* 0x40-0x47 */
2508b8c0daaSLinus Torvalds 	0xdc, 0xdd, 0x00, 0xde, 0xdf, 0x00, 0x00, 0x00, /* 0x48-0x4f */
2518b8c0daaSLinus Torvalds 	0xe0, 0x00, 0x00, 0x00, 0x00, 0xcd, 0xce, 0xcf, /* 0x50-0x57 */
2528b8c0daaSLinus Torvalds 	0xd6, 0xd7, 0xd8, 0x00, 0x00, 0xd9, 0x00, 0x00, /* 0x58-0x5f */
2538b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
2548b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
2558b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
2568b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0xe1, /* 0x78-0x7f */
2578b8c0daaSLinus Torvalds 	0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0x00, 0x00, /* 0x80-0x87 */
2588b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, /* 0x88-0x8f */
2598b8c0daaSLinus Torvalds 	0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xf5, 0x00, /* 0x90-0x97 */
2608b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2618b8c0daaSLinus Torvalds 	0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, /* 0xa0-0xa7 */
2628b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2638b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2648b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
2658b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
2668b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
2678b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
2688b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
2698b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
2708b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
2718b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
2728b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
2738b8c0daaSLinus Torvalds };
2748b8c0daaSLinus Torvalds 
2758b8c0daaSLinus Torvalds static const unsigned char page16[256] = {
2768b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
2778b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
2788b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
2798b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
2808b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
2818b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
2828b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
2838b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
2848b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
2858b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
2868b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
2878b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
2888b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
2898b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
2908b8c0daaSLinus Torvalds 	0x00, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0x00, /* 0x70-0x77 */
2918b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
2928b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
2938b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
2948b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
2958b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
2968b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
2978b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
2988b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
2998b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
3008b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
3018b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
3028b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
3038b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
3048b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
3058b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
3068b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
3078b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
3088b8c0daaSLinus Torvalds };
3098b8c0daaSLinus Torvalds 
3108b8c0daaSLinus Torvalds static const unsigned char page20[256] = {
3118b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
3128b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
3138b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0xd0, 0xd1, 0x00, 0x00, 0x00, /* 0x10-0x17 */
3148b8c0daaSLinus Torvalds 	0xd4, 0xd5, 0x00, 0x00, 0xd2, 0xd3, 0x00, 0x00, /* 0x18-0x1f */
3158b8c0daaSLinus Torvalds 	0x00, 0x00, 0xa5, 0x00, 0x00, 0x00, 0xc9, 0x00, /* 0x20-0x27 */
3168b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
3178b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
3188b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
3198b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
3208b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
3218b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
3228b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
3238b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
3248b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
3258b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
3268b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
3278b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
3288b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
3298b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
3308b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
3318b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
3328b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
3338b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
3348b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
3358b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
3368b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
3378b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
3388b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
3398b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
3408b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
3418b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
3428b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
3438b8c0daaSLinus Torvalds };
3448b8c0daaSLinus Torvalds 
3458b8c0daaSLinus Torvalds static const unsigned char page21[256] = {
3468b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
3478b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
3488b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */
3498b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */
3508b8c0daaSLinus Torvalds 	0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
3518b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */
3528b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */
3538b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */
3548b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
3558b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
3568b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */
3578b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
3588b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
3598b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
3608b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
3618b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
3628b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
3638b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
3648b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
3658b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
3668b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
3678b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
3688b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb0-0xb7 */
3698b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */
3708b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc0-0xc7 */
3718b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xc8-0xcf */
3728b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd0-0xd7 */
3738b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xd8-0xdf */
3748b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe0-0xe7 */
3758b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xe8-0xef */
3768b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */
3778b8c0daaSLinus Torvalds 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */
3788b8c0daaSLinus Torvalds };
3798b8c0daaSLinus Torvalds 
3808b8c0daaSLinus Torvalds static const unsigned char *const page_uni2charset[256] = {
3818b8c0daaSLinus Torvalds 	page00, page01, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3828b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3838b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   page14, page15, page16, NULL,
3848b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3858b8c0daaSLinus Torvalds 	page20, page21, NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3868b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3878b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3888b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3898b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3908b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3918b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3928b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3938b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3948b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3958b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3968b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3978b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3988b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
3998b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4008b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4018b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4028b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4038b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4048b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4058b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4068b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4078b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4088b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4098b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4108b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4118b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4128b8c0daaSLinus Torvalds 	NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,   NULL,
4138b8c0daaSLinus Torvalds };
4148b8c0daaSLinus Torvalds 
4158b8c0daaSLinus Torvalds static const unsigned char charset2lower[256] = {
4168b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x00-0x07 */
4178b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08-0x0f */
4188b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x10-0x17 */
4198b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x18-0x1f */
4208b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x20-0x27 */
4218b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x28-0x2f */
4228b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x30-0x37 */
4238b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x38-0x3f */
4248b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x40-0x47 */
4258b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x48-0x4f */
4268b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x50-0x57 */
4278b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x58-0x5f */
4288b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x60-0x67 */
4298b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x68-0x6f */
4308b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x70-0x77 */
4318b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x78-0x7f */
4328b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x80-0x87 */
4338b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x88-0x8f */
4348b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x90-0x97 */
4358b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x98-0x9f */
4368b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa0-0xa7 */
4378b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xa8-0xaf */
4388b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb0-0xb7 */
4398b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xb8-0xbf */
4408b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc0-0xc7 */
4418b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xc8-0xcf */
4428b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd0-0xd7 */
4438b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xd8-0xdf */
4448b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe0-0xe7 */
4458b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xe8-0xef */
4468b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf0-0xf7 */
4478b8c0daaSLinus Torvalds 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0xf8-0xff */
4488b8c0daaSLinus Torvalds };
4498b8c0daaSLinus Torvalds 
4508b8c0daaSLinus Torvalds static const unsigned char charset2upper[256] = {
4518b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x00-0x07 */
4528b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x08-0x0f */
4538b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x10-0x17 */
4548b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x18-0x1f */
4558b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x20-0x27 */
4568b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x28-0x2f */
4578b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x30-0x37 */
4588b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x38-0x3f */
4598b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x40-0x47 */
4608b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x48-0x4f */
4618b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x50-0x57 */
4628b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x58-0x5f */
4638b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x60-0x67 */
4648b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x68-0x6f */
4658b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x70-0x77 */
4668b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x78-0x7f */
4678b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x80-0x87 */
4688b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x88-0x8f */
4698b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x90-0x97 */
4708b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0x98-0x9f */
4718b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xa0-0xa7 */
4728b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xa8-0xaf */
4738b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xb0-0xb7 */
4748b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xb8-0xbf */
4758b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xc0-0xc7 */
4768b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xc8-0xcf */
4778b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xd0-0xd7 */
4788b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xd8-0xdf */
4798b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xe0-0xe7 */
4808b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xe8-0xef */
4818b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xf0-0xf7 */
4828b8c0daaSLinus Torvalds 	0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, /* 0xf8-0xff */
4838b8c0daaSLinus Torvalds };
4848b8c0daaSLinus Torvalds 
uni2char(wchar_t uni,unsigned char * out,int boundlen)4858b8c0daaSLinus Torvalds static int uni2char(wchar_t uni, unsigned char *out, int boundlen)
4868b8c0daaSLinus Torvalds {
4878b8c0daaSLinus Torvalds 	const unsigned char *uni2charset;
4888b8c0daaSLinus Torvalds 	unsigned char cl = uni & 0x00ff;
4898b8c0daaSLinus Torvalds 	unsigned char ch = (uni & 0xff00) >> 8;
4908b8c0daaSLinus Torvalds 
4918b8c0daaSLinus Torvalds 	if (boundlen <= 0)
4928b8c0daaSLinus Torvalds 		return -ENAMETOOLONG;
4938b8c0daaSLinus Torvalds 
4948b8c0daaSLinus Torvalds 	uni2charset = page_uni2charset[ch];
4958b8c0daaSLinus Torvalds 	if (uni2charset && uni2charset[cl])
4968b8c0daaSLinus Torvalds 		out[0] = uni2charset[cl];
4978b8c0daaSLinus Torvalds 	else
4988b8c0daaSLinus Torvalds 		return -EINVAL;
4998b8c0daaSLinus Torvalds 	return 1;
5008b8c0daaSLinus Torvalds }
5018b8c0daaSLinus Torvalds 
char2uni(const unsigned char * rawstring,int boundlen,wchar_t * uni)5028b8c0daaSLinus Torvalds static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
5038b8c0daaSLinus Torvalds {
5048b8c0daaSLinus Torvalds 	*uni = charset2uni[*rawstring];
5058b8c0daaSLinus Torvalds 	if (*uni == 0x0000)
5068b8c0daaSLinus Torvalds 		return -EINVAL;
5078b8c0daaSLinus Torvalds 	return 1;
5088b8c0daaSLinus Torvalds }
5098b8c0daaSLinus Torvalds 
5108b8c0daaSLinus Torvalds static struct nls_table table = {
5118b8c0daaSLinus Torvalds 	.charset	= "macinuit",
5128b8c0daaSLinus Torvalds 	.uni2char	= uni2char,
5138b8c0daaSLinus Torvalds 	.char2uni	= char2uni,
5148b8c0daaSLinus Torvalds 	.charset2lower	= charset2lower,
5158b8c0daaSLinus Torvalds 	.charset2upper	= charset2upper,
5168b8c0daaSLinus Torvalds };
5178b8c0daaSLinus Torvalds 
init_nls_macinuit(void)5188b8c0daaSLinus Torvalds static int __init init_nls_macinuit(void)
5198b8c0daaSLinus Torvalds {
5208b8c0daaSLinus Torvalds 	return register_nls(&table);
5218b8c0daaSLinus Torvalds }
5228b8c0daaSLinus Torvalds 
exit_nls_macinuit(void)5238b8c0daaSLinus Torvalds static void __exit exit_nls_macinuit(void)
5248b8c0daaSLinus Torvalds {
5258b8c0daaSLinus Torvalds 	unregister_nls(&table);
5268b8c0daaSLinus Torvalds }
5278b8c0daaSLinus Torvalds 
5288b8c0daaSLinus Torvalds module_init(init_nls_macinuit)
5298b8c0daaSLinus Torvalds module_exit(exit_nls_macinuit)
5308b8c0daaSLinus Torvalds 
531*d694e46aSJeff Johnson MODULE_DESCRIPTION("NLS Codepage macinuit");
5328b8c0daaSLinus Torvalds MODULE_LICENSE("Dual BSD/GPL");
533