[ACPICA]
[reactos.git] / reactos / drivers / bus / acpi / acpica / utilities / utclib.c
1 /******************************************************************************
2 *
3 * Module Name: utclib - ACPICA implementations of C library functions
4 *
5 *****************************************************************************/
6
7 /******************************************************************************
8 *
9 * 1. Copyright Notice
10 *
11 * Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
12 * All rights reserved.
13 *
14 * 2. License
15 *
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
20 *
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
27 *
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
36 *
37 * The above copyright and patent license is granted only if the following
38 * conditions are met:
39 *
40 * 3. Conditions
41 *
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
53 *
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
64 * make.
65 *
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
70 * distribution.
71 *
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
74 *
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
79 *
80 * 4. Disclaimer and Export Compliance
81 *
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 * PARTICULAR PURPOSE.
89 *
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 * LIMITED REMEDY.
98 *
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
113 *
114 *****************************************************************************/
115
116 #define ACPI_CLIBRARY
117 #include "acpi.h"
118 #include "accommon.h"
119
120 /*
121 * This module contains implementations of the standard C library functions
122 * that are required by the ACPICA code at both application level and kernel
123 * level.
124 *
125 * The module is an optional feature that can be used if a local/system
126 * C library is not available. Some operating system kernels may not have
127 * an internal C library.
128 *
129 * In general, these functions are less efficient than an inline or assembly
130 * code implementation.
131 *
132 * These C functions and the associated prototypes are enabled by default
133 * unless the ACPI_USE_SYSTEM_CLIBRARY symbol is defined. This is usually
134 * automatically defined for the ACPICA applications such as iASL and
135 * AcpiExec, so that these user-level applications use the local C library
136 * instead of the functions in this module.
137 */
138
139 /*******************************************************************************
140 *
141 * Functions implemented in this module:
142 *
143 * FUNCTION: memcmp
144 * FUNCTION: memcpy
145 * FUNCTION: memset
146 * FUNCTION: strlen
147 * FUNCTION: strcpy
148 * FUNCTION: strncpy
149 * FUNCTION: strcmp
150 * FUNCTION: strchr
151 * FUNCTION: strncmp
152 * FUNCTION: strcat
153 * FUNCTION: strncat
154 * FUNCTION: strstr
155 * FUNCTION: strtoul
156 * FUNCTION: toupper
157 * FUNCTION: tolower
158 * FUNCTION: is* functions
159 *
160 ******************************************************************************/
161
162 #define _COMPONENT ACPI_UTILITIES
163 ACPI_MODULE_NAME ("utclib")
164
165
166 #ifndef ACPI_USE_SYSTEM_CLIBRARY /* Entire module */
167
168
169 /*******************************************************************************
170 *
171 * FUNCTION: memcmp
172 *
173 * PARAMETERS: Buffer1 - First Buffer
174 * Buffer2 - Second Buffer
175 * Count - Maximum # of bytes to compare
176 *
177 * RETURN: Index where Buffers mismatched, or 0 if Buffers matched
178 *
179 * DESCRIPTION: Compare two Buffers, with a maximum length
180 *
181 ******************************************************************************/
182 #ifdef __REACTOS__
183 int
184 memcmp (
185 const void *VBuffer1,
186 const void *VBuffer2,
187 ACPI_SIZE Count)
188 #else /* __REACTOS__ */
189 int
190 memcmp (
191 void *VBuffer1,
192 void *VBuffer2,
193 ACPI_SIZE Count)
194 #endif /* __REACTOS__ */
195 {
196 char *Buffer1 = (char *) VBuffer1;
197 char *Buffer2 = (char *) VBuffer2;
198
199
200 for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++)
201 {
202 }
203
204 return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *Buffer1 -
205 (unsigned char) *Buffer2));
206 }
207
208
209 /*******************************************************************************
210 *
211 * FUNCTION: memcpy
212 *
213 * PARAMETERS: Dest - Target of the copy
214 * Src - Source buffer to copy
215 * Count - Number of bytes to copy
216 *
217 * RETURN: Dest
218 *
219 * DESCRIPTION: Copy arbitrary bytes of memory
220 *
221 ******************************************************************************/
222
223 void *
224 memcpy (
225 void *Dest,
226 const void *Src,
227 ACPI_SIZE Count)
228 {
229 char *New = (char *) Dest;
230 char *Old = (char *) Src;
231
232
233 while (Count)
234 {
235 *New = *Old;
236 New++;
237 Old++;
238 Count--;
239 }
240
241 return (Dest);
242 }
243
244
245 /*******************************************************************************
246 *
247 * FUNCTION: memset
248 *
249 * PARAMETERS: Dest - Buffer to set
250 * Value - Value to set each byte of memory
251 * Count - Number of bytes to set
252 *
253 * RETURN: Dest
254 *
255 * DESCRIPTION: Initialize a buffer to a known value.
256 *
257 ******************************************************************************/
258
259 void *
260 memset (
261 void *Dest,
262 int Value,
263 ACPI_SIZE Count)
264 {
265 char *New = (char *) Dest;
266
267
268 while (Count)
269 {
270 *New = (char) Value;
271 New++;
272 Count--;
273 }
274
275 return (Dest);
276 }
277
278
279 /*******************************************************************************
280 *
281 * FUNCTION: strlen
282 *
283 * PARAMETERS: String - Null terminated string
284 *
285 * RETURN: Length
286 *
287 * DESCRIPTION: Returns the length of the input string
288 *
289 ******************************************************************************/
290
291
292 ACPI_SIZE
293 strlen (
294 const char *String)
295 {
296 UINT32 Length = 0;
297
298
299 /* Count the string until a null is encountered */
300
301 while (*String)
302 {
303 Length++;
304 String++;
305 }
306
307 return (Length);
308 }
309
310
311 /*******************************************************************************
312 *
313 * FUNCTION: strcpy
314 *
315 * PARAMETERS: DstString - Target of the copy
316 * SrcString - The source string to copy
317 *
318 * RETURN: DstString
319 *
320 * DESCRIPTION: Copy a null terminated string
321 *
322 ******************************************************************************/
323
324 char *
325 strcpy (
326 char *DstString,
327 const char *SrcString)
328 {
329 char *String = DstString;
330
331
332 /* Move bytes brute force */
333
334 while (*SrcString)
335 {
336 *String = *SrcString;
337
338 String++;
339 SrcString++;
340 }
341
342 /* Null terminate */
343
344 *String = 0;
345 return (DstString);
346 }
347
348
349 /*******************************************************************************
350 *
351 * FUNCTION: strncpy
352 *
353 * PARAMETERS: DstString - Target of the copy
354 * SrcString - The source string to copy
355 * Count - Maximum # of bytes to copy
356 *
357 * RETURN: DstString
358 *
359 * DESCRIPTION: Copy a null terminated string, with a maximum length
360 *
361 ******************************************************************************/
362
363 char *
364 strncpy (
365 char *DstString,
366 const char *SrcString,
367 ACPI_SIZE Count)
368 {
369 char *String = DstString;
370
371
372 /* Copy the string */
373
374 for (String = DstString;
375 Count && (Count--, (*String++ = *SrcString++)); )
376 {;}
377
378 /* Pad with nulls if necessary */
379
380 while (Count--)
381 {
382 *String = 0;
383 String++;
384 }
385
386 /* Return original pointer */
387
388 return (DstString);
389 }
390
391
392 /*******************************************************************************
393 *
394 * FUNCTION: strcmp
395 *
396 * PARAMETERS: String1 - First string
397 * String2 - Second string
398 *
399 * RETURN: Index where strings mismatched, or 0 if strings matched
400 *
401 * DESCRIPTION: Compare two null terminated strings
402 *
403 ******************************************************************************/
404
405 int
406 strcmp (
407 const char *String1,
408 const char *String2)
409 {
410
411
412 for ( ; (*String1 == *String2); String2++)
413 {
414 if (!*String1++)
415 {
416 return (0);
417 }
418 }
419
420 return ((unsigned char) *String1 - (unsigned char) *String2);
421 }
422
423
424 /*******************************************************************************
425 *
426 * FUNCTION: strchr
427 *
428 * PARAMETERS: String - Search string
429 * ch - character to search for
430 *
431 * RETURN: Ptr to char or NULL if not found
432 *
433 * DESCRIPTION: Search a string for a character
434 *
435 ******************************************************************************/
436
437 char *
438 strchr (
439 const char *String,
440 int ch)
441 {
442
443
444 for ( ; (*String); String++)
445 {
446 if ((*String) == (char) ch)
447 {
448 return ((char *) String);
449 }
450 }
451
452 return (NULL);
453 }
454
455
456 /*******************************************************************************
457 *
458 * FUNCTION: strncmp
459 *
460 * PARAMETERS: String1 - First string
461 * String2 - Second string
462 * Count - Maximum # of bytes to compare
463 *
464 * RETURN: Index where strings mismatched, or 0 if strings matched
465 *
466 * DESCRIPTION: Compare two null terminated strings, with a maximum length
467 *
468 ******************************************************************************/
469
470 int
471 strncmp (
472 const char *String1,
473 const char *String2,
474 ACPI_SIZE Count)
475 {
476
477
478 for ( ; Count-- && (*String1 == *String2); String2++)
479 {
480 if (!*String1++)
481 {
482 return (0);
483 }
484 }
485
486 return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *String1 -
487 (unsigned char) *String2));
488 }
489
490
491 /*******************************************************************************
492 *
493 * FUNCTION: strcat
494 *
495 * PARAMETERS: DstString - Target of the copy
496 * SrcString - The source string to copy
497 *
498 * RETURN: DstString
499 *
500 * DESCRIPTION: Append a null terminated string to a null terminated string
501 *
502 ******************************************************************************/
503
504 char *
505 strcat (
506 char *DstString,
507 const char *SrcString)
508 {
509 char *String;
510
511
512 /* Find end of the destination string */
513
514 for (String = DstString; *String++; )
515 { ; }
516
517 /* Concatenate the string */
518
519 for (--String; (*String++ = *SrcString++); )
520 { ; }
521
522 return (DstString);
523 }
524
525
526 /*******************************************************************************
527 *
528 * FUNCTION: strncat
529 *
530 * PARAMETERS: DstString - Target of the copy
531 * SrcString - The source string to copy
532 * Count - Maximum # of bytes to copy
533 *
534 * RETURN: DstString
535 *
536 * DESCRIPTION: Append a null terminated string to a null terminated string,
537 * with a maximum count.
538 *
539 ******************************************************************************/
540
541 char *
542 strncat (
543 char *DstString,
544 const char *SrcString,
545 ACPI_SIZE Count)
546 {
547 char *String;
548
549
550 if (Count)
551 {
552 /* Find end of the destination string */
553
554 for (String = DstString; *String++; )
555 { ; }
556
557 /* Concatenate the string */
558
559 for (--String; (*String++ = *SrcString++) && --Count; )
560 { ; }
561
562 /* Null terminate if necessary */
563
564 if (!Count)
565 {
566 *String = 0;
567 }
568 }
569
570 return (DstString);
571 }
572
573
574 /*******************************************************************************
575 *
576 * FUNCTION: strstr
577 *
578 * PARAMETERS: String1 - Target string
579 * String2 - Substring to search for
580 *
581 * RETURN: Where substring match starts, Null if no match found
582 *
583 * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
584 * full implementation of strstr, only sufficient for command
585 * matching
586 *
587 ******************************************************************************/
588
589 #ifdef __REACTOS__
590 char *
591 strstr (
592 const char *String1,
593 const char *String2)
594 #else /* __REACTOS **/
595 char *
596 strstr (
597 char *String1,
598 char *String2)
599 #endif /* __REACTOS__ */
600 {
601 UINT32 Length;
602
603
604 Length = strlen (String2);
605 if (!Length)
606 {
607 #ifdef __REACTOS__
608 return (char *)(String1);
609 #else /* __REACTOS__ */
610 return (String1);
611 #endif /* __REACTOS__ */
612 }
613
614 while (strlen (String1) >= Length)
615 {
616 if (memcmp (String1, String2, Length) == 0)
617 {
618 #ifdef __REACTOS__
619 return (char *)(String1);
620 #else /* __REACTOS__ */
621 return (String1);
622 #endif /* __REACTOS__ */
623 }
624 String1++;
625 }
626
627 return (NULL);
628 }
629
630
631 /*******************************************************************************
632 *
633 * FUNCTION: strtoul
634 *
635 * PARAMETERS: String - Null terminated string
636 * Terminater - Where a pointer to the terminating byte is
637 * returned
638 * Base - Radix of the string
639 *
640 * RETURN: Converted value
641 *
642 * DESCRIPTION: Convert a string into a 32-bit unsigned value.
643 * Note: use strtoul64 for 64-bit integers.
644 *
645 ******************************************************************************/
646
647 UINT32
648 strtoul (
649 const char *String,
650 char **Terminator,
651 UINT32 Base)
652 {
653 UINT32 converted = 0;
654 UINT32 index;
655 UINT32 sign;
656 const char *StringStart;
657 UINT32 ReturnValue = 0;
658 ACPI_STATUS Status = AE_OK;
659
660
661 /*
662 * Save the value of the pointer to the buffer's first
663 * character, save the current errno value, and then
664 * skip over any white space in the buffer:
665 */
666 StringStart = String;
667 while (isspace (*String) || *String == '\t')
668 {
669 ++String;
670 }
671
672 /*
673 * The buffer may contain an optional plus or minus sign.
674 * If it does, then skip over it but remember what is was:
675 */
676 if (*String == '-')
677 {
678 sign = ACPI_SIGN_NEGATIVE;
679 ++String;
680 }
681 else if (*String == '+')
682 {
683 ++String;
684 sign = ACPI_SIGN_POSITIVE;
685 }
686 else
687 {
688 sign = ACPI_SIGN_POSITIVE;
689 }
690
691 /*
692 * If the input parameter Base is zero, then we need to
693 * determine if it is octal, decimal, or hexadecimal:
694 */
695 if (Base == 0)
696 {
697 if (*String == '0')
698 {
699 if (tolower (*(++String)) == 'x')
700 {
701 Base = 16;
702 ++String;
703 }
704 else
705 {
706 Base = 8;
707 }
708 }
709 else
710 {
711 Base = 10;
712 }
713 }
714 else if (Base < 2 || Base > 36)
715 {
716 /*
717 * The specified Base parameter is not in the domain of
718 * this function:
719 */
720 goto done;
721 }
722
723 /*
724 * For octal and hexadecimal bases, skip over the leading
725 * 0 or 0x, if they are present.
726 */
727 if (Base == 8 && *String == '0')
728 {
729 String++;
730 }
731
732 if (Base == 16 &&
733 *String == '0' &&
734 tolower (*(++String)) == 'x')
735 {
736 String++;
737 }
738
739 /*
740 * Main loop: convert the string to an unsigned long:
741 */
742 while (*String)
743 {
744 if (isdigit (*String))
745 {
746 index = (UINT32) ((UINT8) *String - '0');
747 }
748 else
749 {
750 index = (UINT32) toupper (*String);
751 if (isupper (index))
752 {
753 index = index - 'A' + 10;
754 }
755 else
756 {
757 goto done;
758 }
759 }
760
761 if (index >= Base)
762 {
763 goto done;
764 }
765
766 /*
767 * Check to see if value is out of range:
768 */
769
770 if (ReturnValue > ((ACPI_UINT32_MAX - (UINT32) index) /
771 (UINT32) Base))
772 {
773 Status = AE_ERROR;
774 ReturnValue = 0; /* reset */
775 }
776 else
777 {
778 ReturnValue *= Base;
779 ReturnValue += index;
780 converted = 1;
781 }
782
783 ++String;
784 }
785
786 done:
787 /*
788 * If appropriate, update the caller's pointer to the next
789 * unconverted character in the buffer.
790 */
791 if (Terminator)
792 {
793 if (converted == 0 && ReturnValue == 0 && String != NULL)
794 {
795 *Terminator = (char *) StringStart;
796 }
797 else
798 {
799 *Terminator = (char *) String;
800 }
801 }
802
803 if (Status == AE_ERROR)
804 {
805 ReturnValue = ACPI_UINT32_MAX;
806 }
807
808 /*
809 * If a minus sign was present, then "the conversion is negated":
810 */
811 if (sign == ACPI_SIGN_NEGATIVE)
812 {
813 ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
814 }
815
816 return (ReturnValue);
817 }
818
819
820 /*******************************************************************************
821 *
822 * FUNCTION: toupper
823 *
824 * PARAMETERS: c - Character to convert
825 *
826 * RETURN: Converted character as an int
827 *
828 * DESCRIPTION: Convert character to uppercase
829 *
830 ******************************************************************************/
831
832 int
833 toupper (
834 int c)
835 {
836
837 return (islower(c) ? ((c)-0x20) : (c));
838 }
839
840
841 /*******************************************************************************
842 *
843 * FUNCTION: tolower
844 *
845 * PARAMETERS: c - Character to convert
846 *
847 * RETURN: Converted character as an int
848 *
849 * DESCRIPTION: Convert character to lowercase
850 *
851 ******************************************************************************/
852
853 int
854 tolower (
855 int c)
856 {
857
858 return (isupper(c) ? ((c)+0x20) : (c));
859 }
860
861
862 /*******************************************************************************
863 *
864 * FUNCTION: is* function array
865 *
866 * DESCRIPTION: is* functions use the ctype table below
867 *
868 ******************************************************************************/
869
870 const UINT8 AcpiGbl_Ctypes[257] = {
871 _ACPI_CN, /* 0x00 0 NUL */
872 _ACPI_CN, /* 0x01 1 SOH */
873 _ACPI_CN, /* 0x02 2 STX */
874 _ACPI_CN, /* 0x03 3 ETX */
875 _ACPI_CN, /* 0x04 4 EOT */
876 _ACPI_CN, /* 0x05 5 ENQ */
877 _ACPI_CN, /* 0x06 6 ACK */
878 _ACPI_CN, /* 0x07 7 BEL */
879 _ACPI_CN, /* 0x08 8 BS */
880 _ACPI_CN|_ACPI_SP, /* 0x09 9 TAB */
881 _ACPI_CN|_ACPI_SP, /* 0x0A 10 LF */
882 _ACPI_CN|_ACPI_SP, /* 0x0B 11 VT */
883 _ACPI_CN|_ACPI_SP, /* 0x0C 12 FF */
884 _ACPI_CN|_ACPI_SP, /* 0x0D 13 CR */
885 _ACPI_CN, /* 0x0E 14 SO */
886 _ACPI_CN, /* 0x0F 15 SI */
887 _ACPI_CN, /* 0x10 16 DLE */
888 _ACPI_CN, /* 0x11 17 DC1 */
889 _ACPI_CN, /* 0x12 18 DC2 */
890 _ACPI_CN, /* 0x13 19 DC3 */
891 _ACPI_CN, /* 0x14 20 DC4 */
892 _ACPI_CN, /* 0x15 21 NAK */
893 _ACPI_CN, /* 0x16 22 SYN */
894 _ACPI_CN, /* 0x17 23 ETB */
895 _ACPI_CN, /* 0x18 24 CAN */
896 _ACPI_CN, /* 0x19 25 EM */
897 _ACPI_CN, /* 0x1A 26 SUB */
898 _ACPI_CN, /* 0x1B 27 ESC */
899 _ACPI_CN, /* 0x1C 28 FS */
900 _ACPI_CN, /* 0x1D 29 GS */
901 _ACPI_CN, /* 0x1E 30 RS */
902 _ACPI_CN, /* 0x1F 31 US */
903 _ACPI_XS|_ACPI_SP, /* 0x20 32 ' ' */
904 _ACPI_PU, /* 0x21 33 '!' */
905 _ACPI_PU, /* 0x22 34 '"' */
906 _ACPI_PU, /* 0x23 35 '#' */
907 _ACPI_PU, /* 0x24 36 '$' */
908 _ACPI_PU, /* 0x25 37 '%' */
909 _ACPI_PU, /* 0x26 38 '&' */
910 _ACPI_PU, /* 0x27 39 ''' */
911 _ACPI_PU, /* 0x28 40 '(' */
912 _ACPI_PU, /* 0x29 41 ')' */
913 _ACPI_PU, /* 0x2A 42 '*' */
914 _ACPI_PU, /* 0x2B 43 '+' */
915 _ACPI_PU, /* 0x2C 44 ',' */
916 _ACPI_PU, /* 0x2D 45 '-' */
917 _ACPI_PU, /* 0x2E 46 '.' */
918 _ACPI_PU, /* 0x2F 47 '/' */
919 _ACPI_XD|_ACPI_DI, /* 0x30 48 '0' */
920 _ACPI_XD|_ACPI_DI, /* 0x31 49 '1' */
921 _ACPI_XD|_ACPI_DI, /* 0x32 50 '2' */
922 _ACPI_XD|_ACPI_DI, /* 0x33 51 '3' */
923 _ACPI_XD|_ACPI_DI, /* 0x34 52 '4' */
924 _ACPI_XD|_ACPI_DI, /* 0x35 53 '5' */
925 _ACPI_XD|_ACPI_DI, /* 0x36 54 '6' */
926 _ACPI_XD|_ACPI_DI, /* 0x37 55 '7' */
927 _ACPI_XD|_ACPI_DI, /* 0x38 56 '8' */
928 _ACPI_XD|_ACPI_DI, /* 0x39 57 '9' */
929 _ACPI_PU, /* 0x3A 58 ':' */
930 _ACPI_PU, /* 0x3B 59 ';' */
931 _ACPI_PU, /* 0x3C 60 '<' */
932 _ACPI_PU, /* 0x3D 61 '=' */
933 _ACPI_PU, /* 0x3E 62 '>' */
934 _ACPI_PU, /* 0x3F 63 '?' */
935 _ACPI_PU, /* 0x40 64 '@' */
936 _ACPI_XD|_ACPI_UP, /* 0x41 65 'A' */
937 _ACPI_XD|_ACPI_UP, /* 0x42 66 'B' */
938 _ACPI_XD|_ACPI_UP, /* 0x43 67 'C' */
939 _ACPI_XD|_ACPI_UP, /* 0x44 68 'D' */
940 _ACPI_XD|_ACPI_UP, /* 0x45 69 'E' */
941 _ACPI_XD|_ACPI_UP, /* 0x46 70 'F' */
942 _ACPI_UP, /* 0x47 71 'G' */
943 _ACPI_UP, /* 0x48 72 'H' */
944 _ACPI_UP, /* 0x49 73 'I' */
945 _ACPI_UP, /* 0x4A 74 'J' */
946 _ACPI_UP, /* 0x4B 75 'K' */
947 _ACPI_UP, /* 0x4C 76 'L' */
948 _ACPI_UP, /* 0x4D 77 'M' */
949 _ACPI_UP, /* 0x4E 78 'N' */
950 _ACPI_UP, /* 0x4F 79 'O' */
951 _ACPI_UP, /* 0x50 80 'P' */
952 _ACPI_UP, /* 0x51 81 'Q' */
953 _ACPI_UP, /* 0x52 82 'R' */
954 _ACPI_UP, /* 0x53 83 'S' */
955 _ACPI_UP, /* 0x54 84 'T' */
956 _ACPI_UP, /* 0x55 85 'U' */
957 _ACPI_UP, /* 0x56 86 'V' */
958 _ACPI_UP, /* 0x57 87 'W' */
959 _ACPI_UP, /* 0x58 88 'X' */
960 _ACPI_UP, /* 0x59 89 'Y' */
961 _ACPI_UP, /* 0x5A 90 'Z' */
962 _ACPI_PU, /* 0x5B 91 '[' */
963 _ACPI_PU, /* 0x5C 92 '\' */
964 _ACPI_PU, /* 0x5D 93 ']' */
965 _ACPI_PU, /* 0x5E 94 '^' */
966 _ACPI_PU, /* 0x5F 95 '_' */
967 _ACPI_PU, /* 0x60 96 '`' */
968 _ACPI_XD|_ACPI_LO, /* 0x61 97 'a' */
969 _ACPI_XD|_ACPI_LO, /* 0x62 98 'b' */
970 _ACPI_XD|_ACPI_LO, /* 0x63 99 'c' */
971 _ACPI_XD|_ACPI_LO, /* 0x64 100 'd' */
972 _ACPI_XD|_ACPI_LO, /* 0x65 101 'e' */
973 _ACPI_XD|_ACPI_LO, /* 0x66 102 'f' */
974 _ACPI_LO, /* 0x67 103 'g' */
975 _ACPI_LO, /* 0x68 104 'h' */
976 _ACPI_LO, /* 0x69 105 'i' */
977 _ACPI_LO, /* 0x6A 106 'j' */
978 _ACPI_LO, /* 0x6B 107 'k' */
979 _ACPI_LO, /* 0x6C 108 'l' */
980 _ACPI_LO, /* 0x6D 109 'm' */
981 _ACPI_LO, /* 0x6E 110 'n' */
982 _ACPI_LO, /* 0x6F 111 'o' */
983 _ACPI_LO, /* 0x70 112 'p' */
984 _ACPI_LO, /* 0x71 113 'q' */
985 _ACPI_LO, /* 0x72 114 'r' */
986 _ACPI_LO, /* 0x73 115 's' */
987 _ACPI_LO, /* 0x74 116 't' */
988 _ACPI_LO, /* 0x75 117 'u' */
989 _ACPI_LO, /* 0x76 118 'v' */
990 _ACPI_LO, /* 0x77 119 'w' */
991 _ACPI_LO, /* 0x78 120 'x' */
992 _ACPI_LO, /* 0x79 121 'y' */
993 _ACPI_LO, /* 0x7A 122 'z' */
994 _ACPI_PU, /* 0x7B 123 '{' */
995 _ACPI_PU, /* 0x7C 124 '|' */
996 _ACPI_PU, /* 0x7D 125 '}' */
997 _ACPI_PU, /* 0x7E 126 '~' */
998 _ACPI_CN, /* 0x7F 127 DEL */
999
1000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80 to 0x8F */
1001 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90 to 0x9F */
1002 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xA0 to 0xAF */
1003 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xB0 to 0xBF */
1004 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xC0 to 0xCF */
1005 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xD0 to 0xDF */
1006 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xE0 to 0xEF */
1007 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xF0 to 0xFF */
1008 0 /* 0x100 */
1009 };
1010
1011
1012 #endif /* ACPI_USE_SYSTEM_CLIBRARY */