utclib.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. /******************************************************************************
  2. *
  3. * Module Name: cmclib - Local implementation of C library functions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2012, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #include <acpi/acpi.h>
  43. #include "accommon.h"
  44. /*
  45. * These implementations of standard C Library routines can optionally be
  46. * used if a C library is not available. In general, they are less efficient
  47. * than an inline or assembly implementation
  48. */
  49. #define _COMPONENT ACPI_UTILITIES
  50. ACPI_MODULE_NAME("cmclib")
  51. #ifndef ACPI_USE_SYSTEM_CLIBRARY
  52. #define NEGATIVE 1
  53. #define POSITIVE 0
  54. /*******************************************************************************
  55. *
  56. * FUNCTION: acpi_ut_memcmp (memcmp)
  57. *
  58. * PARAMETERS: buffer1 - First Buffer
  59. * buffer2 - Second Buffer
  60. * count - Maximum # of bytes to compare
  61. *
  62. * RETURN: Index where Buffers mismatched, or 0 if Buffers matched
  63. *
  64. * DESCRIPTION: Compare two Buffers, with a maximum length
  65. *
  66. ******************************************************************************/
  67. int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count)
  68. {
  69. return ((count == ACPI_SIZE_MAX) ? 0 : ((unsigned char)*buffer1 -
  70. (unsigned char)*buffer2));
  71. }
  72. /*******************************************************************************
  73. *
  74. * FUNCTION: acpi_ut_memcpy (memcpy)
  75. *
  76. * PARAMETERS: dest - Target of the copy
  77. * src - Source buffer to copy
  78. * count - Number of bytes to copy
  79. *
  80. * RETURN: Dest
  81. *
  82. * DESCRIPTION: Copy arbitrary bytes of memory
  83. *
  84. ******************************************************************************/
  85. void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count)
  86. {
  87. char *new = (char *)dest;
  88. char *old = (char *)src;
  89. while (count) {
  90. *new = *old;
  91. new++;
  92. old++;
  93. count--;
  94. }
  95. return (dest);
  96. }
  97. /*******************************************************************************
  98. *
  99. * FUNCTION: acpi_ut_memset (memset)
  100. *
  101. * PARAMETERS: dest - Buffer to set
  102. * value - Value to set each byte of memory
  103. * count - Number of bytes to set
  104. *
  105. * RETURN: Dest
  106. *
  107. * DESCRIPTION: Initialize a buffer to a known value.
  108. *
  109. ******************************************************************************/
  110. void *acpi_ut_memset(void *dest, u8 value, acpi_size count)
  111. {
  112. char *new = (char *)dest;
  113. while (count) {
  114. *new = (char)value;
  115. new++;
  116. count--;
  117. }
  118. return (dest);
  119. }
  120. /*******************************************************************************
  121. *
  122. * FUNCTION: acpi_ut_strlen (strlen)
  123. *
  124. * PARAMETERS: string - Null terminated string
  125. *
  126. * RETURN: Length
  127. *
  128. * DESCRIPTION: Returns the length of the input string
  129. *
  130. ******************************************************************************/
  131. acpi_size acpi_ut_strlen(const char *string)
  132. {
  133. u32 length = 0;
  134. /* Count the string until a null is encountered */
  135. while (*string) {
  136. length++;
  137. string++;
  138. }
  139. return (length);
  140. }
  141. /*******************************************************************************
  142. *
  143. * FUNCTION: acpi_ut_strcpy (strcpy)
  144. *
  145. * PARAMETERS: dst_string - Target of the copy
  146. * src_string - The source string to copy
  147. *
  148. * RETURN: dst_string
  149. *
  150. * DESCRIPTION: Copy a null terminated string
  151. *
  152. ******************************************************************************/
  153. char *acpi_ut_strcpy(char *dst_string, const char *src_string)
  154. {
  155. char *string = dst_string;
  156. /* Move bytes brute force */
  157. while (*src_string) {
  158. *string = *src_string;
  159. string++;
  160. src_string++;
  161. }
  162. /* Null terminate */
  163. *string = 0;
  164. return (dst_string);
  165. }
  166. /*******************************************************************************
  167. *
  168. * FUNCTION: acpi_ut_strncpy (strncpy)
  169. *
  170. * PARAMETERS: dst_string - Target of the copy
  171. * src_string - The source string to copy
  172. * count - Maximum # of bytes to copy
  173. *
  174. * RETURN: dst_string
  175. *
  176. * DESCRIPTION: Copy a null terminated string, with a maximum length
  177. *
  178. ******************************************************************************/
  179. char *acpi_ut_strncpy(char *dst_string, const char *src_string, acpi_size count)
  180. {
  181. char *string = dst_string;
  182. /* Copy the string */
  183. for (string = dst_string;
  184. count && (count--, (*string++ = *src_string++));) {;
  185. }
  186. /* Pad with nulls if necessary */
  187. while (count--) {
  188. *string = 0;
  189. string++;
  190. }
  191. /* Return original pointer */
  192. return (dst_string);
  193. }
  194. /*******************************************************************************
  195. *
  196. * FUNCTION: acpi_ut_strcmp (strcmp)
  197. *
  198. * PARAMETERS: string1 - First string
  199. * string2 - Second string
  200. *
  201. * RETURN: Index where strings mismatched, or 0 if strings matched
  202. *
  203. * DESCRIPTION: Compare two null terminated strings
  204. *
  205. ******************************************************************************/
  206. int acpi_ut_strcmp(const char *string1, const char *string2)
  207. {
  208. for (; (*string1 == *string2); string2++) {
  209. if (!*string1++) {
  210. return (0);
  211. }
  212. }
  213. return ((unsigned char)*string1 - (unsigned char)*string2);
  214. }
  215. #ifdef ACPI_FUTURE_IMPLEMENTATION
  216. /* Not used at this time */
  217. /*******************************************************************************
  218. *
  219. * FUNCTION: acpi_ut_strchr (strchr)
  220. *
  221. * PARAMETERS: string - Search string
  222. * ch - character to search for
  223. *
  224. * RETURN: Ptr to char or NULL if not found
  225. *
  226. * DESCRIPTION: Search a string for a character
  227. *
  228. ******************************************************************************/
  229. char *acpi_ut_strchr(const char *string, int ch)
  230. {
  231. for (; (*string); string++) {
  232. if ((*string) == (char)ch) {
  233. return ((char *)string);
  234. }
  235. }
  236. return (NULL);
  237. }
  238. #endif
  239. /*******************************************************************************
  240. *
  241. * FUNCTION: acpi_ut_strncmp (strncmp)
  242. *
  243. * PARAMETERS: string1 - First string
  244. * string2 - Second string
  245. * count - Maximum # of bytes to compare
  246. *
  247. * RETURN: Index where strings mismatched, or 0 if strings matched
  248. *
  249. * DESCRIPTION: Compare two null terminated strings, with a maximum length
  250. *
  251. ******************************************************************************/
  252. int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count)
  253. {
  254. for (; count-- && (*string1 == *string2); string2++) {
  255. if (!*string1++) {
  256. return (0);
  257. }
  258. }
  259. return ((count == ACPI_SIZE_MAX) ? 0 : ((unsigned char)*string1 -
  260. (unsigned char)*string2));
  261. }
  262. /*******************************************************************************
  263. *
  264. * FUNCTION: acpi_ut_strcat (Strcat)
  265. *
  266. * PARAMETERS: dst_string - Target of the copy
  267. * src_string - The source string to copy
  268. *
  269. * RETURN: dst_string
  270. *
  271. * DESCRIPTION: Append a null terminated string to a null terminated string
  272. *
  273. ******************************************************************************/
  274. char *acpi_ut_strcat(char *dst_string, const char *src_string)
  275. {
  276. char *string;
  277. /* Find end of the destination string */
  278. for (string = dst_string; *string++;) {;
  279. }
  280. /* Concatenate the string */
  281. for (--string; (*string++ = *src_string++);) {;
  282. }
  283. return (dst_string);
  284. }
  285. /*******************************************************************************
  286. *
  287. * FUNCTION: acpi_ut_strncat (strncat)
  288. *
  289. * PARAMETERS: dst_string - Target of the copy
  290. * src_string - The source string to copy
  291. * count - Maximum # of bytes to copy
  292. *
  293. * RETURN: dst_string
  294. *
  295. * DESCRIPTION: Append a null terminated string to a null terminated string,
  296. * with a maximum count.
  297. *
  298. ******************************************************************************/
  299. char *acpi_ut_strncat(char *dst_string, const char *src_string, acpi_size count)
  300. {
  301. char *string;
  302. if (count) {
  303. /* Find end of the destination string */
  304. for (string = dst_string; *string++;) {;
  305. }
  306. /* Concatenate the string */
  307. for (--string; (*string++ = *src_string++) && --count;) {;
  308. }
  309. /* Null terminate if necessary */
  310. if (!count) {
  311. *string = 0;
  312. }
  313. }
  314. return (dst_string);
  315. }
  316. /*******************************************************************************
  317. *
  318. * FUNCTION: acpi_ut_strstr (strstr)
  319. *
  320. * PARAMETERS: string1 - Target string
  321. * string2 - Substring to search for
  322. *
  323. * RETURN: Where substring match starts, Null if no match found
  324. *
  325. * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
  326. * full implementation of strstr, only sufficient for command
  327. * matching
  328. *
  329. ******************************************************************************/
  330. char *acpi_ut_strstr(char *string1, char *string2)
  331. {
  332. char *string;
  333. if (acpi_ut_strlen(string2) > acpi_ut_strlen(string1)) {
  334. return (NULL);
  335. }
  336. /* Walk entire string, comparing the letters */
  337. for (string = string1; *string2;) {
  338. if (*string2 != *string) {
  339. return (NULL);
  340. }
  341. string2++;
  342. string++;
  343. }
  344. return (string1);
  345. }
  346. /*******************************************************************************
  347. *
  348. * FUNCTION: acpi_ut_strtoul (strtoul)
  349. *
  350. * PARAMETERS: string - Null terminated string
  351. * terminater - Where a pointer to the terminating byte is
  352. * returned
  353. * base - Radix of the string
  354. *
  355. * RETURN: Converted value
  356. *
  357. * DESCRIPTION: Convert a string into a 32-bit unsigned value.
  358. * Note: use acpi_ut_strtoul64 for 64-bit integers.
  359. *
  360. ******************************************************************************/
  361. u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base)
  362. {
  363. u32 converted = 0;
  364. u32 index;
  365. u32 sign;
  366. const char *string_start;
  367. u32 return_value = 0;
  368. acpi_status status = AE_OK;
  369. /*
  370. * Save the value of the pointer to the buffer's first
  371. * character, save the current errno value, and then
  372. * skip over any white space in the buffer:
  373. */
  374. string_start = string;
  375. while (ACPI_IS_SPACE(*string) || *string == '\t') {
  376. ++string;
  377. }
  378. /*
  379. * The buffer may contain an optional plus or minus sign.
  380. * If it does, then skip over it but remember what is was:
  381. */
  382. if (*string == '-') {
  383. sign = NEGATIVE;
  384. ++string;
  385. } else if (*string == '+') {
  386. ++string;
  387. sign = POSITIVE;
  388. } else {
  389. sign = POSITIVE;
  390. }
  391. /*
  392. * If the input parameter Base is zero, then we need to
  393. * determine if it is octal, decimal, or hexadecimal:
  394. */
  395. if (base == 0) {
  396. if (*string == '0') {
  397. if (acpi_ut_to_lower(*(++string)) == 'x') {
  398. base = 16;
  399. ++string;
  400. } else {
  401. base = 8;
  402. }
  403. } else {
  404. base = 10;
  405. }
  406. } else if (base < 2 || base > 36) {
  407. /*
  408. * The specified Base parameter is not in the domain of
  409. * this function:
  410. */
  411. goto done;
  412. }
  413. /*
  414. * For octal and hexadecimal bases, skip over the leading
  415. * 0 or 0x, if they are present.
  416. */
  417. if (base == 8 && *string == '0') {
  418. string++;
  419. }
  420. if (base == 16 &&
  421. *string == '0' && acpi_ut_to_lower(*(++string)) == 'x') {
  422. string++;
  423. }
  424. /*
  425. * Main loop: convert the string to an unsigned long:
  426. */
  427. while (*string) {
  428. if (ACPI_IS_DIGIT(*string)) {
  429. index = (u32)((u8)*string - '0');
  430. } else {
  431. index = (u32)acpi_ut_to_upper(*string);
  432. if (ACPI_IS_UPPER(index)) {
  433. index = index - 'A' + 10;
  434. } else {
  435. goto done;
  436. }
  437. }
  438. if (index >= base) {
  439. goto done;
  440. }
  441. /*
  442. * Check to see if value is out of range:
  443. */
  444. if (return_value > ((ACPI_UINT32_MAX - (u32)index) / (u32)base)) {
  445. status = AE_ERROR;
  446. return_value = 0; /* reset */
  447. } else {
  448. return_value *= base;
  449. return_value += index;
  450. converted = 1;
  451. }
  452. ++string;
  453. }
  454. done:
  455. /*
  456. * If appropriate, update the caller's pointer to the next
  457. * unconverted character in the buffer.
  458. */
  459. if (terminator) {
  460. if (converted == 0 && return_value == 0 && string != NULL) {
  461. *terminator = (char *)string_start;
  462. } else {
  463. *terminator = (char *)string;
  464. }
  465. }
  466. if (status == AE_ERROR) {
  467. return_value = ACPI_UINT32_MAX;
  468. }
  469. /*
  470. * If a minus sign was present, then "the conversion is negated":
  471. */
  472. if (sign == NEGATIVE) {
  473. return_value = (ACPI_UINT32_MAX - return_value) + 1;
  474. }
  475. return (return_value);
  476. }
  477. /*******************************************************************************
  478. *
  479. * FUNCTION: acpi_ut_to_upper (TOUPPER)
  480. *
  481. * PARAMETERS: c - Character to convert
  482. *
  483. * RETURN: Converted character as an int
  484. *
  485. * DESCRIPTION: Convert character to uppercase
  486. *
  487. ******************************************************************************/
  488. int acpi_ut_to_upper(int c)
  489. {
  490. return (ACPI_IS_LOWER(c) ? ((c) - 0x20) : (c));
  491. }
  492. /*******************************************************************************
  493. *
  494. * FUNCTION: acpi_ut_to_lower (TOLOWER)
  495. *
  496. * PARAMETERS: c - Character to convert
  497. *
  498. * RETURN: Converted character as an int
  499. *
  500. * DESCRIPTION: Convert character to lowercase
  501. *
  502. ******************************************************************************/
  503. int acpi_ut_to_lower(int c)
  504. {
  505. return (ACPI_IS_UPPER(c) ? ((c) + 0x20) : (c));
  506. }
  507. /*******************************************************************************
  508. *
  509. * FUNCTION: is* functions
  510. *
  511. * DESCRIPTION: is* functions use the ctype table below
  512. *
  513. ******************************************************************************/
  514. const u8 _acpi_ctype[257] = {
  515. _ACPI_CN, /* 0x00 0 NUL */
  516. _ACPI_CN, /* 0x01 1 SOH */
  517. _ACPI_CN, /* 0x02 2 STX */
  518. _ACPI_CN, /* 0x03 3 ETX */
  519. _ACPI_CN, /* 0x04 4 EOT */
  520. _ACPI_CN, /* 0x05 5 ENQ */
  521. _ACPI_CN, /* 0x06 6 ACK */
  522. _ACPI_CN, /* 0x07 7 BEL */
  523. _ACPI_CN, /* 0x08 8 BS */
  524. _ACPI_CN | _ACPI_SP, /* 0x09 9 TAB */
  525. _ACPI_CN | _ACPI_SP, /* 0x0A 10 LF */
  526. _ACPI_CN | _ACPI_SP, /* 0x0B 11 VT */
  527. _ACPI_CN | _ACPI_SP, /* 0x0C 12 FF */
  528. _ACPI_CN | _ACPI_SP, /* 0x0D 13 CR */
  529. _ACPI_CN, /* 0x0E 14 SO */
  530. _ACPI_CN, /* 0x0F 15 SI */
  531. _ACPI_CN, /* 0x10 16 DLE */
  532. _ACPI_CN, /* 0x11 17 DC1 */
  533. _ACPI_CN, /* 0x12 18 DC2 */
  534. _ACPI_CN, /* 0x13 19 DC3 */
  535. _ACPI_CN, /* 0x14 20 DC4 */
  536. _ACPI_CN, /* 0x15 21 NAK */
  537. _ACPI_CN, /* 0x16 22 SYN */
  538. _ACPI_CN, /* 0x17 23 ETB */
  539. _ACPI_CN, /* 0x18 24 CAN */
  540. _ACPI_CN, /* 0x19 25 EM */
  541. _ACPI_CN, /* 0x1A 26 SUB */
  542. _ACPI_CN, /* 0x1B 27 ESC */
  543. _ACPI_CN, /* 0x1C 28 FS */
  544. _ACPI_CN, /* 0x1D 29 GS */
  545. _ACPI_CN, /* 0x1E 30 RS */
  546. _ACPI_CN, /* 0x1F 31 US */
  547. _ACPI_XS | _ACPI_SP, /* 0x20 32 ' ' */
  548. _ACPI_PU, /* 0x21 33 '!' */
  549. _ACPI_PU, /* 0x22 34 '"' */
  550. _ACPI_PU, /* 0x23 35 '#' */
  551. _ACPI_PU, /* 0x24 36 '$' */
  552. _ACPI_PU, /* 0x25 37 '%' */
  553. _ACPI_PU, /* 0x26 38 '&' */
  554. _ACPI_PU, /* 0x27 39 ''' */
  555. _ACPI_PU, /* 0x28 40 '(' */
  556. _ACPI_PU, /* 0x29 41 ')' */
  557. _ACPI_PU, /* 0x2A 42 '*' */
  558. _ACPI_PU, /* 0x2B 43 '+' */
  559. _ACPI_PU, /* 0x2C 44 ',' */
  560. _ACPI_PU, /* 0x2D 45 '-' */
  561. _ACPI_PU, /* 0x2E 46 '.' */
  562. _ACPI_PU, /* 0x2F 47 '/' */
  563. _ACPI_XD | _ACPI_DI, /* 0x30 48 '0' */
  564. _ACPI_XD | _ACPI_DI, /* 0x31 49 '1' */
  565. _ACPI_XD | _ACPI_DI, /* 0x32 50 '2' */
  566. _ACPI_XD | _ACPI_DI, /* 0x33 51 '3' */
  567. _ACPI_XD | _ACPI_DI, /* 0x34 52 '4' */
  568. _ACPI_XD | _ACPI_DI, /* 0x35 53 '5' */
  569. _ACPI_XD | _ACPI_DI, /* 0x36 54 '6' */
  570. _ACPI_XD | _ACPI_DI, /* 0x37 55 '7' */
  571. _ACPI_XD | _ACPI_DI, /* 0x38 56 '8' */
  572. _ACPI_XD | _ACPI_DI, /* 0x39 57 '9' */
  573. _ACPI_PU, /* 0x3A 58 ':' */
  574. _ACPI_PU, /* 0x3B 59 ';' */
  575. _ACPI_PU, /* 0x3C 60 '<' */
  576. _ACPI_PU, /* 0x3D 61 '=' */
  577. _ACPI_PU, /* 0x3E 62 '>' */
  578. _ACPI_PU, /* 0x3F 63 '?' */
  579. _ACPI_PU, /* 0x40 64 '@' */
  580. _ACPI_XD | _ACPI_UP, /* 0x41 65 'A' */
  581. _ACPI_XD | _ACPI_UP, /* 0x42 66 'B' */
  582. _ACPI_XD | _ACPI_UP, /* 0x43 67 'C' */
  583. _ACPI_XD | _ACPI_UP, /* 0x44 68 'D' */
  584. _ACPI_XD | _ACPI_UP, /* 0x45 69 'E' */
  585. _ACPI_XD | _ACPI_UP, /* 0x46 70 'F' */
  586. _ACPI_UP, /* 0x47 71 'G' */
  587. _ACPI_UP, /* 0x48 72 'H' */
  588. _ACPI_UP, /* 0x49 73 'I' */
  589. _ACPI_UP, /* 0x4A 74 'J' */
  590. _ACPI_UP, /* 0x4B 75 'K' */
  591. _ACPI_UP, /* 0x4C 76 'L' */
  592. _ACPI_UP, /* 0x4D 77 'M' */
  593. _ACPI_UP, /* 0x4E 78 'N' */
  594. _ACPI_UP, /* 0x4F 79 'O' */
  595. _ACPI_UP, /* 0x50 80 'P' */
  596. _ACPI_UP, /* 0x51 81 'Q' */
  597. _ACPI_UP, /* 0x52 82 'R' */
  598. _ACPI_UP, /* 0x53 83 'S' */
  599. _ACPI_UP, /* 0x54 84 'T' */
  600. _ACPI_UP, /* 0x55 85 'U' */
  601. _ACPI_UP, /* 0x56 86 'V' */
  602. _ACPI_UP, /* 0x57 87 'W' */
  603. _ACPI_UP, /* 0x58 88 'X' */
  604. _ACPI_UP, /* 0x59 89 'Y' */
  605. _ACPI_UP, /* 0x5A 90 'Z' */
  606. _ACPI_PU, /* 0x5B 91 '[' */
  607. _ACPI_PU, /* 0x5C 92 '\' */
  608. _ACPI_PU, /* 0x5D 93 ']' */
  609. _ACPI_PU, /* 0x5E 94 '^' */
  610. _ACPI_PU, /* 0x5F 95 '_' */
  611. _ACPI_PU, /* 0x60 96 '`' */
  612. _ACPI_XD | _ACPI_LO, /* 0x61 97 'a' */
  613. _ACPI_XD | _ACPI_LO, /* 0x62 98 'b' */
  614. _ACPI_XD | _ACPI_LO, /* 0x63 99 'c' */
  615. _ACPI_XD | _ACPI_LO, /* 0x64 100 'd' */
  616. _ACPI_XD | _ACPI_LO, /* 0x65 101 'e' */
  617. _ACPI_XD | _ACPI_LO, /* 0x66 102 'f' */
  618. _ACPI_LO, /* 0x67 103 'g' */
  619. _ACPI_LO, /* 0x68 104 'h' */
  620. _ACPI_LO, /* 0x69 105 'i' */
  621. _ACPI_LO, /* 0x6A 106 'j' */
  622. _ACPI_LO, /* 0x6B 107 'k' */
  623. _ACPI_LO, /* 0x6C 108 'l' */
  624. _ACPI_LO, /* 0x6D 109 'm' */
  625. _ACPI_LO, /* 0x6E 110 'n' */
  626. _ACPI_LO, /* 0x6F 111 'o' */
  627. _ACPI_LO, /* 0x70 112 'p' */
  628. _ACPI_LO, /* 0x71 113 'q' */
  629. _ACPI_LO, /* 0x72 114 'r' */
  630. _ACPI_LO, /* 0x73 115 's' */
  631. _ACPI_LO, /* 0x74 116 't' */
  632. _ACPI_LO, /* 0x75 117 'u' */
  633. _ACPI_LO, /* 0x76 118 'v' */
  634. _ACPI_LO, /* 0x77 119 'w' */
  635. _ACPI_LO, /* 0x78 120 'x' */
  636. _ACPI_LO, /* 0x79 121 'y' */
  637. _ACPI_LO, /* 0x7A 122 'z' */
  638. _ACPI_PU, /* 0x7B 123 '{' */
  639. _ACPI_PU, /* 0x7C 124 '|' */
  640. _ACPI_PU, /* 0x7D 125 '}' */
  641. _ACPI_PU, /* 0x7E 126 '~' */
  642. _ACPI_CN, /* 0x7F 127 DEL */
  643. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 to 0x8F */
  644. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 to 0x9F */
  645. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 to 0xAF */
  646. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 to 0xBF */
  647. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 to 0xCF */
  648. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 to 0xDF */
  649. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 to 0xEF */
  650. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xF0 to 0xFF */
  651. 0 /* 0x100 */
  652. };
  653. #endif /* ACPI_USE_SYSTEM_CLIBRARY */