acutils.h revision 193267
150397Sobrien/****************************************************************************** 250397Sobrien * 350397Sobrien * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 450397Sobrien * 550397Sobrien *****************************************************************************/ 650397Sobrien 750397Sobrien/****************************************************************************** 850397Sobrien * 950397Sobrien * 1. Copyright Notice 1050397Sobrien * 1150397Sobrien * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. 1250397Sobrien * All rights reserved. 1350397Sobrien * 1450397Sobrien * 2. License 1550397Sobrien * 1650397Sobrien * 2.1. This is your license from Intel Corp. under its intellectual property 1750397Sobrien * rights. You may have additional license terms from the party that provided 1850397Sobrien * you this software, covering your right to use that party's intellectual 1950397Sobrien * property rights. 2050397Sobrien * 2150397Sobrien * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2252284Sobrien * copy of the source code appearing in this file ("Covered Code") an 2350397Sobrien * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2450397Sobrien * base code distributed originally by Intel ("Original Intel Code") to copy, 2550397Sobrien * make derivatives, distribute, use and display any portion of the Covered 2650397Sobrien * Code in any form, with the right to sublicense such rights; and 2750397Sobrien * 2850397Sobrien * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 2950397Sobrien * license (with the right to sublicense), under only those claims of Intel 3050397Sobrien * patents that are infringed by the Original Intel Code, to make, use, sell, 3150397Sobrien * offer to sell, and import the Covered Code and derivative works thereof 3250397Sobrien * solely to the minimum extent necessary to exercise the above copyright 3350397Sobrien * license, and in no event shall the patent license extend to any additions 3450397Sobrien * to or modifications of the Original Intel Code. No other license or right 3550397Sobrien * is granted directly or by implication, estoppel or otherwise; 3650397Sobrien * 3752284Sobrien * The above copyright and patent license is granted only if the following 3852284Sobrien * conditions are met: 3952284Sobrien * 4052284Sobrien * 3. Conditions 4152284Sobrien * 4252284Sobrien * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4352284Sobrien * Redistribution of source code of any substantial portion of the Covered 4452284Sobrien * Code or modification with rights to further distribute source must include 4552284Sobrien * the above Copyright Notice, the above License, this list of Conditions, 4652284Sobrien * and the following Disclaimer and Export Compliance provision. In addition, 4750397Sobrien * Licensee must cause all Covered Code to which Licensee contributes to 4850397Sobrien * contain a file documenting the changes Licensee made to create that Covered 4950397Sobrien * Code and the date of any change. Licensee must include in that file the 5050397Sobrien * documentation of any changes made by any predecessor Licensee. Licensee 5150397Sobrien * must include a prominent statement that the modification is derived, 5250397Sobrien * directly or indirectly, from Original Intel Code. 5350397Sobrien * 5450397Sobrien * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5550397Sobrien * Redistribution of source code of any substantial portion of the Covered 5650397Sobrien * Code or modification without rights to further distribute source must 5750397Sobrien * include the following Disclaimer and Export Compliance provision in the 5850397Sobrien * documentation and/or other materials provided with distribution. In 5950397Sobrien * addition, Licensee may not authorize further sublicense of source of any 6050397Sobrien * portion of the Covered Code, and must include terms to the effect that the 6150397Sobrien * license from Licensee to its licensee is limited to the intellectual 6250397Sobrien * property embodied in the software Licensee provides to its licensee, and 6350397Sobrien * not to intellectual property embodied in modifications its licensee may 6450397Sobrien * make. 6552284Sobrien * 6652284Sobrien * 3.3. Redistribution of Executable. Redistribution in executable form of any 6750397Sobrien * substantial portion of the Covered Code or modification must reproduce the 6850397Sobrien * above Copyright Notice, and the following Disclaimer and Export Compliance 6950397Sobrien * provision in the documentation and/or other materials provided with the 7050397Sobrien * distribution. 7152284Sobrien * 7252284Sobrien * 3.4. Intel retains all right, title, and interest in and to the Original 7352284Sobrien * Intel Code. 7452284Sobrien * 7552284Sobrien * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7652284Sobrien * Intel shall be used in advertising or otherwise to promote the sale, use or 7752284Sobrien * other dealings in products derived from or relating to the Covered Code 7852284Sobrien * without prior written authorization from Intel. 7952284Sobrien * 8052284Sobrien * 4. Disclaimer and Export Compliance 8152284Sobrien * 8252284Sobrien * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8352284Sobrien * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8452284Sobrien * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8552284Sobrien * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8652284Sobrien * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8752284Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8852284Sobrien * PARTICULAR PURPOSE. 8952284Sobrien * 9052284Sobrien * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9152284Sobrien * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9252284Sobrien * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9352284Sobrien * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9452284Sobrien * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9552284Sobrien * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9650397Sobrien * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9750397Sobrien * LIMITED REMEDY. 9850397Sobrien * 9950397Sobrien * 4.3. Licensee shall not export, either directly or indirectly, any of this 10050397Sobrien * software or system incorporating such software without first obtaining any 10150397Sobrien * required license or other approval from the U. S. Department of Commerce or 10250397Sobrien * any other agency or department of the United States Government. In the 10352284Sobrien * event Licensee exports any such software from the United States or 10452284Sobrien * re-exports any such software from a foreign destination, Licensee shall 10550397Sobrien * ensure that the distribution and export/re-export of the software is in 10650397Sobrien * compliance with all laws, regulations, orders, or other restrictions of the 10752284Sobrien * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10852284Sobrien * any of its subsidiaries will export/re-export any technical data, process, 10952284Sobrien * software, or service, directly or indirectly, to any country for which the 11052284Sobrien * United States government or any agency thereof requires an export license, 11152284Sobrien * other governmental approval, or letter of assurance, without first obtaining 11252284Sobrien * such license, approval or letter. 11352284Sobrien * 11452284Sobrien *****************************************************************************/ 11552284Sobrien 11652284Sobrien#ifndef _ACUTILS_H 11752284Sobrien#define _ACUTILS_H 11852284Sobrien 11952284Sobrien 12052284Sobrienextern const UINT8 AcpiGbl_ResourceAmlSizes[]; 12152284Sobrien 12252284Sobrien/* Strings used by the disassembler and debugger resource dump routines */ 12352284Sobrien 12452284Sobrien#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 12552284Sobrien 12652284Sobrienextern const char *AcpiGbl_BmDecode[]; 12752284Sobrienextern const char *AcpiGbl_ConfigDecode[]; 12852284Sobrienextern const char *AcpiGbl_ConsumeDecode[]; 12952284Sobrienextern const char *AcpiGbl_DecDecode[]; 13050397Sobrienextern const char *AcpiGbl_HeDecode[]; 13150397Sobrienextern const char *AcpiGbl_IoDecode[]; 13250397Sobrienextern const char *AcpiGbl_LlDecode[]; 13350397Sobrienextern const char *AcpiGbl_MaxDecode[]; 13450397Sobrienextern const char *AcpiGbl_MemDecode[]; 13552284Sobrienextern const char *AcpiGbl_MinDecode[]; 13650397Sobrienextern const char *AcpiGbl_MtpDecode[]; 13750397Sobrienextern const char *AcpiGbl_RngDecode[]; 13850397Sobrienextern const char *AcpiGbl_RwDecode[]; 13950397Sobrienextern const char *AcpiGbl_ShrDecode[]; 14050397Sobrienextern const char *AcpiGbl_SizDecode[]; 14150397Sobrienextern const char *AcpiGbl_TrsDecode[]; 14250397Sobrienextern const char *AcpiGbl_TtpDecode[]; 14350397Sobrienextern const char *AcpiGbl_TypDecode[]; 14450397Sobrien#endif 14552284Sobrien 14650397Sobrien/* Types for Resource descriptor entries */ 14752284Sobrien 14850397Sobrien#define ACPI_INVALID_RESOURCE 0 14950397Sobrien#define ACPI_FIXED_LENGTH 1 15050397Sobrien#define ACPI_VARIABLE_LENGTH 2 15150397Sobrien#define ACPI_SMALL_VARIABLE_LENGTH 3 15250397Sobrien 15350397Sobrientypedef 15450397SobrienACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( 15550397Sobrien UINT8 *Aml, 15650397Sobrien UINT32 Length, 15750397Sobrien UINT32 Offset, 15850397Sobrien UINT8 ResourceIndex, 15950397Sobrien void *Context); 16050397Sobrien 16150397Sobrientypedef 16250397SobrienACPI_STATUS (*ACPI_PKG_CALLBACK) ( 16350397Sobrien UINT8 ObjectType, 16450397Sobrien ACPI_OPERAND_OBJECT *SourceObject, 16550397Sobrien ACPI_GENERIC_STATE *State, 16650397Sobrien void *Context); 16750397Sobrien 16850397Sobrientypedef struct acpi_pkg_info 16950397Sobrien{ 17050397Sobrien UINT8 *FreeSpace; 17150397Sobrien ACPI_SIZE Length; 17250397Sobrien UINT32 ObjectSpace; 17350397Sobrien UINT32 NumPackages; 17450397Sobrien 17550397Sobrien} ACPI_PKG_INFO; 17650397Sobrien 17750397Sobrien#define REF_INCREMENT (UINT16) 0 17850397Sobrien#define REF_DECREMENT (UINT16) 1 17952284Sobrien#define REF_FORCE_DELETE (UINT16) 2 18052284Sobrien 18152284Sobrien/* AcpiUtDumpBuffer */ 18252284Sobrien 18352284Sobrien#define DB_BYTE_DISPLAY 1 18452284Sobrien#define DB_WORD_DISPLAY 2 18552284Sobrien#define DB_DWORD_DISPLAY 4 18652284Sobrien#define DB_QWORD_DISPLAY 8 18752284Sobrien 18852284Sobrien 18952284Sobrien/* 19052284Sobrien * utglobal - Global data structures and procedures 19152284Sobrien */ 19252284SobrienACPI_STATUS 19352284SobrienAcpiUtInitGlobals ( 19452284Sobrien void); 19552284Sobrien 19652284Sobrien#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 19752284Sobrien 19852284Sobrienchar * 19952284SobrienAcpiUtGetMutexName ( 20052284Sobrien UINT32 MutexId); 20152284Sobrien 20252284Sobrienconst char * 20352284SobrienAcpiUtGetNotifyName ( 20452284Sobrien UINT32 NotifyValue); 20552284Sobrien 20652284Sobrien#endif 20752284Sobrien 20852284Sobrienchar * 20952284SobrienAcpiUtGetTypeName ( 21052284Sobrien ACPI_OBJECT_TYPE Type); 21152284Sobrien 21252284Sobrienchar * 21352284SobrienAcpiUtGetNodeName ( 21452284Sobrien void *Object); 21550397Sobrien 21652284Sobrienchar * 21752284SobrienAcpiUtGetDescriptorName ( 21852284Sobrien void *Object); 21952284Sobrien 22052284Sobrienconst char * 22152284SobrienAcpiUtGetReferenceName ( 22252284Sobrien ACPI_OPERAND_OBJECT *Object); 22352284Sobrien 22452284Sobrienchar * 22552284SobrienAcpiUtGetObjectTypeName ( 22652284Sobrien ACPI_OPERAND_OBJECT *ObjDesc); 22752284Sobrien 22852284Sobrienchar * 22952284SobrienAcpiUtGetRegionName ( 23052284Sobrien UINT8 SpaceId); 23152284Sobrien 23252284Sobrienchar * 23352284SobrienAcpiUtGetEventName ( 23452284Sobrien UINT32 EventId); 23552284Sobrien 23652284Sobrienchar 23752284SobrienAcpiUtHexToAsciiChar ( 23852284Sobrien ACPI_INTEGER Integer, 23952284Sobrien UINT32 Position); 24052284Sobrien 24152284SobrienBOOLEAN 24252284SobrienAcpiUtValidObjectType ( 24352284Sobrien ACPI_OBJECT_TYPE Type); 24452284Sobrien 24552284Sobrien 24652284Sobrien/* 24752284Sobrien * utinit - miscellaneous initialization and shutdown 24852284Sobrien */ 24952284SobrienACPI_STATUS 25050397SobrienAcpiUtHardwareInitialize ( 25150397Sobrien void); 25250397Sobrien 25350397Sobrienvoid 25452284SobrienAcpiUtSubsystemShutdown ( 25550397Sobrien void); 25650397Sobrien 25750397Sobrien 25850397Sobrien/* 25952284Sobrien * utclib - Local implementations of C library functions 26052284Sobrien */ 26150397Sobrien#ifndef ACPI_USE_SYSTEM_CLIBRARY 26250397Sobrien 26350397SobrienACPI_SIZE 26450397SobrienAcpiUtStrlen ( 26550397Sobrien const char *String); 26650397Sobrien 26750397Sobrienchar * 26850397SobrienAcpiUtStrcpy ( 26950397Sobrien char *DstString, 27050397Sobrien const char *SrcString); 27150397Sobrien 27250397Sobrienchar * 27350397SobrienAcpiUtStrncpy ( 27450397Sobrien char *DstString, 27550397Sobrien const char *SrcString, 27650397Sobrien ACPI_SIZE Count); 27750397Sobrien 27850397Sobrienint 27950397SobrienAcpiUtMemcmp ( 28050397Sobrien const char *Buffer1, 28150397Sobrien const char *Buffer2, 28250397Sobrien ACPI_SIZE Count); 28350397Sobrien 28450397Sobrienint 28550397SobrienAcpiUtStrncmp ( 28650397Sobrien const char *String1, 28750397Sobrien const char *String2, 28850397Sobrien ACPI_SIZE Count); 28950397Sobrien 29050397Sobrienint 29150397SobrienAcpiUtStrcmp ( 29250397Sobrien const char *String1, 29350397Sobrien const char *String2); 29450397Sobrien 29550397Sobrienchar * 29650397SobrienAcpiUtStrcat ( 29750397Sobrien char *DstString, 29850397Sobrien const char *SrcString); 29950397Sobrien 30050397Sobrienchar * 30150397SobrienAcpiUtStrncat ( 30250397Sobrien char *DstString, 30350397Sobrien const char *SrcString, 30450397Sobrien ACPI_SIZE Count); 30550397Sobrien 30650397SobrienUINT32 30750397SobrienAcpiUtStrtoul ( 30850397Sobrien const char *String, 30950397Sobrien char **Terminator, 31050397Sobrien UINT32 Base); 31150397Sobrien 31250397Sobrienchar * 31350397SobrienAcpiUtStrstr ( 31450397Sobrien char *String1, 31550397Sobrien char *String2); 31650397Sobrien 31750397Sobrienvoid * 31850397SobrienAcpiUtMemcpy ( 31950397Sobrien void *Dest, 32050397Sobrien const void *Src, 32150397Sobrien ACPI_SIZE Count); 32250397Sobrien 32350397Sobrienvoid * 32450397SobrienAcpiUtMemset ( 32550397Sobrien void *Dest, 32650397Sobrien UINT8 Value, 32750397Sobrien ACPI_SIZE Count); 32850397Sobrien 32950397Sobrienint 33050397SobrienAcpiUtToUpper ( 33150397Sobrien int c); 33250397Sobrien 33350397Sobrienint 33450397SobrienAcpiUtToLower ( 33550397Sobrien int c); 33650397Sobrien 33750397Sobrienextern const UINT8 _acpi_ctype[]; 33850397Sobrien 33950397Sobrien#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 34050397Sobrien#define _ACPI_XS 0x40 /* extra space */ 34150397Sobrien#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 34250397Sobrien#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 34350397Sobrien#define _ACPI_DI 0x04 /* '0'-'9' */ 34450397Sobrien#define _ACPI_LO 0x02 /* 'a'-'z' */ 34550397Sobrien#define _ACPI_PU 0x10 /* punctuation */ 34650397Sobrien#define _ACPI_SP 0x08 /* space */ 34750397Sobrien#define _ACPI_UP 0x01 /* 'A'-'Z' */ 34850397Sobrien#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 34950397Sobrien 35050397Sobrien#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 35150397Sobrien#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 35250397Sobrien#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 35350397Sobrien#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 35450397Sobrien#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 35550397Sobrien#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 35650397Sobrien#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 35750397Sobrien 35850397Sobrien#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ 35950397Sobrien 36050397Sobrien#define ACPI_IS_ASCII(c) ((c) < 0x80) 36150397Sobrien 36250397Sobrien 36350397Sobrien/* 36450397Sobrien * utcopy - Object construction and conversion interfaces 36550397Sobrien */ 36650397SobrienACPI_STATUS 367AcpiUtBuildSimpleObject( 368 ACPI_OPERAND_OBJECT *Obj, 369 ACPI_OBJECT *UserObj, 370 UINT8 *DataSpace, 371 UINT32 *BufferSpaceUsed); 372 373ACPI_STATUS 374AcpiUtBuildPackageObject ( 375 ACPI_OPERAND_OBJECT *Obj, 376 UINT8 *Buffer, 377 UINT32 *SpaceUsed); 378 379ACPI_STATUS 380AcpiUtCopyIobjectToEobject ( 381 ACPI_OPERAND_OBJECT *Obj, 382 ACPI_BUFFER *RetBuffer); 383 384ACPI_STATUS 385AcpiUtCopyEobjectToIobject ( 386 ACPI_OBJECT *Obj, 387 ACPI_OPERAND_OBJECT **InternalObj); 388 389ACPI_STATUS 390AcpiUtCopyISimpleToIsimple ( 391 ACPI_OPERAND_OBJECT *SourceObj, 392 ACPI_OPERAND_OBJECT *DestObj); 393 394ACPI_STATUS 395AcpiUtCopyIobjectToIobject ( 396 ACPI_OPERAND_OBJECT *SourceDesc, 397 ACPI_OPERAND_OBJECT **DestDesc, 398 ACPI_WALK_STATE *WalkState); 399 400 401/* 402 * utcreate - Object creation 403 */ 404ACPI_STATUS 405AcpiUtUpdateObjectReference ( 406 ACPI_OPERAND_OBJECT *Object, 407 UINT16 Action); 408 409 410/* 411 * utdebug - Debug interfaces 412 */ 413void 414AcpiUtInitStackPtrTrace ( 415 void); 416 417void 418AcpiUtTrackStackPtr ( 419 void); 420 421void 422AcpiUtTrace ( 423 UINT32 LineNumber, 424 const char *FunctionName, 425 const char *ModuleName, 426 UINT32 ComponentId); 427 428void 429AcpiUtTracePtr ( 430 UINT32 LineNumber, 431 const char *FunctionName, 432 const char *ModuleName, 433 UINT32 ComponentId, 434 void *Pointer); 435 436void 437AcpiUtTraceU32 ( 438 UINT32 LineNumber, 439 const char *FunctionName, 440 const char *ModuleName, 441 UINT32 ComponentId, 442 UINT32 Integer); 443 444void 445AcpiUtTraceStr ( 446 UINT32 LineNumber, 447 const char *FunctionName, 448 const char *ModuleName, 449 UINT32 ComponentId, 450 char *String); 451 452void 453AcpiUtExit ( 454 UINT32 LineNumber, 455 const char *FunctionName, 456 const char *ModuleName, 457 UINT32 ComponentId); 458 459void 460AcpiUtStatusExit ( 461 UINT32 LineNumber, 462 const char *FunctionName, 463 const char *ModuleName, 464 UINT32 ComponentId, 465 ACPI_STATUS Status); 466 467void 468AcpiUtValueExit ( 469 UINT32 LineNumber, 470 const char *FunctionName, 471 const char *ModuleName, 472 UINT32 ComponentId, 473 ACPI_INTEGER Value); 474 475void 476AcpiUtPtrExit ( 477 UINT32 LineNumber, 478 const char *FunctionName, 479 const char *ModuleName, 480 UINT32 ComponentId, 481 UINT8 *Ptr); 482 483void 484AcpiUtDumpBuffer ( 485 UINT8 *Buffer, 486 UINT32 Count, 487 UINT32 Display, 488 UINT32 componentId); 489 490void 491AcpiUtDumpBuffer2 ( 492 UINT8 *Buffer, 493 UINT32 Count, 494 UINT32 Display); 495 496void 497AcpiUtReportError ( 498 char *ModuleName, 499 UINT32 LineNumber); 500 501void 502AcpiUtReportInfo ( 503 char *ModuleName, 504 UINT32 LineNumber); 505 506void 507AcpiUtReportWarning ( 508 char *ModuleName, 509 UINT32 LineNumber); 510 511/* 512 * utdelete - Object deletion and reference counts 513 */ 514void 515AcpiUtAddReference ( 516 ACPI_OPERAND_OBJECT *Object); 517 518void 519AcpiUtRemoveReference ( 520 ACPI_OPERAND_OBJECT *Object); 521 522void 523AcpiUtDeleteInternalPackageObject ( 524 ACPI_OPERAND_OBJECT *Object); 525 526void 527AcpiUtDeleteInternalSimpleObject ( 528 ACPI_OPERAND_OBJECT *Object); 529 530void 531AcpiUtDeleteInternalObjectList ( 532 ACPI_OPERAND_OBJECT **ObjList); 533 534 535/* 536 * uteval - object evaluation 537 */ 538ACPI_STATUS 539AcpiUtOsiImplementation ( 540 ACPI_WALK_STATE *WalkState); 541 542ACPI_STATUS 543AcpiUtEvaluateObject ( 544 ACPI_NAMESPACE_NODE *PrefixNode, 545 char *Path, 546 UINT32 ExpectedReturnBtypes, 547 ACPI_OPERAND_OBJECT **ReturnDesc); 548 549ACPI_STATUS 550AcpiUtEvaluateNumericObject ( 551 char *ObjectName, 552 ACPI_NAMESPACE_NODE *DeviceNode, 553 ACPI_INTEGER *Address); 554 555ACPI_STATUS 556AcpiUtExecute_HID ( 557 ACPI_NAMESPACE_NODE *DeviceNode, 558 ACPI_DEVICE_ID *Hid); 559 560ACPI_STATUS 561AcpiUtExecute_CID ( 562 ACPI_NAMESPACE_NODE *DeviceNode, 563 ACPI_COMPATIBLE_ID_LIST **ReturnCidList); 564 565ACPI_STATUS 566AcpiUtExecute_STA ( 567 ACPI_NAMESPACE_NODE *DeviceNode, 568 UINT32 *StatusFlags); 569 570ACPI_STATUS 571AcpiUtExecute_UID ( 572 ACPI_NAMESPACE_NODE *DeviceNode, 573 ACPI_DEVICE_ID *Uid); 574 575ACPI_STATUS 576AcpiUtExecute_Sxds ( 577 ACPI_NAMESPACE_NODE *DeviceNode, 578 UINT8 *Highest); 579 580/* 581 * utlock - reader/writer locks 582 */ 583ACPI_STATUS 584AcpiUtCreateRwLock ( 585 ACPI_RW_LOCK *Lock); 586 587void 588AcpiUtDeleteRwLock ( 589 ACPI_RW_LOCK *Lock); 590 591ACPI_STATUS 592AcpiUtAcquireReadLock ( 593 ACPI_RW_LOCK *Lock); 594 595ACPI_STATUS 596AcpiUtReleaseReadLock ( 597 ACPI_RW_LOCK *Lock); 598 599ACPI_STATUS 600AcpiUtAcquireWriteLock ( 601 ACPI_RW_LOCK *Lock); 602 603void 604AcpiUtReleaseWriteLock ( 605 ACPI_RW_LOCK *Lock); 606 607 608/* 609 * utobject - internal object create/delete/cache routines 610 */ 611ACPI_OPERAND_OBJECT * 612AcpiUtCreateInternalObjectDbg ( 613 const char *ModuleName, 614 UINT32 LineNumber, 615 UINT32 ComponentId, 616 ACPI_OBJECT_TYPE Type); 617 618void * 619AcpiUtAllocateObjectDescDbg ( 620 const char *ModuleName, 621 UINT32 LineNumber, 622 UINT32 ComponentId); 623 624#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) 625#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) 626 627void 628AcpiUtDeleteObjectDesc ( 629 ACPI_OPERAND_OBJECT *Object); 630 631BOOLEAN 632AcpiUtValidInternalObject ( 633 void *Object); 634 635ACPI_OPERAND_OBJECT * 636AcpiUtCreatePackageObject ( 637 UINT32 Count); 638 639ACPI_OPERAND_OBJECT * 640AcpiUtCreateBufferObject ( 641 ACPI_SIZE BufferSize); 642 643ACPI_OPERAND_OBJECT * 644AcpiUtCreateStringObject ( 645 ACPI_SIZE StringSize); 646 647ACPI_STATUS 648AcpiUtGetObjectSize( 649 ACPI_OPERAND_OBJECT *Obj, 650 ACPI_SIZE *ObjLength); 651 652 653/* 654 * utstate - Generic state creation/cache routines 655 */ 656void 657AcpiUtPushGenericState ( 658 ACPI_GENERIC_STATE **ListHead, 659 ACPI_GENERIC_STATE *State); 660 661ACPI_GENERIC_STATE * 662AcpiUtPopGenericState ( 663 ACPI_GENERIC_STATE **ListHead); 664 665 666ACPI_GENERIC_STATE * 667AcpiUtCreateGenericState ( 668 void); 669 670ACPI_THREAD_STATE * 671AcpiUtCreateThreadState ( 672 void); 673 674ACPI_GENERIC_STATE * 675AcpiUtCreateUpdateState ( 676 ACPI_OPERAND_OBJECT *Object, 677 UINT16 Action); 678 679ACPI_GENERIC_STATE * 680AcpiUtCreatePkgState ( 681 void *InternalObject, 682 void *ExternalObject, 683 UINT16 Index); 684 685ACPI_STATUS 686AcpiUtCreateUpdateStateAndPush ( 687 ACPI_OPERAND_OBJECT *Object, 688 UINT16 Action, 689 ACPI_GENERIC_STATE **StateList); 690 691ACPI_STATUS 692AcpiUtCreatePkgStateAndPush ( 693 void *InternalObject, 694 void *ExternalObject, 695 UINT16 Index, 696 ACPI_GENERIC_STATE **StateList); 697 698ACPI_GENERIC_STATE * 699AcpiUtCreateControlState ( 700 void); 701 702void 703AcpiUtDeleteGenericState ( 704 ACPI_GENERIC_STATE *State); 705 706 707/* 708 * utmath 709 */ 710ACPI_STATUS 711AcpiUtDivide ( 712 ACPI_INTEGER InDividend, 713 ACPI_INTEGER InDivisor, 714 ACPI_INTEGER *OutQuotient, 715 ACPI_INTEGER *OutRemainder); 716 717ACPI_STATUS 718AcpiUtShortDivide ( 719 ACPI_INTEGER InDividend, 720 UINT32 Divisor, 721 ACPI_INTEGER *OutQuotient, 722 UINT32 *OutRemainder); 723 724/* 725 * utmisc 726 */ 727const char * 728AcpiUtValidateException ( 729 ACPI_STATUS Status); 730 731BOOLEAN 732AcpiUtIsAmlTable ( 733 ACPI_TABLE_HEADER *Table); 734 735ACPI_STATUS 736AcpiUtAllocateOwnerId ( 737 ACPI_OWNER_ID *OwnerId); 738 739void 740AcpiUtReleaseOwnerId ( 741 ACPI_OWNER_ID *OwnerId); 742 743ACPI_STATUS 744AcpiUtWalkPackageTree ( 745 ACPI_OPERAND_OBJECT *SourceObject, 746 void *TargetObject, 747 ACPI_PKG_CALLBACK WalkCallback, 748 void *Context); 749 750void 751AcpiUtStrupr ( 752 char *SrcString); 753 754void 755AcpiUtPrintString ( 756 char *String, 757 UINT8 MaxLength); 758 759BOOLEAN 760AcpiUtValidAcpiName ( 761 UINT32 Name); 762 763void 764AcpiUtRepairName ( 765 char *Name); 766 767BOOLEAN 768AcpiUtValidAcpiChar ( 769 char Character, 770 UINT32 Position); 771 772ACPI_STATUS 773AcpiUtStrtoul64 ( 774 char *String, 775 UINT32 Base, 776 ACPI_INTEGER *RetInteger); 777 778/* Values for Base above (16=Hex, 10=Decimal) */ 779 780#define ACPI_ANY_BASE 0 781 782UINT32 783AcpiUtDwordByteSwap ( 784 UINT32 Value); 785 786void 787AcpiUtSetIntegerWidth ( 788 UINT8 Revision); 789 790#ifdef ACPI_DEBUG_OUTPUT 791void 792AcpiUtDisplayInitPathname ( 793 UINT8 Type, 794 ACPI_NAMESPACE_NODE *ObjHandle, 795 char *Path); 796#endif 797 798 799/* 800 * utresrc 801 */ 802ACPI_STATUS 803AcpiUtWalkAmlResources ( 804 UINT8 *Aml, 805 ACPI_SIZE AmlLength, 806 ACPI_WALK_AML_CALLBACK UserFunction, 807 void *Context); 808 809ACPI_STATUS 810AcpiUtValidateResource ( 811 void *Aml, 812 UINT8 *ReturnIndex); 813 814UINT32 815AcpiUtGetDescriptorLength ( 816 void *Aml); 817 818UINT16 819AcpiUtGetResourceLength ( 820 void *Aml); 821 822UINT8 823AcpiUtGetResourceHeaderLength ( 824 void *Aml); 825 826UINT8 827AcpiUtGetResourceType ( 828 void *Aml); 829 830ACPI_STATUS 831AcpiUtGetResourceEndTag ( 832 ACPI_OPERAND_OBJECT *ObjDesc, 833 UINT8 **EndTag); 834 835 836/* 837 * utmutex - mutex support 838 */ 839ACPI_STATUS 840AcpiUtMutexInitialize ( 841 void); 842 843void 844AcpiUtMutexTerminate ( 845 void); 846 847ACPI_STATUS 848AcpiUtAcquireMutex ( 849 ACPI_MUTEX_HANDLE MutexId); 850 851ACPI_STATUS 852AcpiUtReleaseMutex ( 853 ACPI_MUTEX_HANDLE MutexId); 854 855 856/* 857 * utalloc - memory allocation and object caching 858 */ 859ACPI_STATUS 860AcpiUtCreateCaches ( 861 void); 862 863ACPI_STATUS 864AcpiUtDeleteCaches ( 865 void); 866 867ACPI_STATUS 868AcpiUtValidateBuffer ( 869 ACPI_BUFFER *Buffer); 870 871ACPI_STATUS 872AcpiUtInitializeBuffer ( 873 ACPI_BUFFER *Buffer, 874 ACPI_SIZE RequiredLength); 875 876void * 877AcpiUtAllocate ( 878 ACPI_SIZE Size, 879 UINT32 Component, 880 const char *Module, 881 UINT32 Line); 882 883void * 884AcpiUtAllocateZeroed ( 885 ACPI_SIZE Size, 886 UINT32 Component, 887 const char *Module, 888 UINT32 Line); 889 890#ifdef ACPI_DBG_TRACK_ALLOCATIONS 891void * 892AcpiUtAllocateAndTrack ( 893 ACPI_SIZE Size, 894 UINT32 Component, 895 const char *Module, 896 UINT32 Line); 897 898void * 899AcpiUtAllocateZeroedAndTrack ( 900 ACPI_SIZE Size, 901 UINT32 Component, 902 const char *Module, 903 UINT32 Line); 904 905void 906AcpiUtFreeAndTrack ( 907 void *Address, 908 UINT32 Component, 909 const char *Module, 910 UINT32 Line); 911 912void 913AcpiUtDumpAllocationInfo ( 914 void); 915 916void 917AcpiUtDumpAllocations ( 918 UINT32 Component, 919 const char *Module); 920 921ACPI_STATUS 922AcpiUtCreateList ( 923 char *ListName, 924 UINT16 ObjectSize, 925 ACPI_MEMORY_LIST **ReturnCache); 926 927 928#endif 929 930#endif /* _ACUTILS_H */ 931