Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:42

0001 /******************************************************************************
0002  *
0003  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, 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  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #ifndef _ACUTILS_H
0153 #define _ACUTILS_H
0154 
0155 
0156 extern const UINT8                      AcpiGbl_ResourceAmlSizes[];
0157 extern const UINT8                      AcpiGbl_ResourceAmlSerialBusSizes[];
0158 
0159 /* Strings used by the disassembler and debugger resource dump routines */
0160 
0161 #if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
0162 
0163 extern const char                       *AcpiGbl_BmDecode[];
0164 extern const char                       *AcpiGbl_ConfigDecode[];
0165 extern const char                       *AcpiGbl_ConsumeDecode[];
0166 extern const char                       *AcpiGbl_DecDecode[];
0167 extern const char                       *AcpiGbl_HeDecode[];
0168 extern const char                       *AcpiGbl_IoDecode[];
0169 extern const char                       *AcpiGbl_LlDecode[];
0170 extern const char                       *AcpiGbl_MaxDecode[];
0171 extern const char                       *AcpiGbl_MemDecode[];
0172 extern const char                       *AcpiGbl_MinDecode[];
0173 extern const char                       *AcpiGbl_MtpDecode[];
0174 extern const char                       *AcpiGbl_PhyDecode[];
0175 extern const char                       *AcpiGbl_RngDecode[];
0176 extern const char                       *AcpiGbl_RwDecode[];
0177 extern const char                       *AcpiGbl_ShrDecode[];
0178 extern const char                       *AcpiGbl_SizDecode[];
0179 extern const char                       *AcpiGbl_TrsDecode[];
0180 extern const char                       *AcpiGbl_TtpDecode[];
0181 extern const char                       *AcpiGbl_TypDecode[];
0182 extern const char                       *AcpiGbl_PpcDecode[];
0183 extern const char                       *AcpiGbl_IorDecode[];
0184 extern const char                       *AcpiGbl_DtsDecode[];
0185 extern const char                       *AcpiGbl_CtDecode[];
0186 extern const char                       *AcpiGbl_SbtDecode[];
0187 extern const char                       *AcpiGbl_AmDecode[];
0188 extern const char                       *AcpiGbl_SmDecode[];
0189 extern const char                       *AcpiGbl_WmDecode[];
0190 extern const char                       *AcpiGbl_CphDecode[];
0191 extern const char                       *AcpiGbl_CpoDecode[];
0192 extern const char                       *AcpiGbl_DpDecode[];
0193 extern const char                       *AcpiGbl_EdDecode[];
0194 extern const char                       *AcpiGbl_BpbDecode[];
0195 extern const char                       *AcpiGbl_SbDecode[];
0196 extern const char                       *AcpiGbl_FcDecode[];
0197 extern const char                       *AcpiGbl_PtDecode[];
0198 extern const char                       *AcpiGbl_PtypDecode[];
0199 extern const char                       *AcpiGbl_ClockInputMode[];
0200 extern const char                       *AcpiGbl_ClockInputScale[];
0201 #endif
0202 
0203 /*
0204  * For the iASL compiler case, the output is redirected to stderr so that
0205  * any of the various ACPI errors and warnings do not appear in the output
0206  * files, for either the compiler or disassembler portions of the tool.
0207  */
0208 #ifdef ACPI_ASL_COMPILER
0209 
0210 #include <stdio.h>
0211 
0212 #define ACPI_MSG_REDIRECT_BEGIN \
0213     FILE                    *OutputFile = AcpiGbl_OutputFile; \
0214     AcpiOsRedirectOutput (stderr);
0215 
0216 #define ACPI_MSG_REDIRECT_END \
0217     AcpiOsRedirectOutput (OutputFile);
0218 
0219 #else
0220 /*
0221  * non-iASL case - no redirection, nothing to do
0222  */
0223 #define ACPI_MSG_REDIRECT_BEGIN
0224 #define ACPI_MSG_REDIRECT_END
0225 #endif
0226 
0227 /*
0228  * Common error message prefixes
0229  */
0230 #ifndef ACPI_MSG_ERROR
0231 #define ACPI_MSG_ERROR          "ACPI Error: "
0232 #endif
0233 #ifndef ACPI_MSG_WARNING
0234 #define ACPI_MSG_WARNING        "ACPI Warning: "
0235 #endif
0236 #ifndef ACPI_MSG_INFO
0237 #define ACPI_MSG_INFO           "ACPI: "
0238 #endif
0239 
0240 #ifndef ACPI_MSG_BIOS_ERROR
0241 #define ACPI_MSG_BIOS_ERROR     "Firmware Error (ACPI): "
0242 #endif
0243 #ifndef ACPI_MSG_BIOS_WARNING
0244 #define ACPI_MSG_BIOS_WARNING   "Firmware Warning (ACPI): "
0245 #endif
0246 
0247 /*
0248  * Common message suffix
0249  */
0250 #define ACPI_MSG_SUFFIX \
0251     AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
0252 
0253 /* Flags to indicate implicit or explicit string-to-integer conversion */
0254 
0255 #define ACPI_IMPLICIT_CONVERSION        TRUE
0256 #define ACPI_NO_IMPLICIT_CONVERSION     FALSE
0257 
0258 /* Types for Resource descriptor entries */
0259 
0260 #define ACPI_INVALID_RESOURCE           0
0261 #define ACPI_FIXED_LENGTH               1
0262 #define ACPI_VARIABLE_LENGTH            2
0263 #define ACPI_SMALL_VARIABLE_LENGTH      3
0264 
0265 typedef
0266 ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
0267     UINT8                   *Aml,
0268     UINT32                  Length,
0269     UINT32                  Offset,
0270     UINT8                   ResourceIndex,
0271     void                    **Context);
0272 
0273 typedef
0274 ACPI_STATUS (*ACPI_PKG_CALLBACK) (
0275     UINT8                   ObjectType,
0276     ACPI_OPERAND_OBJECT     *SourceObject,
0277     ACPI_GENERIC_STATE      *State,
0278     void                    *Context);
0279 
0280 typedef struct acpi_pkg_info
0281 {
0282     UINT8                   *FreeSpace;
0283     ACPI_SIZE               Length;
0284     UINT32                  ObjectSpace;
0285     UINT32                  NumPackages;
0286 
0287 } ACPI_PKG_INFO;
0288 
0289 /* Object reference counts */
0290 
0291 #define REF_INCREMENT       (UINT16) 0
0292 #define REF_DECREMENT       (UINT16) 1
0293 
0294 /* AcpiUtDumpBuffer */
0295 
0296 #define DB_BYTE_DISPLAY      0x01
0297 #define DB_WORD_DISPLAY      0x02
0298 #define DB_DWORD_DISPLAY     0x04
0299 #define DB_QWORD_DISPLAY     0x08
0300 #define DB_DISPLAY_DATA_ONLY 0x10
0301 
0302 
0303 /*
0304  * utascii - ASCII utilities
0305  */
0306 BOOLEAN
0307 AcpiUtValidNameseg (
0308     char                    *Signature);
0309 
0310 BOOLEAN
0311 AcpiUtValidNameChar (
0312     char                    Character,
0313     UINT32                  Position);
0314 
0315 void
0316 AcpiUtCheckAndRepairAscii (
0317     UINT8                   *Name,
0318     char                    *RepairedName,
0319     UINT32                  Count);
0320 
0321 
0322 /*
0323  * utcksum - Checksum utilities
0324  */
0325 UINT8
0326 AcpiUtGenerateChecksum (
0327     void                    *Table,
0328     UINT32                  Length,
0329     UINT8                   OriginalChecksum);
0330 
0331 UINT8
0332 AcpiUtChecksum (
0333     UINT8                   *Buffer,
0334     UINT32                  Length);
0335 
0336 ACPI_STATUS
0337 AcpiUtVerifyCdatChecksum (
0338     ACPI_TABLE_CDAT         *CdatTable,
0339     UINT32                  Length);
0340 
0341 ACPI_STATUS
0342 AcpiUtVerifyChecksum (
0343     ACPI_TABLE_HEADER       *Table,
0344     UINT32                  Length);
0345 
0346 
0347 /*
0348  * utnonansi - Non-ANSI C library functions
0349  */
0350 void
0351 AcpiUtStrupr (
0352     char                    *SrcString);
0353 
0354 void
0355 AcpiUtStrlwr (
0356     char                    *SrcString);
0357 
0358 int
0359 AcpiUtStricmp (
0360     char                    *String1,
0361     char                    *String2);
0362 
0363 
0364 /*
0365  * utstrsuppt - string-to-integer conversion support functions
0366  */
0367 ACPI_STATUS
0368 AcpiUtConvertOctalString (
0369     char                    *String,
0370     UINT64                  *ReturnValue);
0371 
0372 ACPI_STATUS
0373 AcpiUtConvertDecimalString (
0374     char                    *String,
0375     UINT64                  *ReturnValuePtr);
0376 
0377 ACPI_STATUS
0378 AcpiUtConvertHexString (
0379     char                    *String,
0380     UINT64                  *ReturnValuePtr);
0381 
0382 char
0383 AcpiUtRemoveWhitespace (
0384     char                    **String);
0385 
0386 char
0387 AcpiUtRemoveLeadingZeros (
0388     char                    **String);
0389 
0390 BOOLEAN
0391 AcpiUtDetectHexPrefix (
0392     char                    **String);
0393 
0394 void
0395 AcpiUtRemoveHexPrefix (
0396     char                    **String);
0397 
0398 BOOLEAN
0399 AcpiUtDetectOctalPrefix (
0400     char                    **String);
0401 
0402 
0403 /*
0404  * utstrtoul64 - string-to-integer conversion functions
0405  */
0406 ACPI_STATUS
0407 AcpiUtStrtoul64 (
0408     char                    *String,
0409     UINT64                  *RetInteger);
0410 
0411 UINT64
0412 AcpiUtExplicitStrtoul64 (
0413     char                    *String);
0414 
0415 UINT64
0416 AcpiUtImplicitStrtoul64 (
0417     char                    *String);
0418 
0419 
0420 /*
0421  * utglobal - Global data structures and procedures
0422  */
0423 ACPI_STATUS
0424 AcpiUtInitGlobals (
0425     void);
0426 
0427 const char *
0428 AcpiUtGetMutexName (
0429     UINT32                  MutexId);
0430 
0431 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0432 
0433 const char *
0434 AcpiUtGetNotifyName (
0435     UINT32                  NotifyValue,
0436     ACPI_OBJECT_TYPE        Type);
0437 #endif
0438 
0439 const char *
0440 AcpiUtGetTypeName (
0441     ACPI_OBJECT_TYPE        Type);
0442 
0443 const char *
0444 AcpiUtGetNodeName (
0445     void                    *Object);
0446 
0447 const char *
0448 AcpiUtGetDescriptorName (
0449     void                    *Object);
0450 
0451 const char *
0452 AcpiUtGetReferenceName (
0453     ACPI_OPERAND_OBJECT     *Object);
0454 
0455 const char *
0456 AcpiUtGetObjectTypeName (
0457     ACPI_OPERAND_OBJECT     *ObjDesc);
0458 
0459 const char *
0460 AcpiUtGetRegionName (
0461     UINT8                   SpaceId);
0462 
0463 const char *
0464 AcpiUtGetEventName (
0465     UINT32                  EventId);
0466 
0467 const char *
0468 AcpiUtGetArgumentTypeName (
0469     UINT32                  ArgType);
0470 
0471 char
0472 AcpiUtHexToAsciiChar (
0473     UINT64                  Integer,
0474     UINT32                  Position);
0475 
0476 ACPI_STATUS
0477 AcpiUtAsciiToHexByte (
0478     char                    *TwoAsciiChars,
0479     UINT8                   *ReturnByte);
0480 
0481 UINT8
0482 AcpiUtAsciiCharToHex (
0483     int                     HexChar);
0484 
0485 BOOLEAN
0486 AcpiUtValidObjectType (
0487     ACPI_OBJECT_TYPE        Type);
0488 
0489 
0490 /*
0491  * utinit - miscellaneous initialization and shutdown
0492  */
0493 ACPI_STATUS
0494 AcpiUtHardwareInitialize (
0495     void);
0496 
0497 void
0498 AcpiUtSubsystemShutdown (
0499     void);
0500 
0501 
0502 /*
0503  * utcopy - Object construction and conversion interfaces
0504  */
0505 ACPI_STATUS
0506 AcpiUtBuildSimpleObject(
0507     ACPI_OPERAND_OBJECT     *Obj,
0508     ACPI_OBJECT             *UserObj,
0509     UINT8                   *DataSpace,
0510     UINT32                  *BufferSpaceUsed);
0511 
0512 ACPI_STATUS
0513 AcpiUtBuildPackageObject (
0514     ACPI_OPERAND_OBJECT     *Obj,
0515     UINT8                   *Buffer,
0516     UINT32                  *SpaceUsed);
0517 
0518 ACPI_STATUS
0519 AcpiUtCopyIobjectToEobject (
0520     ACPI_OPERAND_OBJECT     *Obj,
0521     ACPI_BUFFER             *RetBuffer);
0522 
0523 ACPI_STATUS
0524 AcpiUtCopyEobjectToIobject (
0525     ACPI_OBJECT             *Obj,
0526     ACPI_OPERAND_OBJECT     **InternalObj);
0527 
0528 ACPI_STATUS
0529 AcpiUtCopyISimpleToIsimple (
0530     ACPI_OPERAND_OBJECT     *SourceObj,
0531     ACPI_OPERAND_OBJECT     *DestObj);
0532 
0533 ACPI_STATUS
0534 AcpiUtCopyIobjectToIobject (
0535     ACPI_OPERAND_OBJECT     *SourceDesc,
0536     ACPI_OPERAND_OBJECT     **DestDesc,
0537     ACPI_WALK_STATE         *WalkState);
0538 
0539 
0540 /*
0541  * utcreate - Object creation
0542  */
0543 ACPI_STATUS
0544 AcpiUtUpdateObjectReference (
0545     ACPI_OPERAND_OBJECT     *Object,
0546     UINT16                  Action);
0547 
0548 
0549 /*
0550  * utdebug - Debug interfaces
0551  */
0552 void
0553 AcpiUtInitStackPtrTrace (
0554     void);
0555 
0556 void
0557 AcpiUtTrackStackPtr (
0558     void);
0559 
0560 void
0561 AcpiUtTrace (
0562     UINT32                  LineNumber,
0563     const char              *FunctionName,
0564     const char              *ModuleName,
0565     UINT32                  ComponentId);
0566 
0567 void
0568 AcpiUtTracePtr (
0569     UINT32                  LineNumber,
0570     const char              *FunctionName,
0571     const char              *ModuleName,
0572     UINT32                  ComponentId,
0573     const void              *Pointer);
0574 
0575 void
0576 AcpiUtTraceU32 (
0577     UINT32                  LineNumber,
0578     const char              *FunctionName,
0579     const char              *ModuleName,
0580     UINT32                  ComponentId,
0581     UINT32                  Integer);
0582 
0583 void
0584 AcpiUtTraceStr (
0585     UINT32                  LineNumber,
0586     const char              *FunctionName,
0587     const char              *ModuleName,
0588     UINT32                  ComponentId,
0589     const char              *String);
0590 
0591 void
0592 AcpiUtExit (
0593     UINT32                  LineNumber,
0594     const char              *FunctionName,
0595     const char              *ModuleName,
0596     UINT32                  ComponentId);
0597 
0598 void
0599 AcpiUtStatusExit (
0600     UINT32                  LineNumber,
0601     const char              *FunctionName,
0602     const char              *ModuleName,
0603     UINT32                  ComponentId,
0604     ACPI_STATUS             Status);
0605 
0606 void
0607 AcpiUtValueExit (
0608     UINT32                  LineNumber,
0609     const char              *FunctionName,
0610     const char              *ModuleName,
0611     UINT32                  ComponentId,
0612     UINT64                  Value);
0613 
0614 void
0615 AcpiUtPtrExit (
0616     UINT32                  LineNumber,
0617     const char              *FunctionName,
0618     const char              *ModuleName,
0619     UINT32                  ComponentId,
0620     UINT8                   *Ptr);
0621 
0622 void
0623 AcpiUtStrExit (
0624     UINT32                  LineNumber,
0625     const char              *FunctionName,
0626     const char              *ModuleName,
0627     UINT32                  ComponentId,
0628     const char              *String);
0629 
0630 void
0631 AcpiUtDebugDumpBuffer (
0632     UINT8                   *Buffer,
0633     UINT32                  Count,
0634     UINT32                  Display,
0635     UINT32                  ComponentId);
0636 
0637 void
0638 AcpiUtDumpBuffer (
0639     UINT8                   *Buffer,
0640     UINT32                  Count,
0641     UINT32                  Display,
0642     UINT32                  Offset);
0643 
0644 #ifdef ACPI_APPLICATION
0645 void
0646 AcpiUtDumpBufferToFile (
0647     ACPI_FILE               File,
0648     UINT8                   *Buffer,
0649     UINT32                  Count,
0650     UINT32                  Display,
0651     UINT32                  BaseOffset);
0652 #endif
0653 
0654 void
0655 AcpiUtReportError (
0656     char                    *ModuleName,
0657     UINT32                  LineNumber);
0658 
0659 void
0660 AcpiUtReportInfo (
0661     char                    *ModuleName,
0662     UINT32                  LineNumber);
0663 
0664 void
0665 AcpiUtReportWarning (
0666     char                    *ModuleName,
0667     UINT32                  LineNumber);
0668 
0669 
0670 /*
0671  * utdelete - Object deletion and reference counts
0672  */
0673 void
0674 AcpiUtAddReference (
0675     ACPI_OPERAND_OBJECT     *Object);
0676 
0677 void
0678 AcpiUtRemoveReference (
0679     ACPI_OPERAND_OBJECT     *Object);
0680 
0681 void
0682 AcpiUtDeleteInternalPackageObject (
0683     ACPI_OPERAND_OBJECT     *Object);
0684 
0685 void
0686 AcpiUtDeleteInternalSimpleObject (
0687     ACPI_OPERAND_OBJECT     *Object);
0688 
0689 void
0690 AcpiUtDeleteInternalObjectList (
0691     ACPI_OPERAND_OBJECT     **ObjList);
0692 
0693 
0694 /*
0695  * uteval - object evaluation
0696  */
0697 ACPI_STATUS
0698 AcpiUtEvaluateObject (
0699     ACPI_NAMESPACE_NODE     *PrefixNode,
0700     const char              *Path,
0701     UINT32                  ExpectedReturnBtypes,
0702     ACPI_OPERAND_OBJECT     **ReturnDesc);
0703 
0704 ACPI_STATUS
0705 AcpiUtEvaluateNumericObject (
0706     const char              *ObjectName,
0707     ACPI_NAMESPACE_NODE     *DeviceNode,
0708     UINT64                  *Value);
0709 
0710 ACPI_STATUS
0711 AcpiUtExecute_STA (
0712     ACPI_NAMESPACE_NODE     *DeviceNode,
0713     UINT32                  *StatusFlags);
0714 
0715 ACPI_STATUS
0716 AcpiUtExecutePowerMethods (
0717     ACPI_NAMESPACE_NODE     *DeviceNode,
0718     const char              **MethodNames,
0719     UINT8                   MethodCount,
0720     UINT8                   *OutValues);
0721 
0722 
0723 /*
0724  * utids - device ID support
0725  */
0726 ACPI_STATUS
0727 AcpiUtExecute_HID (
0728     ACPI_NAMESPACE_NODE     *DeviceNode,
0729     ACPI_PNP_DEVICE_ID      **ReturnId);
0730 
0731 ACPI_STATUS
0732 AcpiUtExecute_UID (
0733     ACPI_NAMESPACE_NODE     *DeviceNode,
0734     ACPI_PNP_DEVICE_ID      **ReturnId);
0735 
0736 ACPI_STATUS
0737 AcpiUtExecute_CID (
0738     ACPI_NAMESPACE_NODE     *DeviceNode,
0739     ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
0740 
0741 ACPI_STATUS
0742 AcpiUtExecute_CLS (
0743     ACPI_NAMESPACE_NODE     *DeviceNode,
0744     ACPI_PNP_DEVICE_ID      **ReturnId);
0745 
0746 
0747 /*
0748  * utlock - reader/writer locks
0749  */
0750 ACPI_STATUS
0751 AcpiUtCreateRwLock (
0752     ACPI_RW_LOCK            *Lock);
0753 
0754 void
0755 AcpiUtDeleteRwLock (
0756     ACPI_RW_LOCK            *Lock);
0757 
0758 ACPI_STATUS
0759 AcpiUtAcquireReadLock (
0760     ACPI_RW_LOCK            *Lock);
0761 
0762 ACPI_STATUS
0763 AcpiUtReleaseReadLock (
0764     ACPI_RW_LOCK            *Lock);
0765 
0766 ACPI_STATUS
0767 AcpiUtAcquireWriteLock (
0768     ACPI_RW_LOCK            *Lock);
0769 
0770 void
0771 AcpiUtReleaseWriteLock (
0772     ACPI_RW_LOCK            *Lock);
0773 
0774 
0775 /*
0776  * utobject - internal object create/delete/cache routines
0777  */
0778 ACPI_OPERAND_OBJECT  *
0779 AcpiUtCreateInternalObjectDbg (
0780     const char              *ModuleName,
0781     UINT32                  LineNumber,
0782     UINT32                  ComponentId,
0783     ACPI_OBJECT_TYPE        Type);
0784 
0785 void *
0786 AcpiUtAllocateObjectDescDbg (
0787     const char              *ModuleName,
0788     UINT32                  LineNumber,
0789     UINT32                  ComponentId);
0790 
0791 #define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
0792 #define AcpiUtAllocateObjectDesc()      AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
0793 
0794 void
0795 AcpiUtDeleteObjectDesc (
0796     ACPI_OPERAND_OBJECT     *Object);
0797 
0798 BOOLEAN
0799 AcpiUtValidInternalObject (
0800     void                    *Object);
0801 
0802 ACPI_OPERAND_OBJECT *
0803 AcpiUtCreatePackageObject (
0804     UINT32                  Count);
0805 
0806 ACPI_OPERAND_OBJECT *
0807 AcpiUtCreateIntegerObject (
0808     UINT64                  Value);
0809 
0810 ACPI_OPERAND_OBJECT *
0811 AcpiUtCreateBufferObject (
0812     ACPI_SIZE               BufferSize);
0813 
0814 ACPI_OPERAND_OBJECT *
0815 AcpiUtCreateStringObject (
0816     ACPI_SIZE               StringSize);
0817 
0818 ACPI_STATUS
0819 AcpiUtGetObjectSize(
0820     ACPI_OPERAND_OBJECT     *Obj,
0821     ACPI_SIZE               *ObjLength);
0822 
0823 
0824 /*
0825  * utosi - Support for the _OSI predefined control method
0826  */
0827 ACPI_STATUS
0828 AcpiUtInitializeInterfaces (
0829     void);
0830 
0831 ACPI_STATUS
0832 AcpiUtInterfaceTerminate (
0833     void);
0834 
0835 ACPI_STATUS
0836 AcpiUtInstallInterface (
0837     ACPI_STRING             InterfaceName);
0838 
0839 ACPI_STATUS
0840 AcpiUtRemoveInterface (
0841     ACPI_STRING             InterfaceName);
0842 
0843 ACPI_STATUS
0844 AcpiUtUpdateInterfaces (
0845     UINT8                   Action);
0846 
0847 ACPI_INTERFACE_INFO *
0848 AcpiUtGetInterface (
0849     ACPI_STRING             InterfaceName);
0850 
0851 ACPI_STATUS
0852 AcpiUtOsiImplementation (
0853     ACPI_WALK_STATE         *WalkState);
0854 
0855 
0856 /*
0857  * utpredef - support for predefined names
0858  */
0859 const ACPI_PREDEFINED_INFO *
0860 AcpiUtGetNextPredefinedMethod (
0861     const ACPI_PREDEFINED_INFO  *ThisName);
0862 
0863 const ACPI_PREDEFINED_INFO *
0864 AcpiUtMatchPredefinedMethod (
0865     char                        *Name);
0866 
0867 void
0868 AcpiUtGetExpectedReturnTypes (
0869     char                    *Buffer,
0870     UINT32                  ExpectedBtypes);
0871 
0872 #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
0873 const ACPI_PREDEFINED_INFO *
0874 AcpiUtMatchResourceName (
0875     char                        *Name);
0876 
0877 void
0878 AcpiUtDisplayPredefinedMethod (
0879     char                        *Buffer,
0880     const ACPI_PREDEFINED_INFO  *ThisName,
0881     BOOLEAN                     MultiLine);
0882 
0883 UINT32
0884 AcpiUtGetResourceBitWidth (
0885     char                    *Buffer,
0886     UINT16                  Types);
0887 #endif
0888 
0889 
0890 /*
0891  * utstate - Generic state creation/cache routines
0892  */
0893 void
0894 AcpiUtPushGenericState (
0895     ACPI_GENERIC_STATE      **ListHead,
0896     ACPI_GENERIC_STATE      *State);
0897 
0898 ACPI_GENERIC_STATE *
0899 AcpiUtPopGenericState (
0900     ACPI_GENERIC_STATE      **ListHead);
0901 
0902 
0903 ACPI_GENERIC_STATE *
0904 AcpiUtCreateGenericState (
0905     void);
0906 
0907 ACPI_THREAD_STATE *
0908 AcpiUtCreateThreadState (
0909     void);
0910 
0911 ACPI_GENERIC_STATE *
0912 AcpiUtCreateUpdateState (
0913     ACPI_OPERAND_OBJECT     *Object,
0914     UINT16                  Action);
0915 
0916 ACPI_GENERIC_STATE *
0917 AcpiUtCreatePkgState (
0918     void                    *InternalObject,
0919     void                    *ExternalObject,
0920     UINT32                  Index);
0921 
0922 ACPI_STATUS
0923 AcpiUtCreateUpdateStateAndPush (
0924     ACPI_OPERAND_OBJECT     *Object,
0925     UINT16                  Action,
0926     ACPI_GENERIC_STATE      **StateList);
0927 
0928 ACPI_GENERIC_STATE *
0929 AcpiUtCreateControlState (
0930     void);
0931 
0932 void
0933 AcpiUtDeleteGenericState (
0934     ACPI_GENERIC_STATE      *State);
0935 
0936 
0937 /*
0938  * utmath
0939  */
0940 ACPI_STATUS
0941 AcpiUtDivide (
0942     UINT64                  InDividend,
0943     UINT64                  InDivisor,
0944     UINT64                  *OutQuotient,
0945     UINT64                  *OutRemainder);
0946 
0947 ACPI_STATUS
0948 AcpiUtShortDivide (
0949     UINT64                  InDividend,
0950     UINT32                  Divisor,
0951     UINT64                  *OutQuotient,
0952     UINT32                  *OutRemainder);
0953 
0954 ACPI_STATUS
0955 AcpiUtShortMultiply (
0956     UINT64                  InMultiplicand,
0957     UINT32                  Multiplier,
0958     UINT64                  *Outproduct);
0959 
0960 ACPI_STATUS
0961 AcpiUtShortShiftLeft (
0962     UINT64                  Operand,
0963     UINT32                  Count,
0964     UINT64                  *OutResult);
0965 
0966 ACPI_STATUS
0967 AcpiUtShortShiftRight (
0968     UINT64                  Operand,
0969     UINT32                  Count,
0970     UINT64                  *OutResult);
0971 
0972 
0973 /*
0974  * utmisc
0975  */
0976 const ACPI_EXCEPTION_INFO *
0977 AcpiUtValidateException (
0978     ACPI_STATUS             Status);
0979 
0980 BOOLEAN
0981 AcpiUtIsPciRootBridge (
0982     char                    *Id);
0983 
0984 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
0985 BOOLEAN
0986 AcpiUtIsAmlTable (
0987     ACPI_TABLE_HEADER       *Table);
0988 #endif
0989 
0990 ACPI_STATUS
0991 AcpiUtWalkPackageTree (
0992     ACPI_OPERAND_OBJECT     *SourceObject,
0993     void                    *TargetObject,
0994     ACPI_PKG_CALLBACK       WalkCallback,
0995     void                    *Context);
0996 
0997 /* Values for Base above (16=Hex, 10=Decimal) */
0998 
0999 #define ACPI_ANY_BASE        0
1000 
1001 
1002 UINT32
1003 AcpiUtDwordByteSwap (
1004     UINT32                  Value);
1005 
1006 void
1007 AcpiUtSetIntegerWidth (
1008     UINT8                   Revision);
1009 
1010 #ifdef ACPI_DEBUG_OUTPUT
1011 void
1012 AcpiUtDisplayInitPathname (
1013     UINT8                   Type,
1014     ACPI_NAMESPACE_NODE     *ObjHandle,
1015     const char              *Path);
1016 #endif
1017 
1018 
1019 /*
1020  * utownerid - Support for Table/Method Owner IDs
1021  */
1022 ACPI_STATUS
1023 AcpiUtAllocateOwnerId (
1024     ACPI_OWNER_ID           *OwnerId);
1025 
1026 void
1027 AcpiUtReleaseOwnerId (
1028     ACPI_OWNER_ID           *OwnerId);
1029 
1030 
1031 /*
1032  * utresrc
1033  */
1034 ACPI_STATUS
1035 AcpiUtWalkAmlResources (
1036     ACPI_WALK_STATE         *WalkState,
1037     UINT8                   *Aml,
1038     ACPI_SIZE               AmlLength,
1039     ACPI_WALK_AML_CALLBACK  UserFunction,
1040     void                    **Context);
1041 
1042 ACPI_STATUS
1043 AcpiUtValidateResource (
1044     ACPI_WALK_STATE         *WalkState,
1045     void                    *Aml,
1046     UINT8                   *ReturnIndex);
1047 
1048 UINT32
1049 AcpiUtGetDescriptorLength (
1050     void                    *Aml);
1051 
1052 UINT16
1053 AcpiUtGetResourceLength (
1054     void                    *Aml);
1055 
1056 UINT8
1057 AcpiUtGetResourceHeaderLength (
1058     void                    *Aml);
1059 
1060 UINT8
1061 AcpiUtGetResourceType (
1062     void                    *Aml);
1063 
1064 ACPI_STATUS
1065 AcpiUtGetResourceEndTag (
1066     ACPI_OPERAND_OBJECT     *ObjDesc,
1067     UINT8                   **EndTag);
1068 
1069 
1070 /*
1071  * utstring - String and character utilities
1072  */
1073 void
1074 AcpiUtPrintString (
1075     char                    *String,
1076     UINT16                  MaxLength);
1077 
1078 #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
1079 void
1080 UtConvertBackslashes (
1081     char                    *Pathname);
1082 #endif
1083 
1084 void
1085 AcpiUtRepairName (
1086     char                    *Name);
1087 
1088 #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) || defined (ACPI_DEBUG_OUTPUT)
1089 BOOLEAN
1090 AcpiUtSafeStrcpy (
1091     char                    *Dest,
1092     ACPI_SIZE               DestSize,
1093     char                    *Source);
1094 
1095 void
1096 AcpiUtSafeStrncpy (
1097     char                    *Dest,
1098     char                    *Source,
1099     ACPI_SIZE               DestSize);
1100 
1101 BOOLEAN
1102 AcpiUtSafeStrcat (
1103     char                    *Dest,
1104     ACPI_SIZE               DestSize,
1105     char                    *Source);
1106 
1107 BOOLEAN
1108 AcpiUtSafeStrncat (
1109     char                    *Dest,
1110     ACPI_SIZE               DestSize,
1111     char                    *Source,
1112     ACPI_SIZE               MaxTransferLength);
1113 #endif
1114 
1115 
1116 /*
1117  * utmutex - mutex support
1118  */
1119 ACPI_STATUS
1120 AcpiUtMutexInitialize (
1121     void);
1122 
1123 void
1124 AcpiUtMutexTerminate (
1125     void);
1126 
1127 ACPI_STATUS
1128 AcpiUtAcquireMutex (
1129     ACPI_MUTEX_HANDLE       MutexId);
1130 
1131 ACPI_STATUS
1132 AcpiUtReleaseMutex (
1133     ACPI_MUTEX_HANDLE       MutexId);
1134 
1135 
1136 /*
1137  * utalloc - memory allocation and object caching
1138  */
1139 ACPI_STATUS
1140 AcpiUtCreateCaches (
1141     void);
1142 
1143 ACPI_STATUS
1144 AcpiUtDeleteCaches (
1145     void);
1146 
1147 ACPI_STATUS
1148 AcpiUtValidateBuffer (
1149     ACPI_BUFFER             *Buffer);
1150 
1151 ACPI_STATUS
1152 AcpiUtInitializeBuffer (
1153     ACPI_BUFFER             *Buffer,
1154     ACPI_SIZE               RequiredLength);
1155 
1156 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1157 void *
1158 AcpiUtAllocateAndTrack (
1159     ACPI_SIZE               Size,
1160     UINT32                  Component,
1161     const char              *Module,
1162     UINT32                  Line);
1163 
1164 void *
1165 AcpiUtAllocateZeroedAndTrack (
1166     ACPI_SIZE               Size,
1167     UINT32                  Component,
1168     const char              *Module,
1169     UINT32                  Line);
1170 
1171 void
1172 AcpiUtFreeAndTrack (
1173     void                    *Address,
1174     UINT32                  Component,
1175     const char              *Module,
1176     UINT32                  Line);
1177 
1178 void
1179 AcpiUtDumpAllocationInfo (
1180     void);
1181 
1182 void
1183 AcpiUtDumpAllocations (
1184     UINT32                  Component,
1185     const char              *Module);
1186 
1187 ACPI_STATUS
1188 AcpiUtCreateList (
1189     const char              *ListName,
1190     UINT16                  ObjectSize,
1191     ACPI_MEMORY_LIST        **ReturnCache);
1192 
1193 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */
1194 
1195 
1196 /*
1197  * utaddress - address range check
1198  */
1199 ACPI_STATUS
1200 AcpiUtAddAddressRange (
1201     ACPI_ADR_SPACE_TYPE     SpaceId,
1202     ACPI_PHYSICAL_ADDRESS   Address,
1203     UINT32                  Length,
1204     ACPI_NAMESPACE_NODE     *RegionNode);
1205 
1206 void
1207 AcpiUtRemoveAddressRange (
1208     ACPI_ADR_SPACE_TYPE     SpaceId,
1209     ACPI_NAMESPACE_NODE     *RegionNode);
1210 
1211 UINT32
1212 AcpiUtCheckAddressRange (
1213     ACPI_ADR_SPACE_TYPE     SpaceId,
1214     ACPI_PHYSICAL_ADDRESS   Address,
1215     UINT32                  Length,
1216     BOOLEAN                 Warn);
1217 
1218 void
1219 AcpiUtDeleteAddressLists (
1220     void);
1221 
1222 
1223 /*
1224  * utxferror - various error/warning output functions
1225  */
1226 ACPI_PRINTF_LIKE(5)
1227 void ACPI_INTERNAL_VAR_XFACE
1228 AcpiUtPredefinedWarning (
1229     const char              *ModuleName,
1230     UINT32                  LineNumber,
1231     char                    *Pathname,
1232     UINT16                  NodeFlags,
1233     const char              *Format,
1234     ...);
1235 
1236 ACPI_PRINTF_LIKE(5)
1237 void ACPI_INTERNAL_VAR_XFACE
1238 AcpiUtPredefinedInfo (
1239     const char              *ModuleName,
1240     UINT32                  LineNumber,
1241     char                    *Pathname,
1242     UINT16                  NodeFlags,
1243     const char              *Format,
1244     ...);
1245 
1246 ACPI_PRINTF_LIKE(5)
1247 void ACPI_INTERNAL_VAR_XFACE
1248 AcpiUtPredefinedBiosError (
1249     const char              *ModuleName,
1250     UINT32                  LineNumber,
1251     char                    *Pathname,
1252     UINT16                  NodeFlags,
1253     const char              *Format,
1254     ...);
1255 
1256 void
1257 AcpiUtPrefixedNamespaceError (
1258     const char              *ModuleName,
1259     UINT32                  LineNumber,
1260     ACPI_GENERIC_STATE      *PrefixScope,
1261     const char              *InternalName,
1262     ACPI_STATUS             LookupStatus);
1263 
1264 void
1265 AcpiUtMethodError (
1266     const char              *ModuleName,
1267     UINT32                  LineNumber,
1268     const char              *Message,
1269     ACPI_NAMESPACE_NODE     *Node,
1270     const char              *Path,
1271     ACPI_STATUS             LookupStatus);
1272 
1273 
1274 /*
1275  * Utility functions for ACPI names and IDs
1276  */
1277 const AH_PREDEFINED_NAME *
1278 AcpiAhMatchPredefinedName (
1279     char                    *Nameseg);
1280 
1281 const AH_DEVICE_ID *
1282 AcpiAhMatchHardwareId (
1283     char                    *Hid);
1284 
1285 const char *
1286 AcpiAhMatchUuid (
1287     UINT8                   *Data);
1288 
1289 
1290 /*
1291  * utuuid -- UUID support functions
1292  */
1293 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
1294 void
1295 AcpiUtConvertStringToUuid (
1296     char                    *InString,
1297     UINT8                   *UuidBuffer);
1298 
1299 ACPI_STATUS
1300 AcpiUtConvertUuidToString (
1301     char                    *UuidBuffer,
1302     char                    *OutString);
1303 #endif
1304 
1305 #endif /* _ACUTILS_H */