ebcdic.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. /*
  2. * arch/s390/kernel/ebcdic.c
  3. * ECBDIC -> ASCII, ASCII -> ECBDIC,
  4. * upper to lower case (EBCDIC) conversion tables.
  5. *
  6. * S390 version
  7. * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
  8. * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  9. * Martin Peschke <peschke@fh-brandenburg.de>
  10. */
  11. #include <linux/module.h>
  12. #include <asm/types.h>
  13. #include <asm/ebcdic.h>
  14. /*
  15. * ASCII (IBM PC 437) -> EBCDIC 037
  16. */
  17. __u8 _ascebc[256] =
  18. {
  19. /*00 NUL SOH STX ETX EOT ENQ ACK BEL */
  20. 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
  21. /*08 BS HT LF VT FF CR SO SI */
  22. /* ->NL */
  23. 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  24. /*10 DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
  25. 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26,
  26. /*18 CAN EM SUB ESC FS GS RS US */
  27. /* ->IGS ->IRS ->IUS */
  28. 0x18, 0x19, 0x3F, 0x27, 0x22, 0x1D, 0x1E, 0x1F,
  29. /*20 SP ! " # $ % & ' */
  30. 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
  31. /*28 ( ) * + , - . / */
  32. 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
  33. /*30 0 1 2 3 4 5 6 7 */
  34. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  35. /*38 8 9 : ; < = > ? */
  36. 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
  37. /*40 @ A B C D E F G */
  38. 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  39. /*48 H I J K L M N O */
  40. 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
  41. /*50 P Q R S T U V W */
  42. 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
  43. /*58 X Y Z [ \ ] ^ _ */
  44. 0xE7, 0xE8, 0xE9, 0xBA, 0xE0, 0xBB, 0xB0, 0x6D,
  45. /*60 ` a b c d e f g */
  46. 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  47. /*68 h i j k l m n o */
  48. 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
  49. /*70 p q r s t u v w */
  50. 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
  51. /*78 x y z { | } ~ DL */
  52. 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07,
  53. /*80*/
  54. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  55. /*88*/
  56. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  57. /*90*/
  58. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  59. /*98*/
  60. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  61. /*A0*/
  62. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  63. /*A8*/
  64. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  65. /*B0*/
  66. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  67. /*B8*/
  68. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  69. /*C0*/
  70. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  71. /*C8*/
  72. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  73. /*D0*/
  74. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  75. /*D8*/
  76. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  77. /*E0 sz */
  78. 0x3F, 0x59, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  79. /*E8*/
  80. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  81. /*F0*/
  82. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  83. /*F8*/
  84. 0x90, 0x3F, 0x3F, 0x3F, 0x3F, 0xEA, 0x3F, 0xFF
  85. };
  86. /*
  87. * EBCDIC 037 -> ASCII (IBM PC 437)
  88. */
  89. __u8 _ebcasc[256] =
  90. {
  91. /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
  92. 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F,
  93. /* 0x08 -GE -SPS -RPT VT FF CR SO SI */
  94. 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  95. /* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC
  96. -ENP ->LF */
  97. 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07,
  98. /* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB
  99. -IUS */
  100. 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  101. /* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC
  102. -INP */
  103. 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B,
  104. /* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL
  105. -SW */
  106. 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07,
  107. /* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */
  108. 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04,
  109. /* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */
  110. 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A,
  111. /* 0x40 SP RSP ∽ ---- */
  112. 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86,
  113. /* 0x48 . < ( + | */
  114. 0x87, 0xA4, 0x9B, 0x2E, 0x3C, 0x28, 0x2B, 0x7C,
  115. /* 0x50 & ---- */
  116. 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07,
  117. /* 0x58 ≡ ! $ * ) ; */
  118. 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAA,
  119. /* 0x60 - / ---- � ---- ---- ---- */
  120. 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F,
  121. /* 0x68 ---- , % _ > ? */
  122. 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
  123. /* 0x70 ---- ---- ---- ---- ---- ---- ---- */
  124. 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  125. /* 0x78 * ` : # @ ' = " */
  126. 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
  127. /* 0x80 * a b c d e f g */
  128. 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  129. /* 0x88 h i ---- ---- ---- */
  130. 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1,
  131. /* 0x90 � j k l m n o p */
  132. 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
  133. /* 0x98 q r ---- ---- */
  134. 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07,
  135. /* 0xA0 ~ s t u v w x */
  136. 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
  137. /* 0xA8 y z ---- ---- ---- ---- */
  138. 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07,
  139. /* 0xB0 ^ ---- 〒 ---- */
  140. 0x5E, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC,
  141. /* 0xB8 ---- [ ] ---- ---- ---- ---- */
  142. 0xAB, 0x07, 0x5B, 0x5D, 0x07, 0x07, 0x07, 0x07,
  143. /* 0xC0 { A B C D E F G */
  144. 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
  145. /* 0xC8 H I ---- ‡ ---- */
  146. 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07,
  147. /* 0xD0 } J K L M N O P */
  148. 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
  149. /* 0xD8 Q R ---- ◯ */
  150. 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98,
  151. /* 0xE0 \ S T U V W X */
  152. 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
  153. /* 0xE8 Y Z ---- � ---- ---- ---- */
  154. 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07,
  155. /* 0xF0 0 1 2 3 4 5 6 7 */
  156. 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
  157. /* 0xF8 8 9 ---- ---- ⌒ ---- ---- ---- */
  158. 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07
  159. };
  160. /*
  161. * ASCII (IBM PC 437) -> EBCDIC 500
  162. */
  163. __u8 _ascebc_500[256] =
  164. {
  165. /*00 NUL SOH STX ETX EOT ENQ ACK BEL */
  166. 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
  167. /*08 BS HT LF VT FF CR SO SI */
  168. /* ->NL */
  169. 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  170. /*10 DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
  171. 0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26,
  172. /*18 CAN EM SUB ESC FS GS RS US */
  173. /* ->IGS ->IRS ->IUS */
  174. 0x18, 0x19, 0x3F, 0x27, 0x22, 0x1D, 0x1E, 0x1F,
  175. /*20 SP ! " # $ % & ' */
  176. 0x40, 0x4F, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
  177. /*28 ( ) * + , - . / */
  178. 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
  179. /*30 0 1 2 3 4 5 6 7 */
  180. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  181. /*38 8 9 : ; < = > ? */
  182. 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
  183. /*40 @ A B C D E F G */
  184. 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  185. /*48 H I J K L M N O */
  186. 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
  187. /*50 P Q R S T U V W */
  188. 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
  189. /*58 X Y Z [ \ ] ^ _ */
  190. 0xE7, 0xE8, 0xE9, 0x4A, 0xE0, 0x5A, 0x5F, 0x6D,
  191. /*60 ` a b c d e f g */
  192. 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  193. /*68 h i j k l m n o */
  194. 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
  195. /*70 p q r s t u v w */
  196. 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
  197. /*78 x y z { | } ~ DL */
  198. 0xA7, 0xA8, 0xA9, 0xC0, 0xBB, 0xD0, 0xA1, 0x07,
  199. /*80*/
  200. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  201. /*88*/
  202. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  203. /*90*/
  204. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  205. /*98*/
  206. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  207. /*A0*/
  208. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  209. /*A8*/
  210. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  211. /*B0*/
  212. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  213. /*B8*/
  214. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  215. /*C0*/
  216. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  217. /*C8*/
  218. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  219. /*D0*/
  220. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  221. /*D8*/
  222. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  223. /*E0 sz */
  224. 0x3F, 0x59, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  225. /*E8*/
  226. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  227. /*F0*/
  228. 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
  229. /*F8*/
  230. 0x90, 0x3F, 0x3F, 0x3F, 0x3F, 0xEA, 0x3F, 0xFF
  231. };
  232. /*
  233. * EBCDIC 500 -> ASCII (IBM PC 437)
  234. */
  235. __u8 _ebcasc_500[256] =
  236. {
  237. /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
  238. 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F,
  239. /* 0x08 -GE -SPS -RPT VT FF CR SO SI */
  240. 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  241. /* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC
  242. -ENP ->LF */
  243. 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07,
  244. /* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB
  245. -IUS */
  246. 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  247. /* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC
  248. -INP */
  249. 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B,
  250. /* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL
  251. -SW */
  252. 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07,
  253. /* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */
  254. 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04,
  255. /* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */
  256. 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A,
  257. /* 0x40 SP RSP ∽ ---- */
  258. 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86,
  259. /* 0x48 [ . < ( + ! */
  260. 0x87, 0xA4, 0x5B, 0x2E, 0x3C, 0x28, 0x2B, 0x21,
  261. /* 0x50 & ---- */
  262. 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07,
  263. /* 0x58 ≡ ] $ * ) ; ^ */
  264. 0x8D, 0xE1, 0x5D, 0x24, 0x2A, 0x29, 0x3B, 0x5E,
  265. /* 0x60 - / ---- � ---- ---- ---- */
  266. 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F,
  267. /* 0x68 ---- , % _ > ? */
  268. 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
  269. /* 0x70 ---- ---- ---- ---- ---- ---- ---- */
  270. 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
  271. /* 0x78 * ` : # @ ' = " */
  272. 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
  273. /* 0x80 * a b c d e f g */
  274. 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  275. /* 0x88 h i ---- ---- ---- */
  276. 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1,
  277. /* 0x90 � j k l m n o p */
  278. 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
  279. /* 0x98 q r ---- ---- */
  280. 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07,
  281. /* 0xA0 ~ s t u v w x */
  282. 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
  283. /* 0xA8 y z ---- ---- ---- ---- */
  284. 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07,
  285. /* 0xB0 ---- 〒 ---- */
  286. 0x9B, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC,
  287. /* 0xB8 ---- | ---- ---- ---- ---- */
  288. 0xAB, 0x07, 0xAA, 0x7C, 0x07, 0x07, 0x07, 0x07,
  289. /* 0xC0 { A B C D E F G */
  290. 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
  291. /* 0xC8 H I ---- ‡ ---- */
  292. 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07,
  293. /* 0xD0 } J K L M N O P */
  294. 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
  295. /* 0xD8 Q R ---- ◯ */
  296. 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98,
  297. /* 0xE0 \ S T U V W X */
  298. 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
  299. /* 0xE8 Y Z ---- � ---- ---- ---- */
  300. 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07,
  301. /* 0xF0 0 1 2 3 4 5 6 7 */
  302. 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
  303. /* 0xF8 8 9 ---- ---- ⌒ ---- ---- ---- */
  304. 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07
  305. };
  306. /*
  307. * EBCDIC 037/500 conversion table:
  308. * from upper to lower case
  309. */
  310. __u8 _ebc_tolower[256] =
  311. {
  312. 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  313. 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  314. 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  315. 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
  316. 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
  317. 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
  318. 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
  319. 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
  320. 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
  321. 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
  322. 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
  323. 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
  324. 0x60, 0x61, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
  325. 0x48, 0x49, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  326. 0x70, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
  327. 0x58, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
  328. 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  329. 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
  330. 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
  331. 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9C, 0x9F,
  332. 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
  333. 0xA8, 0xA9, 0xAA, 0xAB, 0x8C, 0x8D, 0x8E, 0xAF,
  334. 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
  335. 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
  336. 0xC0, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  337. 0x88, 0x89, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  338. 0xD0, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
  339. 0x98, 0x99, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
  340. 0xE0, 0xE1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
  341. 0xA8, 0xA9, 0xEA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
  342. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  343. 0xF8, 0xF9, 0xFA, 0xDB, 0xDC, 0xDD, 0xDE, 0xFF
  344. };
  345. /*
  346. * EBCDIC 037/500 conversion table:
  347. * from lower to upper case
  348. */
  349. __u8 _ebc_toupper[256] =
  350. {
  351. 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  352. 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
  353. 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
  354. 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
  355. 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
  356. 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
  357. 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
  358. 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
  359. 0x40, 0x41, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  360. 0x68, 0x69, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
  361. 0x50, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  362. 0x78, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
  363. 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
  364. 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
  365. 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
  366. 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
  367. 0x80, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  368. 0xC8, 0xC9, 0x8A, 0x8B, 0xAC, 0xAD, 0xAE, 0x8F,
  369. 0x90, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  370. 0xD8, 0xD9, 0x9A, 0x9B, 0x9E, 0x9D, 0x9E, 0x9F,
  371. 0xA0, 0xA1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  372. 0xE8, 0xE9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
  373. 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
  374. 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
  375. 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
  376. 0xC8, 0xC9, 0xCA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  377. 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
  378. 0xD8, 0xD9, 0xDA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF,
  379. 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
  380. 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
  381. 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
  382. 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
  383. };
  384. EXPORT_SYMBOL(_ascebc_500);
  385. EXPORT_SYMBOL(_ebcasc_500);
  386. EXPORT_SYMBOL(_ascebc);
  387. EXPORT_SYMBOL(_ebcasc);
  388. EXPORT_SYMBOL(_ebc_tolower);
  389. EXPORT_SYMBOL(_ebc_toupper);