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