Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/drivers/acpica/utclib.c need to be fixed.

0001 /******************************************************************************
0002  *
0003  * Module Name: cmclib - Local implementation of C library functions
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights.  You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code.  No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision.  In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change.  Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee.  Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution.  In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government.  In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************/
0115 
0116 
0117 #define __CMCLIB_C__
0118 
0119 #include "acpi.h"
0120 #include "accommon.h"
0121 
0122 /*
0123  * These implementations of standard C Library routines can optionally be
0124  * used if a C library is not available.  In general, they are less efficient
0125  * than an inline or assembly implementation
0126  */
0127 
0128 #define _COMPONENT          ACPI_UTILITIES
0129         ACPI_MODULE_NAME    ("cmclib")
0130 
0131 
0132 #ifndef ACPI_USE_SYSTEM_CLIBRARY
0133 
0134 #define NEGATIVE    1
0135 #define POSITIVE    0
0136 
0137 
0138 /*******************************************************************************
0139  *
0140  * FUNCTION:    AcpiUtMemcmp (memcmp)
0141  *
0142  * PARAMETERS:  Buffer1         - First Buffer
0143  *              Buffer2         - Second Buffer
0144  *              Count           - Maximum # of bytes to compare
0145  *
0146  * RETURN:      Index where Buffers mismatched, or 0 if Buffers matched
0147  *
0148  * DESCRIPTION: Compare two Buffers, with a maximum length
0149  *
0150  ******************************************************************************/
0151 
0152 int
0153 AcpiUtMemcmp (
0154     const char              *Buffer1,
0155     const char              *Buffer2,
0156     ACPI_SIZE               Count)
0157 {
0158 
0159     for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++)
0160     {
0161     }
0162 
0163     return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *Buffer1 -
0164         (unsigned char) *Buffer2));
0165 }
0166 
0167 
0168 /*******************************************************************************
0169  *
0170  * FUNCTION:    AcpiUtMemcpy (memcpy)
0171  *
0172  * PARAMETERS:  Dest        - Target of the copy
0173  *              Src         - Source buffer to copy
0174  *              Count       - Number of bytes to copy
0175  *
0176  * RETURN:      Dest
0177  *
0178  * DESCRIPTION: Copy arbitrary bytes of memory
0179  *
0180  ******************************************************************************/
0181 
0182 void *
0183 AcpiUtMemcpy (
0184     void                    *Dest,
0185     const void              *Src,
0186     ACPI_SIZE               Count)
0187 {
0188     char                    *New = (char *) Dest;
0189     char                    *Old = (char *) Src;
0190 
0191 
0192     while (Count)
0193     {
0194         *New = *Old;
0195         New++;
0196         Old++;
0197         Count--;
0198     }
0199 
0200     return (Dest);
0201 }
0202 
0203 
0204 /*******************************************************************************
0205  *
0206  * FUNCTION:    AcpiUtMemset (memset)
0207  *
0208  * PARAMETERS:  Dest        - Buffer to set
0209  *              Value       - Value to set each byte of memory
0210  *              Count       - Number of bytes to set
0211  *
0212  * RETURN:      Dest
0213  *
0214  * DESCRIPTION: Initialize a buffer to a known value.
0215  *
0216  ******************************************************************************/
0217 
0218 void *
0219 AcpiUtMemset (
0220     void                    *Dest,
0221     UINT8                   Value,
0222     ACPI_SIZE               Count)
0223 {
0224     char                    *New = (char *) Dest;
0225 
0226 
0227     while (Count)
0228     {
0229         *New = (char) Value;
0230         New++;
0231         Count--;
0232     }
0233 
0234     return (Dest);
0235 }
0236 
0237 
0238 /*******************************************************************************
0239  *
0240  * FUNCTION:    AcpiUtStrlen (strlen)
0241  *
0242  * PARAMETERS:  String              - Null terminated string
0243  *
0244  * RETURN:      Length
0245  *
0246  * DESCRIPTION: Returns the length of the input string
0247  *
0248  ******************************************************************************/
0249 
0250 
0251 ACPI_SIZE
0252 AcpiUtStrlen (
0253     const char              *String)
0254 {
0255     UINT32                  Length = 0;
0256 
0257 
0258     /* Count the string until a null is encountered */
0259 
0260     while (*String)
0261     {
0262         Length++;
0263         String++;
0264     }
0265 
0266     return (Length);
0267 }
0268 
0269 
0270 /*******************************************************************************
0271  *
0272  * FUNCTION:    AcpiUtStrcpy (strcpy)
0273  *
0274  * PARAMETERS:  DstString       - Target of the copy
0275  *              SrcString       - The source string to copy
0276  *
0277  * RETURN:      DstString
0278  *
0279  * DESCRIPTION: Copy a null terminated string
0280  *
0281  ******************************************************************************/
0282 
0283 char *
0284 AcpiUtStrcpy (
0285     char                    *DstString,
0286     const char              *SrcString)
0287 {
0288     char                    *String = DstString;
0289 
0290 
0291     /* Move bytes brute force */
0292 
0293     while (*SrcString)
0294     {
0295         *String = *SrcString;
0296 
0297         String++;
0298         SrcString++;
0299     }
0300 
0301     /* Null terminate */
0302 
0303     *String = 0;
0304     return (DstString);
0305 }
0306 
0307 
0308 /*******************************************************************************
0309  *
0310  * FUNCTION:    AcpiUtStrncpy (strncpy)
0311  *
0312  * PARAMETERS:  DstString       - Target of the copy
0313  *              SrcString       - The source string to copy
0314  *              Count           - Maximum # of bytes to copy
0315  *
0316  * RETURN:      DstString
0317  *
0318  * DESCRIPTION: Copy a null terminated string, with a maximum length
0319  *
0320  ******************************************************************************/
0321 
0322 char *
0323 AcpiUtStrncpy (
0324     char                    *DstString,
0325     const char              *SrcString,
0326     ACPI_SIZE               Count)
0327 {
0328     char                    *String = DstString;
0329 
0330 
0331     /* Copy the string */
0332 
0333     for (String = DstString;
0334         Count && (Count--, (*String++ = *SrcString++)); )
0335     {;}
0336 
0337     /* Pad with nulls if necessary */
0338 
0339     while (Count--)
0340     {
0341         *String = 0;
0342         String++;
0343     }
0344 
0345     /* Return original pointer */
0346 
0347     return (DstString);
0348 }
0349 
0350 
0351 /*******************************************************************************
0352  *
0353  * FUNCTION:    AcpiUtStrcmp (strcmp)
0354  *
0355  * PARAMETERS:  String1         - First string
0356  *              String2         - Second string
0357  *
0358  * RETURN:      Index where strings mismatched, or 0 if strings matched
0359  *
0360  * DESCRIPTION: Compare two null terminated strings
0361  *
0362  ******************************************************************************/
0363 
0364 int
0365 AcpiUtStrcmp (
0366     const char              *String1,
0367     const char              *String2)
0368 {
0369 
0370 
0371     for ( ; (*String1 == *String2); String2++)
0372     {
0373         if (!*String1++)
0374         {
0375             return (0);
0376         }
0377     }
0378 
0379     return ((unsigned char) *String1 - (unsigned char) *String2);
0380 }
0381 
0382 
0383 #ifdef ACPI_FUTURE_IMPLEMENTATION
0384 /* Not used at this time */
0385 /*******************************************************************************
0386  *
0387  * FUNCTION:    AcpiUtStrchr (strchr)
0388  *
0389  * PARAMETERS:  String          - Search string
0390  *              ch              - character to search for
0391  *
0392  * RETURN:      Ptr to char or NULL if not found
0393  *
0394  * DESCRIPTION: Search a string for a character
0395  *
0396  ******************************************************************************/
0397 
0398 char *
0399 AcpiUtStrchr (
0400     const char              *String,
0401     int                     ch)
0402 {
0403 
0404 
0405     for ( ; (*String); String++)
0406     {
0407         if ((*String) == (char) ch)
0408         {
0409             return ((char *) String);
0410         }
0411     }
0412 
0413     return (NULL);
0414 }
0415 #endif
0416 
0417 /*******************************************************************************
0418  *
0419  * FUNCTION:    AcpiUtStrncmp (strncmp)
0420  *
0421  * PARAMETERS:  String1         - First string
0422  *              String2         - Second string
0423  *              Count           - Maximum # of bytes to compare
0424  *
0425  * RETURN:      Index where strings mismatched, or 0 if strings matched
0426  *
0427  * DESCRIPTION: Compare two null terminated strings, with a maximum length
0428  *
0429  ******************************************************************************/
0430 
0431 int
0432 AcpiUtStrncmp (
0433     const char              *String1,
0434     const char              *String2,
0435     ACPI_SIZE               Count)
0436 {
0437 
0438 
0439     for ( ; Count-- && (*String1 == *String2); String2++)
0440     {
0441         if (!*String1++)
0442         {
0443             return (0);
0444         }
0445     }
0446 
0447     return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *String1 -
0448         (unsigned char) *String2));
0449 }
0450 
0451 
0452 /*******************************************************************************
0453  *
0454  * FUNCTION:    AcpiUtStrcat (Strcat)
0455  *
0456  * PARAMETERS:  DstString       - Target of the copy
0457  *              SrcString       - The source string to copy
0458  *
0459  * RETURN:      DstString
0460  *
0461  * DESCRIPTION: Append a null terminated string to a null terminated string
0462  *
0463  ******************************************************************************/
0464 
0465 char *
0466 AcpiUtStrcat (
0467     char                    *DstString,
0468     const char              *SrcString)
0469 {
0470     char                    *String;
0471 
0472 
0473     /* Find end of the destination string */
0474 
0475     for (String = DstString; *String++; )
0476     { ; }
0477 
0478     /* Concatenate the string */
0479 
0480     for (--String; (*String++ = *SrcString++); )
0481     { ; }
0482 
0483     return (DstString);
0484 }
0485 
0486 
0487 /*******************************************************************************
0488  *
0489  * FUNCTION:    AcpiUtStrncat (strncat)
0490  *
0491  * PARAMETERS:  DstString       - Target of the copy
0492  *              SrcString       - The source string to copy
0493  *              Count           - Maximum # of bytes to copy
0494  *
0495  * RETURN:      DstString
0496  *
0497  * DESCRIPTION: Append a null terminated string to a null terminated string,
0498  *              with a maximum count.
0499  *
0500  ******************************************************************************/
0501 
0502 char *
0503 AcpiUtStrncat (
0504     char                    *DstString,
0505     const char              *SrcString,
0506     ACPI_SIZE               Count)
0507 {
0508     char                    *String;
0509 
0510 
0511     if (Count)
0512     {
0513         /* Find end of the destination string */
0514 
0515         for (String = DstString; *String++; )
0516         { ; }
0517 
0518         /* Concatenate the string */
0519 
0520         for (--String; (*String++ = *SrcString++) && --Count; )
0521         { ; }
0522 
0523         /* Null terminate if necessary */
0524 
0525         if (!Count)
0526         {
0527             *String = 0;
0528         }
0529     }
0530 
0531     return (DstString);
0532 }
0533 
0534 
0535 /*******************************************************************************
0536  *
0537  * FUNCTION:    AcpiUtStrstr (strstr)
0538  *
0539  * PARAMETERS:  String1         - Target string
0540  *              String2         - Substring to search for
0541  *
0542  * RETURN:      Where substring match starts, Null if no match found
0543  *
0544  * DESCRIPTION: Checks if String2 occurs in String1. This is not really a
0545  *              full implementation of strstr, only sufficient for command
0546  *              matching
0547  *
0548  ******************************************************************************/
0549 
0550 char *
0551 AcpiUtStrstr (
0552     char                    *String1,
0553     char                    *String2)
0554 {
0555     char                    *String;
0556 
0557 
0558     if (AcpiUtStrlen (String2) > AcpiUtStrlen (String1))
0559     {
0560         return (NULL);
0561     }
0562 
0563     /* Walk entire string, comparing the letters */
0564 
0565     for (String = String1; *String2; )
0566     {
0567         if (*String2 != *String)
0568         {
0569             return (NULL);
0570         }
0571 
0572         String2++;
0573         String++;
0574     }
0575 
0576     return (String1);
0577 }
0578 
0579 
0580 /*******************************************************************************
0581  *
0582  * FUNCTION:    AcpiUtStrtoul (strtoul)
0583  *
0584  * PARAMETERS:  String          - Null terminated string
0585  *              Terminater      - Where a pointer to the terminating byte is
0586  *                                returned
0587  *              Base            - Radix of the string
0588  *
0589  * RETURN:      Converted value
0590  *
0591  * DESCRIPTION: Convert a string into a 32-bit unsigned value.
0592  *              Note: use AcpiUtStrtoul64 for 64-bit integers.
0593  *
0594  ******************************************************************************/
0595 
0596 UINT32
0597 AcpiUtStrtoul (
0598     const char              *String,
0599     char                    **Terminator,
0600     UINT32                  Base)
0601 {
0602     UINT32                  converted = 0;
0603     UINT32                  index;
0604     UINT32                  sign;
0605     const char              *StringStart;
0606     UINT32                  ReturnValue = 0;
0607     ACPI_STATUS             Status = AE_OK;
0608 
0609 
0610     /*
0611      * Save the value of the pointer to the buffer's first
0612      * character, save the current errno value, and then
0613      * skip over any white space in the buffer:
0614      */
0615     StringStart = String;
0616     while (ACPI_IS_SPACE (*String) || *String == '\t')
0617     {
0618         ++String;
0619     }
0620 
0621     /*
0622      * The buffer may contain an optional plus or minus sign.
0623      * If it does, then skip over it but remember what is was:
0624      */
0625     if (*String == '-')
0626     {
0627         sign = NEGATIVE;
0628         ++String;
0629     }
0630     else if (*String == '+')
0631     {
0632         ++String;
0633         sign = POSITIVE;
0634     }
0635     else
0636     {
0637         sign = POSITIVE;
0638     }
0639 
0640     /*
0641      * If the input parameter Base is zero, then we need to
0642      * determine if it is octal, decimal, or hexadecimal:
0643      */
0644     if (Base == 0)
0645     {
0646         if (*String == '0')
0647         {
0648             if (AcpiUtToLower (*(++String)) == 'x')
0649             {
0650                 Base = 16;
0651                 ++String;
0652             }
0653             else
0654             {
0655                 Base = 8;
0656             }
0657         }
0658         else
0659         {
0660             Base = 10;
0661         }
0662     }
0663     else if (Base < 2 || Base > 36)
0664     {
0665         /*
0666          * The specified Base parameter is not in the domain of
0667          * this function:
0668          */
0669         goto done;
0670     }
0671 
0672     /*
0673      * For octal and hexadecimal bases, skip over the leading
0674      * 0 or 0x, if they are present.
0675      */
0676     if (Base == 8 && *String == '0')
0677     {
0678         String++;
0679     }
0680 
0681     if (Base == 16 &&
0682         *String == '0' &&
0683         AcpiUtToLower (*(++String)) == 'x')
0684     {
0685         String++;
0686     }
0687 
0688     /*
0689      * Main loop: convert the string to an unsigned long:
0690      */
0691     while (*String)
0692     {
0693         if (ACPI_IS_DIGIT (*String))
0694         {
0695             index = (UINT32) ((UINT8) *String - '0');
0696         }
0697         else
0698         {
0699             index = (UINT32) AcpiUtToUpper (*String);
0700             if (ACPI_IS_UPPER (index))
0701             {
0702                 index = index - 'A' + 10;
0703             }
0704             else
0705             {
0706                 goto done;
0707             }
0708         }
0709 
0710         if (index >= Base)
0711         {
0712             goto done;
0713         }
0714 
0715         /*
0716          * Check to see if value is out of range:
0717          */
0718 
0719         if (ReturnValue > ((ACPI_UINT32_MAX - (UINT32) index) /
0720                             (UINT32) Base))
0721         {
0722             Status = AE_ERROR;
0723             ReturnValue = 0;           /* reset */
0724         }
0725         else
0726         {
0727             ReturnValue *= Base;
0728             ReturnValue += index;
0729             converted = 1;
0730         }
0731 
0732         ++String;
0733     }
0734 
0735 done:
0736     /*
0737      * If appropriate, update the caller's pointer to the next
0738      * unconverted character in the buffer.
0739      */
0740     if (Terminator)
0741     {
0742         if (converted == 0 && ReturnValue == 0 && String != NULL)
0743         {
0744             *Terminator = (char *) StringStart;
0745         }
0746         else
0747         {
0748             *Terminator = (char *) String;
0749         }
0750     }
0751 
0752     if (Status == AE_ERROR)
0753     {
0754         ReturnValue = ACPI_UINT32_MAX;
0755     }
0756 
0757     /*
0758      * If a minus sign was present, then "the conversion is negated":
0759      */
0760     if (sign == NEGATIVE)
0761     {
0762         ReturnValue = (ACPI_UINT32_MAX - ReturnValue) + 1;
0763     }
0764 
0765     return (ReturnValue);
0766 }
0767 
0768 
0769 /*******************************************************************************
0770  *
0771  * FUNCTION:    AcpiUtToUpper (TOUPPER)
0772  *
0773  * PARAMETERS:  c           - Character to convert
0774  *
0775  * RETURN:      Converted character as an int
0776  *
0777  * DESCRIPTION: Convert character to uppercase
0778  *
0779  ******************************************************************************/
0780 
0781 int
0782 AcpiUtToUpper (
0783     int                     c)
0784 {
0785 
0786     return (ACPI_IS_LOWER(c) ? ((c)-0x20) : (c));
0787 }
0788 
0789 
0790 /*******************************************************************************
0791  *
0792  * FUNCTION:    AcpiUtToLower (TOLOWER)
0793  *
0794  * PARAMETERS:  c           - Character to convert
0795  *
0796  * RETURN:      Converted character as an int
0797  *
0798  * DESCRIPTION: Convert character to lowercase
0799  *
0800  ******************************************************************************/
0801 
0802 int
0803 AcpiUtToLower (
0804     int                     c)
0805 {
0806 
0807     return (ACPI_IS_UPPER(c) ? ((c)+0x20) : (c));
0808 }
0809 
0810 
0811 /*******************************************************************************
0812  *
0813  * FUNCTION:    is* functions
0814  *
0815  * DESCRIPTION: is* functions use the ctype table below
0816  *
0817  ******************************************************************************/
0818 
0819 const UINT8 _acpi_ctype[257] = {
0820     _ACPI_CN,            /* 0x0      0.     */
0821     _ACPI_CN,            /* 0x1      1.     */
0822     _ACPI_CN,            /* 0x2      2.     */
0823     _ACPI_CN,            /* 0x3      3.     */
0824     _ACPI_CN,            /* 0x4      4.     */
0825     _ACPI_CN,            /* 0x5      5.     */
0826     _ACPI_CN,            /* 0x6      6.     */
0827     _ACPI_CN,            /* 0x7      7.     */
0828     _ACPI_CN,            /* 0x8      8.     */
0829     _ACPI_CN|_ACPI_SP,   /* 0x9      9.     */
0830     _ACPI_CN|_ACPI_SP,   /* 0xA     10.     */
0831     _ACPI_CN|_ACPI_SP,   /* 0xB     11.     */
0832     _ACPI_CN|_ACPI_SP,   /* 0xC     12.     */
0833     _ACPI_CN|_ACPI_SP,   /* 0xD     13.     */
0834     _ACPI_CN,            /* 0xE     14.     */
0835     _ACPI_CN,            /* 0xF     15.     */
0836     _ACPI_CN,            /* 0x10    16.     */
0837     _ACPI_CN,            /* 0x11    17.     */
0838     _ACPI_CN,            /* 0x12    18.     */
0839     _ACPI_CN,            /* 0x13    19.     */
0840     _ACPI_CN,            /* 0x14    20.     */
0841     _ACPI_CN,            /* 0x15    21.     */
0842     _ACPI_CN,            /* 0x16    22.     */
0843     _ACPI_CN,            /* 0x17    23.     */
0844     _ACPI_CN,            /* 0x18    24.     */
0845     _ACPI_CN,            /* 0x19    25.     */
0846     _ACPI_CN,            /* 0x1A    26.     */
0847     _ACPI_CN,            /* 0x1B    27.     */
0848     _ACPI_CN,            /* 0x1C    28.     */
0849     _ACPI_CN,            /* 0x1D    29.     */
0850     _ACPI_CN,            /* 0x1E    30.     */
0851     _ACPI_CN,            /* 0x1F    31.     */
0852     _ACPI_XS|_ACPI_SP,   /* 0x20    32. ' ' */
0853     _ACPI_PU,            /* 0x21    33. '!' */
0854     _ACPI_PU,            /* 0x22    34. '"' */
0855     _ACPI_PU,            /* 0x23    35. '#' */
0856     _ACPI_PU,            /* 0x24    36. '$' */
0857     _ACPI_PU,            /* 0x25    37. '%' */
0858     _ACPI_PU,            /* 0x26    38. '&' */
0859     _ACPI_PU,            /* 0x27    39. ''' */
0860     _ACPI_PU,            /* 0x28    40. '(' */
0861     _ACPI_PU,            /* 0x29    41. ')' */
0862     _ACPI_PU,            /* 0x2A    42. '*' */
0863     _ACPI_PU,            /* 0x2B    43. '+' */
0864     _ACPI_PU,            /* 0x2C    44. ',' */
0865     _ACPI_PU,            /* 0x2D    45. '-' */
0866     _ACPI_PU,            /* 0x2E    46. '.' */
0867     _ACPI_PU,            /* 0x2F    47. '/' */
0868     _ACPI_XD|_ACPI_DI,   /* 0x30    48. '0' */
0869     _ACPI_XD|_ACPI_DI,   /* 0x31    49. '1' */
0870     _ACPI_XD|_ACPI_DI,   /* 0x32    50. '2' */
0871     _ACPI_XD|_ACPI_DI,   /* 0x33    51. '3' */
0872     _ACPI_XD|_ACPI_DI,   /* 0x34    52. '4' */
0873     _ACPI_XD|_ACPI_DI,   /* 0x35    53. '5' */
0874     _ACPI_XD|_ACPI_DI,   /* 0x36    54. '6' */
0875     _ACPI_XD|_ACPI_DI,   /* 0x37    55. '7' */
0876     _ACPI_XD|_ACPI_DI,   /* 0x38    56. '8' */
0877     _ACPI_XD|_ACPI_DI,   /* 0x39    57. '9' */
0878     _ACPI_PU,            /* 0x3A    58. ':' */
0879     _ACPI_PU,            /* 0x3B    59. ';' */
0880     _ACPI_PU,            /* 0x3C    60. '<' */
0881     _ACPI_PU,            /* 0x3D    61. '=' */
0882     _ACPI_PU,            /* 0x3E    62. '>' */
0883     _ACPI_PU,            /* 0x3F    63. '?' */
0884     _ACPI_PU,            /* 0x40    64. '@' */
0885     _ACPI_XD|_ACPI_UP,   /* 0x41    65. 'A' */
0886     _ACPI_XD|_ACPI_UP,   /* 0x42    66. 'B' */
0887     _ACPI_XD|_ACPI_UP,   /* 0x43    67. 'C' */
0888     _ACPI_XD|_ACPI_UP,   /* 0x44    68. 'D' */
0889     _ACPI_XD|_ACPI_UP,   /* 0x45    69. 'E' */
0890     _ACPI_XD|_ACPI_UP,   /* 0x46    70. 'F' */
0891     _ACPI_UP,            /* 0x47    71. 'G' */
0892     _ACPI_UP,            /* 0x48    72. 'H' */
0893     _ACPI_UP,            /* 0x49    73. 'I' */
0894     _ACPI_UP,            /* 0x4A    74. 'J' */
0895     _ACPI_UP,            /* 0x4B    75. 'K' */
0896     _ACPI_UP,            /* 0x4C    76. 'L' */
0897     _ACPI_UP,            /* 0x4D    77. 'M' */
0898     _ACPI_UP,            /* 0x4E    78. 'N' */
0899     _ACPI_UP,            /* 0x4F    79. 'O' */
0900     _ACPI_UP,            /* 0x50    80. 'P' */
0901     _ACPI_UP,            /* 0x51    81. 'Q' */
0902     _ACPI_UP,            /* 0x52    82. 'R' */
0903     _ACPI_UP,            /* 0x53    83. 'S' */
0904     _ACPI_UP,            /* 0x54    84. 'T' */
0905     _ACPI_UP,            /* 0x55    85. 'U' */
0906     _ACPI_UP,            /* 0x56    86. 'V' */
0907     _ACPI_UP,            /* 0x57    87. 'W' */
0908     _ACPI_UP,            /* 0x58    88. 'X' */
0909     _ACPI_UP,            /* 0x59    89. 'Y' */
0910     _ACPI_UP,            /* 0x5A    90. 'Z' */
0911     _ACPI_PU,            /* 0x5B    91. '[' */
0912     _ACPI_PU,            /* 0x5C    92. '\' */
0913     _ACPI_PU,            /* 0x5D    93. ']' */
0914     _ACPI_PU,            /* 0x5E    94. '^' */
0915     _ACPI_PU,            /* 0x5F    95. '_' */
0916     _ACPI_PU,            /* 0x60    96. '`' */
0917     _ACPI_XD|_ACPI_LO,   /* 0x61    97. 'a' */
0918     _ACPI_XD|_ACPI_LO,   /* 0x62    98. 'b' */
0919     _ACPI_XD|_ACPI_LO,   /* 0x63    99. 'c' */
0920     _ACPI_XD|_ACPI_LO,   /* 0x64   100. 'd' */
0921     _ACPI_XD|_ACPI_LO,   /* 0x65   101. 'e' */
0922     _ACPI_XD|_ACPI_LO,   /* 0x66   102. 'f' */
0923     _ACPI_LO,            /* 0x67   103. 'g' */
0924     _ACPI_LO,            /* 0x68   104. 'h' */
0925     _ACPI_LO,            /* 0x69   105. 'i' */
0926     _ACPI_LO,            /* 0x6A   106. 'j' */
0927     _ACPI_LO,            /* 0x6B   107. 'k' */
0928     _ACPI_LO,            /* 0x6C   108. 'l' */
0929     _ACPI_LO,            /* 0x6D   109. 'm' */
0930     _ACPI_LO,            /* 0x6E   110. 'n' */
0931     _ACPI_LO,            /* 0x6F   111. 'o' */
0932     _ACPI_LO,            /* 0x70   112. 'p' */
0933     _ACPI_LO,            /* 0x71   113. 'q' */
0934     _ACPI_LO,            /* 0x72   114. 'r' */
0935     _ACPI_LO,            /* 0x73   115. 's' */
0936     _ACPI_LO,            /* 0x74   116. 't' */
0937     _ACPI_LO,            /* 0x75   117. 'u' */
0938     _ACPI_LO,            /* 0x76   118. 'v' */
0939     _ACPI_LO,            /* 0x77   119. 'w' */
0940     _ACPI_LO,            /* 0x78   120. 'x' */
0941     _ACPI_LO,            /* 0x79   121. 'y' */
0942     _ACPI_LO,            /* 0x7A   122. 'z' */
0943     _ACPI_PU,            /* 0x7B   123. '{' */
0944     _ACPI_PU,            /* 0x7C   124. '|' */
0945     _ACPI_PU,            /* 0x7D   125. '}' */
0946     _ACPI_PU,            /* 0x7E   126. '~' */
0947     _ACPI_CN,            /* 0x7F   127.     */
0948 
0949     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x80 to 0x8F    */
0950     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0x90 to 0x9F    */
0951     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xA0 to 0xAF    */
0952     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xB0 to 0xBF    */
0953     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xC0 to 0xCF    */
0954     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xD0 to 0xDF    */
0955     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  /* 0xE0 to 0xEF    */
0956     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xF0 to 0x100   */
0957 };
0958 
0959 
0960 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
0961