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 - 2016, 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
183int
184memcmp (
185    void                    *VBuffer1,
186    void                    *VBuffer2,
187    ACPI_SIZE               Count)
188{
189    char                    *Buffer1 = (char *) VBuffer1;
190    char                    *Buffer2 = (char *) VBuffer2;
191
192
193    for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++)
194    {
195    }
196
197    return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *Buffer1 -
198        (unsigned char) *Buffer2));
199}
200
201
202/*******************************************************************************
203 *
204 * FUNCTION:    memcpy
205 *
206 * PARAMETERS:  Dest        - Target of the copy
207 *              Src         - Source buffer to copy
208 *              Count       - Number of bytes to copy
209 *
210 * RETURN:      Dest
211 *
212 * DESCRIPTION: Copy arbitrary bytes of memory
213 *
214 ******************************************************************************/
215
216void *
217memcpy (
218    void                    *Dest,
219    const void              *Src,
220    ACPI_SIZE               Count)
221{
222    char                    *New = (char *) Dest;
223    char                    *Old = (char *) Src;
224
225
226    while (Count)
227    {
228        *New = *Old;
229        New++;
230        Old++;
231        Count--;
232    }
233
234    return (Dest);
235}
236
237
238/*******************************************************************************
239 *
240 * FUNCTION:    memset
241 *
242 * PARAMETERS:  Dest        - Buffer to set
243 *              Value       - Value to set each byte of memory
244 *              Count       - Number of bytes to set
245 *
246 * RETURN:      Dest
247 *
248 * DESCRIPTION: Initialize a buffer to a known value.
249 *
250 ******************************************************************************/
251
252void *
253memset (
254    void                    *Dest,
255    int                     Value,
256    ACPI_SIZE               Count)
257{
258    char                    *New = (char *) Dest;
259
260
261    while (Count)
262    {
263        *New = (char) Value;
264        New++;
265        Count--;
266    }
267
268    return (Dest);
269}
270
271
272/*******************************************************************************
273 *
274 * FUNCTION:    strlen
275 *
276 * PARAMETERS:  String              - Null terminated string
277 *
278 * RETURN:      Length
279 *
280 * DESCRIPTION: Returns the length of the input string
281 *
282 ******************************************************************************/
283
284
285ACPI_SIZE
286strlen (
287    const char              *String)
288{
289    UINT32                  Length = 0;
290
291
292    /* Count the string until a null is encountered */
293
294    while (*String)
295    {
296        Length++;
297        String++;
298    }
299
300    return (Length);
301}
302
303
304/*******************************************************************************
305 *
306 * FUNCTION:    strcpy
307 *
308 * PARAMETERS:  DstString       - Target of the copy
309 *              SrcString       - The source string to copy
310 *
311 * RETURN:      DstString
312 *
313 * DESCRIPTION: Copy a null terminated string
314 *
315 ******************************************************************************/
316
317char *
318strcpy (
319    char                    *DstString,
320    const char              *SrcString)
321{
322    char                    *String = DstString;
323
324
325    /* Move bytes brute force */
326
327    while (*SrcString)
328    {
329        *String = *SrcString;
330
331        String++;
332        SrcString++;
333    }
334
335    /* Null terminate */
336
337    *String = 0;
338    return (DstString);
339}
340
341
342/*******************************************************************************
343 *
344 * FUNCTION:    strncpy
345 *
346 * PARAMETERS:  DstString       - Target of the copy
347 *              SrcString       - The source string to copy
348 *              Count           - Maximum # of bytes to copy
349 *
350 * RETURN:      DstString
351 *
352 * DESCRIPTION: Copy a null terminated string, with a maximum length
353 *
354 ******************************************************************************/
355
356char *
357strncpy (
358    char                    *DstString,
359    const char              *SrcString,
360    ACPI_SIZE               Count)
361{
362    char                    *String = DstString;
363
364
365    /* Copy the string */
366
367    for (String = DstString;
368        Count && (Count--, (*String++ = *SrcString++)); )
369    {;}
370
371    /* Pad with nulls if necessary */
372
373    while (Count--)
374    {
375        *String = 0;
376        String++;
377    }
378
379    /* Return original pointer */
380
381    return (DstString);
382}
383
384
385/*******************************************************************************
386 *
387 * FUNCTION:    strcmp
388 *
389 * PARAMETERS:  String1         - First string
390 *              String2         - Second string
391 *
392 * RETURN:      Index where strings mismatched, or 0 if strings matched
393 *
394 * DESCRIPTION: Compare two null terminated strings
395 *
396 ******************************************************************************/
397
398int
399strcmp (
400    const char              *String1,
401    const char              *String2)
402{
403
404
405    for ( ; (*String1 == *String2); String2++)
406    {
407        if (!*String1++)
408        {
409            return (0);
410        }
411    }
412
413    return ((unsigned char) *String1 - (unsigned char) *String2);
414}
415
416
417/*******************************************************************************
418 *
419 * FUNCTION:    strchr
420 *
421 * PARAMETERS:  String          - Search string
422 *              ch              - character to search for
423 *
424 * RETURN:      Ptr to char or NULL if not found
425 *
426 * DESCRIPTION: Search a string for a character
427 *
428 ******************************************************************************/
429
430char *
431strchr (
432    const char              *String,
433    int                     ch)
434{
435
436
437    for ( ; (*String); String++)
438    {
439        if ((*String) == (char) ch)
440        {
441            return ((char *) String);
442        }
443    }
444
445    return (NULL);
446}
447
448
449/*******************************************************************************
450 *
451 * FUNCTION:    strncmp
452 *
453 * PARAMETERS:  String1         - First string
454 *              String2         - Second string
455 *              Count           - Maximum # of bytes to compare
456 *
457 * RETURN:      Index where strings mismatched, or 0 if strings matched
458 *
459 * DESCRIPTION: Compare two null terminated strings, with a maximum length
460 *
461 ******************************************************************************/
462
463int
464strncmp (
465    const char              *String1,
466    const char              *String2,
467    ACPI_SIZE               Count)
468{
469
470
471    for ( ; Count-- && (*String1 == *String2); String2++)
472    {
473        if (!*String1++)
474        {
475            return (0);
476        }
477    }
478
479    return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *String1 -
480        (unsigned char) *String2));
481}
482
483
484/*******************************************************************************
485 *
486 * FUNCTION:    strcat
487 *
488 * PARAMETERS:  DstString       - Target of the copy
489 *              SrcString       - The source string to copy
490 *
491 * RETURN:      DstString
492 *
493 * DESCRIPTION: Append a null terminated string to a null terminated string
494 *
495 ******************************************************************************/
496
497char *
498strcat (
499    char                    *DstString,
500    const char              *SrcString)
501{
502    char                    *String;
503
504
505    /* Find end of the destination string */
506
507    for (String = DstString; *String++; )
508    { ; }
509
510    /* Concatenate the string */
511
512    for (--String; (*String++ = *SrcString++); )
513    { ; }
514
515    return (DstString);
516}
517
518
519/*******************************************************************************
520 *
521 * FUNCTION:    strncat
522 *
523 * PARAMETERS:  DstString       - Target of the copy
524 *              SrcString       - The source string to copy
525 *              Count           - Maximum # of bytes to copy
526 *
527 * RETURN:      DstString
528 *
529 * DESCRIPTION: Append a null terminated string to a null terminated string,
530 *              with a maximum count.
531 *
532 ******************************************************************************/
533
534char *
535strncat (
536    char                    *DstString,
537    const char              *SrcString,
538    ACPI_SIZE               Count)
539{
540    char                    *String;
541
542
543    if (Count)
544    {
545        /* Find end of the destination string */
546
547        for (String = DstString; *String++; )
548        { ; }
549
550        /* Concatenate the string */
551
552        for (--String; (*String++ = *SrcString++) && --Count; )
553        { ; }
554
555        /* Null terminate if necessary */
556
557        if (!Count)
558        {
559            *String = 0;
560        }
561    }
562
563    return (DstString);
564}
565
566
567/*******************************************************************************
568 *
569 * FUNCTION:    strstr
570 *
571 * PARAMETERS:  String1         - Target string
572 *              String2         - Substring to search for
573 *
574 * RETURN:      Where substring match starts, Null if no match found
575 *
576 * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
577 *              full implementation of strstr, only sufficient for command
578 *              matching
579 *
580 ******************************************************************************/
581
582char *
583strstr (
584    char                    *String1,
585    char                    *String2)
586{
587    UINT32                  Length;
588
589
590    Length = strlen (String2);
591    if (!Length)
592    {
593        return (String1);
594    }
595
596    while (strlen (String1) >= Length)
597    {
598        if (memcmp (String1, String2, Length) == 0)
599        {
600            return (String1);
601        }
602        String1++;
603    }
604
605    return (NULL);
606}
607
608
609/*******************************************************************************
610 *
611 * FUNCTION:    strtoul
612 *
613 * PARAMETERS:  String          - Null terminated string
614 *              Terminater      - Where a pointer to the terminating byte is
615 *                                returned
616 *              Base            - Radix of the string
617 *
618 * RETURN:      Converted value
619 *
620 * DESCRIPTION: Convert a string into a 32-bit unsigned value.
621 *              Note: use strtoul64 for 64-bit integers.
622 *
623 ******************************************************************************/
624
625UINT32
626strtoul (
627    const char              *String,
628    char                    **Terminator,
629    UINT32                  Base)
630{
631    UINT32                  converted = 0;
632    UINT32                  index;
633    UINT32                  sign;
634    const char              *StringStart;
635    UINT32                  ReturnValue = 0;
636    ACPI_STATUS             Status = AE_OK;
637
638
639    /*
640     * Save the value of the pointer to the buffer's first
641     * character, save the current errno value, and then
642     * skip over any white space in the buffer:
643     */
644    StringStart = String;
645    while (isspace (*String) || *String == '\t')
646    {
647        ++String;
648    }
649
650    /*
651     * The buffer may contain an optional plus or minus sign.
652     * If it does, then skip over it but remember what is was:
653     */
654    if (*String == '-')
655    {
656        sign = ACPI_SIGN_NEGATIVE;
657        ++String;
658    }
659    else if (*String == '+')
660    {
661        ++String;
662        sign = ACPI_SIGN_POSITIVE;
663    }
664    else
665    {
666        sign = ACPI_SIGN_POSITIVE;
667    }
668
669    /*
670     * If the input parameter Base is zero, then we need to
671     * determine if it is octal, decimal, or hexadecimal:
672     */
673    if (Base == 0)
674    {
675        if (*String == '0')
676        {
677            if (tolower (*(++String)) == 'x')
678            {
679                Base = 16;
680                ++String;
681            }
682            else
683            {
684                Base = 8;
685            }
686        }
687        else
688        {
689            Base = 10;
690        }
691    }
692    else if (Base < 2 || Base > 36)
693    {
694        /*
695         * The specified Base parameter is not in the domain of
696         * this function:
697         */
698        goto done;
699    }
700
701    /*
702     * For octal and hexadecimal bases, skip over the leading
703     * 0 or 0x, if they are present.
704     */
705    if (Base == 8 && *String == '0')
706    {
707        String++;
708    }
709
710    if (Base == 16 &&
711        *String == '0' &&
712        tolower (*(++String)) == 'x')
713    {
714        String++;
715    }
716
717    /*
718     * Main loop: convert the string to an unsigned long:
719     */
720    while (*String)
721    {
722        if (isdigit (*String))
723        {
724            index = (UINT32) ((UINT8) *String - '0');
725        }
726        else
727        {
728            index = (UINT32) toupper (*String);
729            if (isupper (index))
730            {
731                index = index - 'A' + 10;
732            }
733            else
734            {
735                goto done;
736            }
737        }
738
739        if (index >= Base)
740        {
741            goto done;
742        }
743
744        /*
745         * Check to see if value is out of range:
746         */
747
748        if (ReturnValue > ((ACPI_UINT32_MAX - (UINT32) index) /
749                            (UINT32) Base))
750        {
751            Status = AE_ERROR;
752            ReturnValue = 0;           /* reset */
753        }
754        else
755        {
756            ReturnValue *= Base;
757            ReturnValue += index;
758            converted = 1;
759        }
760
761        ++String;
762    }
763
764done:
765    /*
766     * If appropriate, update the caller's pointer to the next
767     * unconverted character in the buffer.
768     */
769    if (Terminator)
770    {
771        if (converted == 0 && ReturnValue == 0 && String != NULL)
772        {
773            *Terminator = (char *) StringStart;
774        }
775        else
776        {
777            *Terminator = (char *) String;
778        }
779    }
780
781    if (Status == AE_ERROR)
782    {
783        ReturnValue = ACPI_UINT32_MAX;
784    }
785
786    /*
787     * If a minus sign was present, then "the conversion is negated":
788     */
789    if (sign == ACPI_SIGN_NEGATIVE)
790    {
791        ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
792    }
793
794    return (ReturnValue);
795}
796
797
798/*******************************************************************************
799 *
800 * FUNCTION:    toupper
801 *
802 * PARAMETERS:  c           - Character to convert
803 *
804 * RETURN:      Converted character as an int
805 *
806 * DESCRIPTION: Convert character to uppercase
807 *
808 ******************************************************************************/
809
810int
811toupper (
812    int                     c)
813{
814
815    return (islower(c) ? ((c)-0x20) : (c));
816}
817
818
819/*******************************************************************************
820 *
821 * FUNCTION:    tolower
822 *
823 * PARAMETERS:  c           - Character to convert
824 *
825 * RETURN:      Converted character as an int
826 *
827 * DESCRIPTION: Convert character to lowercase
828 *
829 ******************************************************************************/
830
831int
832tolower (
833    int                     c)
834{
835
836    return (isupper(c) ? ((c)+0x20) : (c));
837}
838
839
840/*******************************************************************************
841 *
842 * FUNCTION:    is* function array
843 *
844 * DESCRIPTION: is* functions use the ctype table below
845 *
846 ******************************************************************************/
847
848const UINT8 AcpiGbl_Ctypes[257] = {
849    _ACPI_CN,            /* 0x00     0 NUL */
850    _ACPI_CN,            /* 0x01     1 SOH */
851    _ACPI_CN,            /* 0x02     2 STX */
852    _ACPI_CN,            /* 0x03     3 ETX */
853    _ACPI_CN,            /* 0x04     4 EOT */
854    _ACPI_CN,            /* 0x05     5 ENQ */
855    _ACPI_CN,            /* 0x06     6 ACK */
856    _ACPI_CN,            /* 0x07     7 BEL */
857    _ACPI_CN,            /* 0x08     8 BS  */
858    _ACPI_CN|_ACPI_SP,   /* 0x09     9 TAB */
859    _ACPI_CN|_ACPI_SP,   /* 0x0A    10 LF  */
860    _ACPI_CN|_ACPI_SP,   /* 0x0B    11 VT  */
861    _ACPI_CN|_ACPI_SP,   /* 0x0C    12 FF  */
862    _ACPI_CN|_ACPI_SP,   /* 0x0D    13 CR  */
863    _ACPI_CN,            /* 0x0E    14 SO  */
864    _ACPI_CN,            /* 0x0F    15 SI  */
865    _ACPI_CN,            /* 0x10    16 DLE */
866    _ACPI_CN,            /* 0x11    17 DC1 */
867    _ACPI_CN,            /* 0x12    18 DC2 */
868    _ACPI_CN,            /* 0x13    19 DC3 */
869    _ACPI_CN,            /* 0x14    20 DC4 */
870    _ACPI_CN,            /* 0x15    21 NAK */
871    _ACPI_CN,            /* 0x16    22 SYN */
872    _ACPI_CN,            /* 0x17    23 ETB */
873    _ACPI_CN,            /* 0x18    24 CAN */
874    _ACPI_CN,            /* 0x19    25 EM  */
875    _ACPI_CN,            /* 0x1A    26 SUB */
876    _ACPI_CN,            /* 0x1B    27 ESC */
877    _ACPI_CN,            /* 0x1C    28 FS  */
878    _ACPI_CN,            /* 0x1D    29 GS  */
879    _ACPI_CN,            /* 0x1E    30 RS  */
880    _ACPI_CN,            /* 0x1F    31 US  */
881    _ACPI_XS|_ACPI_SP,   /* 0x20    32 ' ' */
882    _ACPI_PU,            /* 0x21    33 '!' */
883    _ACPI_PU,            /* 0x22    34 '"' */
884    _ACPI_PU,            /* 0x23    35 '#' */
885    _ACPI_PU,            /* 0x24    36 '$' */
886    _ACPI_PU,            /* 0x25    37 '%' */
887    _ACPI_PU,            /* 0x26    38 '&' */
888    _ACPI_PU,            /* 0x27    39 ''' */
889    _ACPI_PU,            /* 0x28    40 '(' */
890    _ACPI_PU,            /* 0x29    41 ')' */
891    _ACPI_PU,            /* 0x2A    42 '*' */
892    _ACPI_PU,            /* 0x2B    43 '+' */
893    _ACPI_PU,            /* 0x2C    44 ',' */
894    _ACPI_PU,            /* 0x2D    45 '-' */
895    _ACPI_PU,            /* 0x2E    46 '.' */
896    _ACPI_PU,            /* 0x2F    47 '/' */
897    _ACPI_XD|_ACPI_DI,   /* 0x30    48 '0' */
898    _ACPI_XD|_ACPI_DI,   /* 0x31    49 '1' */
899    _ACPI_XD|_ACPI_DI,   /* 0x32    50 '2' */
900    _ACPI_XD|_ACPI_DI,   /* 0x33    51 '3' */
901    _ACPI_XD|_ACPI_DI,   /* 0x34    52 '4' */
902    _ACPI_XD|_ACPI_DI,   /* 0x35    53 '5' */
903    _ACPI_XD|_ACPI_DI,   /* 0x36    54 '6' */
904    _ACPI_XD|_ACPI_DI,   /* 0x37    55 '7' */
905    _ACPI_XD|_ACPI_DI,   /* 0x38    56 '8' */
906    _ACPI_XD|_ACPI_DI,   /* 0x39    57 '9' */
907    _ACPI_PU,            /* 0x3A    58 ':' */
908    _ACPI_PU,            /* 0x3B    59 ';' */
909    _ACPI_PU,            /* 0x3C    60 '<' */
910    _ACPI_PU,            /* 0x3D    61 '=' */
911    _ACPI_PU,            /* 0x3E    62 '>' */
912    _ACPI_PU,            /* 0x3F    63 '?' */
913    _ACPI_PU,            /* 0x40    64 '@' */
914    _ACPI_XD|_ACPI_UP,   /* 0x41    65 'A' */
915    _ACPI_XD|_ACPI_UP,   /* 0x42    66 'B' */
916    _ACPI_XD|_ACPI_UP,   /* 0x43    67 'C' */
917    _ACPI_XD|_ACPI_UP,   /* 0x44    68 'D' */
918    _ACPI_XD|_ACPI_UP,   /* 0x45    69 'E' */
919    _ACPI_XD|_ACPI_UP,   /* 0x46    70 'F' */
920    _ACPI_UP,            /* 0x47    71 'G' */
921    _ACPI_UP,            /* 0x48    72 'H' */
922    _ACPI_UP,            /* 0x49    73 'I' */
923    _ACPI_UP,            /* 0x4A    74 'J' */
924    _ACPI_UP,            /* 0x4B    75 'K' */
925    _ACPI_UP,            /* 0x4C    76 'L' */
926    _ACPI_UP,            /* 0x4D    77 'M' */
927    _ACPI_UP,            /* 0x4E    78 'N' */
928    _ACPI_UP,            /* 0x4F    79 'O' */
929    _ACPI_UP,            /* 0x50    80 'P' */
930    _ACPI_UP,            /* 0x51    81 'Q' */
931    _ACPI_UP,            /* 0x52    82 'R' */
932    _ACPI_UP,            /* 0x53    83 'S' */
933    _ACPI_UP,            /* 0x54    84 'T' */
934    _ACPI_UP,            /* 0x55    85 'U' */
935    _ACPI_UP,            /* 0x56    86 'V' */
936    _ACPI_UP,            /* 0x57    87 'W' */
937    _ACPI_UP,            /* 0x58    88 'X' */
938    _ACPI_UP,            /* 0x59    89 'Y' */
939    _ACPI_UP,            /* 0x5A    90 'Z' */
940    _ACPI_PU,            /* 0x5B    91 '[' */
941    _ACPI_PU,            /* 0x5C    92 '\' */
942    _ACPI_PU,            /* 0x5D    93 ']' */
943    _ACPI_PU,            /* 0x5E    94 '^' */
944    _ACPI_PU,            /* 0x5F    95 '_' */
945    _ACPI_PU,            /* 0x60    96 '`' */
946    _ACPI_XD|_ACPI_LO,   /* 0x61    97 'a' */
947    _ACPI_XD|_ACPI_LO,   /* 0x62    98 'b' */
948    _ACPI_XD|_ACPI_LO,   /* 0x63    99 'c' */
949    _ACPI_XD|_ACPI_LO,   /* 0x64   100 'd' */
950    _ACPI_XD|_ACPI_LO,   /* 0x65   101 'e' */
951    _ACPI_XD|_ACPI_LO,   /* 0x66   102 'f' */
952    _ACPI_LO,            /* 0x67   103 'g' */
953    _ACPI_LO,            /* 0x68   104 'h' */
954    _ACPI_LO,            /* 0x69   105 'i' */
955    _ACPI_LO,            /* 0x6A   106 'j' */
956    _ACPI_LO,            /* 0x6B   107 'k' */
957    _ACPI_LO,            /* 0x6C   108 'l' */
958    _ACPI_LO,            /* 0x6D   109 'm' */
959    _ACPI_LO,            /* 0x6E   110 'n' */
960    _ACPI_LO,            /* 0x6F   111 'o' */
961    _ACPI_LO,            /* 0x70   112 'p' */
962    _ACPI_LO,            /* 0x71   113 'q' */
963    _ACPI_LO,            /* 0x72   114 'r' */
964    _ACPI_LO,            /* 0x73   115 's' */
965    _ACPI_LO,            /* 0x74   116 't' */
966    _ACPI_LO,            /* 0x75   117 'u' */
967    _ACPI_LO,            /* 0x76   118 'v' */
968    _ACPI_LO,            /* 0x77   119 'w' */
969    _ACPI_LO,            /* 0x78   120 'x' */
970    _ACPI_LO,            /* 0x79   121 'y' */
971    _ACPI_LO,            /* 0x7A   122 'z' */
972    _ACPI_PU,            /* 0x7B   123 '{' */
973    _ACPI_PU,            /* 0x7C   124 '|' */
974    _ACPI_PU,            /* 0x7D   125 '}' */
975    _ACPI_PU,            /* 0x7E   126 '~' */
976    _ACPI_CN,            /* 0x7F   127 DEL */
977
978    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x80 to 0x8F    */
979    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x90 to 0x9F    */
980    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xA0 to 0xAF    */
981    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xB0 to 0xBF    */
982    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xC0 to 0xCF    */
983    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xD0 to 0xDF    */
984    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xE0 to 0xEF    */
985    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xF0 to 0xFF    */
986    0                                 /* 0x100 */
987};
988
989
990#endif /* ACPI_USE_SYSTEM_CLIBRARY */
991