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