acutils.h revision 138287
1/****************************************************************************** 2 * 3 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 4 * $Revision: 164 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#ifndef _ACUTILS_H 118#define _ACUTILS_H 119 120 121typedef 122ACPI_STATUS (*ACPI_PKG_CALLBACK) ( 123 UINT8 ObjectType, 124 ACPI_OPERAND_OBJECT *SourceObject, 125 ACPI_GENERIC_STATE *State, 126 void *Context); 127 128ACPI_STATUS 129AcpiUtWalkPackageTree ( 130 ACPI_OPERAND_OBJECT *SourceObject, 131 void *TargetObject, 132 ACPI_PKG_CALLBACK WalkCallback, 133 void *Context); 134 135typedef struct acpi_pkg_info 136{ 137 UINT8 *FreeSpace; 138 ACPI_SIZE Length; 139 UINT32 ObjectSpace; 140 UINT32 NumPackages; 141 142} ACPI_PKG_INFO; 143 144#define REF_INCREMENT (UINT16) 0 145#define REF_DECREMENT (UINT16) 1 146#define REF_FORCE_DELETE (UINT16) 2 147 148/* AcpiUtDumpBuffer */ 149 150#define DB_BYTE_DISPLAY 1 151#define DB_WORD_DISPLAY 2 152#define DB_DWORD_DISPLAY 4 153#define DB_QWORD_DISPLAY 8 154 155 156/* Global initialization interfaces */ 157 158void 159AcpiUtInitGlobals ( 160 void); 161 162void 163AcpiUtTerminate ( 164 void); 165 166 167/* 168 * UtInit - miscellaneous initialization and shutdown 169 */ 170 171ACPI_STATUS 172AcpiUtHardwareInitialize ( 173 void); 174 175void 176AcpiUtSubsystemShutdown ( 177 void); 178 179ACPI_STATUS 180AcpiUtValidateFadt ( 181 void); 182 183/* 184 * UtGlobal - Global data structures and procedures 185 */ 186 187#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 188 189char * 190AcpiUtGetMutexName ( 191 UINT32 MutexId); 192 193#endif 194 195char * 196AcpiUtGetTypeName ( 197 ACPI_OBJECT_TYPE Type); 198 199char * 200AcpiUtGetNodeName ( 201 void *Object); 202 203char * 204AcpiUtGetDescriptorName ( 205 void *Object); 206 207char * 208AcpiUtGetObjectTypeName ( 209 ACPI_OPERAND_OBJECT *ObjDesc); 210 211char * 212AcpiUtGetRegionName ( 213 UINT8 SpaceId); 214 215char * 216AcpiUtGetEventName ( 217 UINT32 EventId); 218 219char 220AcpiUtHexToAsciiChar ( 221 ACPI_INTEGER Integer, 222 UINT32 Position); 223 224BOOLEAN 225AcpiUtValidObjectType ( 226 ACPI_OBJECT_TYPE Type); 227 228ACPI_OWNER_ID 229AcpiUtAllocateOwnerId ( 230 UINT32 IdType); 231 232 233/* 234 * UtClib - Local implementations of C library functions 235 */ 236 237#ifndef ACPI_USE_SYSTEM_CLIBRARY 238 239ACPI_SIZE 240AcpiUtStrlen ( 241 const char *String); 242 243char * 244AcpiUtStrcpy ( 245 char *DstString, 246 const char *SrcString); 247 248char * 249AcpiUtStrncpy ( 250 char *DstString, 251 const char *SrcString, 252 ACPI_SIZE Count); 253 254int 255AcpiUtMemcmp ( 256 const char *Buffer1, 257 const char *Buffer2, 258 ACPI_SIZE Count); 259 260int 261AcpiUtStrncmp ( 262 const char *String1, 263 const char *String2, 264 ACPI_SIZE Count); 265 266int 267AcpiUtStrcmp ( 268 const char *String1, 269 const char *String2); 270 271char * 272AcpiUtStrcat ( 273 char *DstString, 274 const char *SrcString); 275 276char * 277AcpiUtStrncat ( 278 char *DstString, 279 const char *SrcString, 280 ACPI_SIZE Count); 281 282UINT32 283AcpiUtStrtoul ( 284 const char *String, 285 char **Terminator, 286 UINT32 Base); 287 288char * 289AcpiUtStrstr ( 290 char *String1, 291 char *String2); 292 293void * 294AcpiUtMemcpy ( 295 void *Dest, 296 const void *Src, 297 ACPI_SIZE Count); 298 299void * 300AcpiUtMemset ( 301 void *Dest, 302 ACPI_NATIVE_UINT Value, 303 ACPI_SIZE Count); 304 305int 306AcpiUtToUpper ( 307 int c); 308 309int 310AcpiUtToLower ( 311 int c); 312 313extern const UINT8 _acpi_ctype[]; 314 315#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 316#define _ACPI_XS 0x40 /* extra space */ 317#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 318#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 319#define _ACPI_DI 0x04 /* '0'-'9' */ 320#define _ACPI_LO 0x02 /* 'a'-'z' */ 321#define _ACPI_PU 0x10 /* punctuation */ 322#define _ACPI_SP 0x08 /* space */ 323#define _ACPI_UP 0x01 /* 'A'-'Z' */ 324#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 325 326#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 327#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 328#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 329#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 330#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 331#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 332#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 333#define ACPI_IS_ASCII(c) ((c) < 0x80) 334 335#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 336 337/* 338 * UtCopy - Object construction and conversion interfaces 339 */ 340 341ACPI_STATUS 342AcpiUtBuildSimpleObject( 343 ACPI_OPERAND_OBJECT *Obj, 344 ACPI_OBJECT *UserObj, 345 UINT8 *DataSpace, 346 UINT32 *BufferSpaceUsed); 347 348ACPI_STATUS 349AcpiUtBuildPackageObject ( 350 ACPI_OPERAND_OBJECT *Obj, 351 UINT8 *Buffer, 352 UINT32 *SpaceUsed); 353 354ACPI_STATUS 355AcpiUtCopyIelementToEelement ( 356 UINT8 ObjectType, 357 ACPI_OPERAND_OBJECT *SourceObject, 358 ACPI_GENERIC_STATE *State, 359 void *Context); 360 361ACPI_STATUS 362AcpiUtCopyIelementToIelement ( 363 UINT8 ObjectType, 364 ACPI_OPERAND_OBJECT *SourceObject, 365 ACPI_GENERIC_STATE *State, 366 void *Context); 367 368ACPI_STATUS 369AcpiUtCopyIobjectToEobject ( 370 ACPI_OPERAND_OBJECT *Obj, 371 ACPI_BUFFER *RetBuffer); 372 373ACPI_STATUS 374AcpiUtCopyEsimpleToIsimple( 375 ACPI_OBJECT *UserObj, 376 ACPI_OPERAND_OBJECT **ReturnObj); 377 378ACPI_STATUS 379AcpiUtCopyEobjectToIobject ( 380 ACPI_OBJECT *Obj, 381 ACPI_OPERAND_OBJECT **InternalObj); 382 383ACPI_STATUS 384AcpiUtCopyISimpleToIsimple ( 385 ACPI_OPERAND_OBJECT *SourceObj, 386 ACPI_OPERAND_OBJECT *DestObj); 387 388ACPI_STATUS 389AcpiUtCopyIpackageToIpackage ( 390 ACPI_OPERAND_OBJECT *SourceObj, 391 ACPI_OPERAND_OBJECT *DestObj, 392 ACPI_WALK_STATE *WalkState); 393 394ACPI_STATUS 395AcpiUtCopySimpleObject ( 396 ACPI_OPERAND_OBJECT *SourceDesc, 397 ACPI_OPERAND_OBJECT *DestDesc); 398 399ACPI_STATUS 400AcpiUtCopyIobjectToIobject ( 401 ACPI_OPERAND_OBJECT *SourceDesc, 402 ACPI_OPERAND_OBJECT **DestDesc, 403 ACPI_WALK_STATE *WalkState); 404 405 406/* 407 * UtCreate - Object creation 408 */ 409 410ACPI_STATUS 411AcpiUtUpdateObjectReference ( 412 ACPI_OPERAND_OBJECT *Object, 413 UINT16 Action); 414 415 416/* 417 * UtDebug - Debug interfaces 418 */ 419 420void 421AcpiUtInitStackPtrTrace ( 422 void); 423 424void 425AcpiUtTrackStackPtr ( 426 void); 427 428void 429AcpiUtTrace ( 430 UINT32 LineNumber, 431 ACPI_DEBUG_PRINT_INFO *DbgInfo); 432 433void 434AcpiUtTracePtr ( 435 UINT32 LineNumber, 436 ACPI_DEBUG_PRINT_INFO *DbgInfo, 437 void *Pointer); 438 439void 440AcpiUtTraceU32 ( 441 UINT32 LineNumber, 442 ACPI_DEBUG_PRINT_INFO *DbgInfo, 443 UINT32 Integer); 444 445void 446AcpiUtTraceStr ( 447 UINT32 LineNumber, 448 ACPI_DEBUG_PRINT_INFO *DbgInfo, 449 char *String); 450 451void 452AcpiUtExit ( 453 UINT32 LineNumber, 454 ACPI_DEBUG_PRINT_INFO *DbgInfo); 455 456void 457AcpiUtStatusExit ( 458 UINT32 LineNumber, 459 ACPI_DEBUG_PRINT_INFO *DbgInfo, 460 ACPI_STATUS Status); 461 462void 463AcpiUtValueExit ( 464 UINT32 LineNumber, 465 ACPI_DEBUG_PRINT_INFO *DbgInfo, 466 ACPI_INTEGER Value); 467 468void 469AcpiUtPtrExit ( 470 UINT32 LineNumber, 471 ACPI_DEBUG_PRINT_INFO *DbgInfo, 472 UINT8 *Ptr); 473 474void 475AcpiUtReportInfo ( 476 char *ModuleName, 477 UINT32 LineNumber, 478 UINT32 ComponentId); 479 480void 481AcpiUtReportError ( 482 char *ModuleName, 483 UINT32 LineNumber, 484 UINT32 ComponentId); 485 486void 487AcpiUtReportWarning ( 488 char *ModuleName, 489 UINT32 LineNumber, 490 UINT32 ComponentId); 491 492void 493AcpiUtDumpBuffer ( 494 UINT8 *Buffer, 495 UINT32 Count, 496 UINT32 Display, 497 UINT32 componentId); 498 499void ACPI_INTERNAL_VAR_XFACE 500AcpiUtDebugPrint ( 501 UINT32 RequestedDebugLevel, 502 UINT32 LineNumber, 503 ACPI_DEBUG_PRINT_INFO *DbgInfo, 504 char *Format, 505 ...) ACPI_PRINTF_LIKE_FUNC; 506 507void ACPI_INTERNAL_VAR_XFACE 508AcpiUtDebugPrintRaw ( 509 UINT32 RequestedDebugLevel, 510 UINT32 LineNumber, 511 ACPI_DEBUG_PRINT_INFO *DbgInfo, 512 char *Format, 513 ...) ACPI_PRINTF_LIKE_FUNC; 514 515 516/* 517 * UtDelete - Object deletion 518 */ 519 520void 521AcpiUtDeleteInternalObj ( 522 ACPI_OPERAND_OBJECT *Object); 523 524void 525AcpiUtDeleteInternalPackageObject ( 526 ACPI_OPERAND_OBJECT *Object); 527 528void 529AcpiUtDeleteInternalSimpleObject ( 530 ACPI_OPERAND_OBJECT *Object); 531 532void 533AcpiUtDeleteInternalObjectList ( 534 ACPI_OPERAND_OBJECT **ObjList); 535 536 537/* 538 * UtEval - object evaluation 539 */ 540 541/* Method name strings */ 542 543#define METHOD_NAME__HID "_HID" 544#define METHOD_NAME__CID "_CID" 545#define METHOD_NAME__UID "_UID" 546#define METHOD_NAME__ADR "_ADR" 547#define METHOD_NAME__STA "_STA" 548#define METHOD_NAME__REG "_REG" 549#define METHOD_NAME__SEG "_SEG" 550#define METHOD_NAME__BBN "_BBN" 551#define METHOD_NAME__PRT "_PRT" 552#define METHOD_NAME__CRS "_CRS" 553#define METHOD_NAME__PRS "_PRS" 554#define METHOD_NAME__PRW "_PRW" 555 556 557ACPI_STATUS 558AcpiUtOsiImplementation ( 559 ACPI_WALK_STATE *WalkState); 560 561ACPI_STATUS 562AcpiUtEvaluateObject ( 563 ACPI_NAMESPACE_NODE *PrefixNode, 564 char *Path, 565 UINT32 ExpectedReturnBtypes, 566 ACPI_OPERAND_OBJECT **ReturnDesc); 567 568ACPI_STATUS 569AcpiUtEvaluateNumericObject ( 570 char *ObjectName, 571 ACPI_NAMESPACE_NODE *DeviceNode, 572 ACPI_INTEGER *Address); 573 574ACPI_STATUS 575AcpiUtExecute_HID ( 576 ACPI_NAMESPACE_NODE *DeviceNode, 577 ACPI_DEVICE_ID *Hid); 578 579ACPI_STATUS 580AcpiUtExecute_CID ( 581 ACPI_NAMESPACE_NODE *DeviceNode, 582 ACPI_COMPATIBLE_ID_LIST **ReturnCidList); 583 584ACPI_STATUS 585AcpiUtExecute_STA ( 586 ACPI_NAMESPACE_NODE *DeviceNode, 587 UINT32 *StatusFlags); 588 589ACPI_STATUS 590AcpiUtExecute_UID ( 591 ACPI_NAMESPACE_NODE *DeviceNode, 592 ACPI_DEVICE_ID *Uid); 593 594ACPI_STATUS 595AcpiUtExecute_Sxds ( 596 ACPI_NAMESPACE_NODE *DeviceNode, 597 UINT8 *Highest); 598 599/* 600 * UtMutex - mutual exclusion interfaces 601 */ 602 603ACPI_STATUS 604AcpiUtMutexInitialize ( 605 void); 606 607void 608AcpiUtMutexTerminate ( 609 void); 610 611ACPI_STATUS 612AcpiUtCreateMutex ( 613 ACPI_MUTEX_HANDLE MutexId); 614 615ACPI_STATUS 616AcpiUtDeleteMutex ( 617 ACPI_MUTEX_HANDLE MutexId); 618 619ACPI_STATUS 620AcpiUtAcquireMutex ( 621 ACPI_MUTEX_HANDLE MutexId); 622 623ACPI_STATUS 624AcpiUtReleaseMutex ( 625 ACPI_MUTEX_HANDLE MutexId); 626 627 628/* 629 * UtObject - internal object create/delete/cache routines 630 */ 631 632ACPI_OPERAND_OBJECT * 633AcpiUtCreateInternalObjectDbg ( 634 char *ModuleName, 635 UINT32 LineNumber, 636 UINT32 ComponentId, 637 ACPI_OBJECT_TYPE Type); 638 639void * 640AcpiUtAllocateObjectDescDbg ( 641 char *ModuleName, 642 UINT32 LineNumber, 643 UINT32 ComponentId); 644 645#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_THIS_MODULE,__LINE__,_COMPONENT,t) 646#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_THIS_MODULE,__LINE__,_COMPONENT) 647 648void 649AcpiUtDeleteObjectDesc ( 650 ACPI_OPERAND_OBJECT *Object); 651 652BOOLEAN 653AcpiUtValidInternalObject ( 654 void *Object); 655 656ACPI_OPERAND_OBJECT * 657AcpiUtCreateBufferObject ( 658 ACPI_SIZE BufferSize); 659 660ACPI_OPERAND_OBJECT * 661AcpiUtCreateStringObject ( 662 ACPI_SIZE StringSize); 663 664 665/* 666 * UtRefCnt - Object reference count management 667 */ 668 669void 670AcpiUtAddReference ( 671 ACPI_OPERAND_OBJECT *Object); 672 673void 674AcpiUtRemoveReference ( 675 ACPI_OPERAND_OBJECT *Object); 676 677/* 678 * UtSize - Object size routines 679 */ 680 681ACPI_STATUS 682AcpiUtGetSimpleObjectSize ( 683 ACPI_OPERAND_OBJECT *Obj, 684 ACPI_SIZE *ObjLength); 685 686ACPI_STATUS 687AcpiUtGetPackageObjectSize ( 688 ACPI_OPERAND_OBJECT *Obj, 689 ACPI_SIZE *ObjLength); 690 691ACPI_STATUS 692AcpiUtGetObjectSize( 693 ACPI_OPERAND_OBJECT *Obj, 694 ACPI_SIZE *ObjLength); 695 696ACPI_STATUS 697AcpiUtGetElementLength ( 698 UINT8 ObjectType, 699 ACPI_OPERAND_OBJECT *SourceObject, 700 ACPI_GENERIC_STATE *State, 701 void *Context); 702 703 704/* 705 * UtState - Generic state creation/cache routines 706 */ 707 708void 709AcpiUtPushGenericState ( 710 ACPI_GENERIC_STATE **ListHead, 711 ACPI_GENERIC_STATE *State); 712 713ACPI_GENERIC_STATE * 714AcpiUtPopGenericState ( 715 ACPI_GENERIC_STATE **ListHead); 716 717 718ACPI_GENERIC_STATE * 719AcpiUtCreateGenericState ( 720 void); 721 722ACPI_THREAD_STATE * 723AcpiUtCreateThreadState ( 724 void); 725 726ACPI_GENERIC_STATE * 727AcpiUtCreateUpdateState ( 728 ACPI_OPERAND_OBJECT *Object, 729 UINT16 Action); 730 731ACPI_GENERIC_STATE * 732AcpiUtCreatePkgState ( 733 void *InternalObject, 734 void *ExternalObject, 735 UINT16 Index); 736 737ACPI_STATUS 738AcpiUtCreateUpdateStateAndPush ( 739 ACPI_OPERAND_OBJECT *Object, 740 UINT16 Action, 741 ACPI_GENERIC_STATE **StateList); 742 743ACPI_STATUS 744AcpiUtCreatePkgStateAndPush ( 745 void *InternalObject, 746 void *ExternalObject, 747 UINT16 Index, 748 ACPI_GENERIC_STATE **StateList); 749 750ACPI_GENERIC_STATE * 751AcpiUtCreateControlState ( 752 void); 753 754void 755AcpiUtDeleteGenericState ( 756 ACPI_GENERIC_STATE *State); 757 758void 759AcpiUtDeleteGenericStateCache ( 760 void); 761 762void 763AcpiUtDeleteObjectCache ( 764 void); 765 766/* 767 * utmisc 768 */ 769 770void 771AcpiUtPrintString ( 772 char *String, 773 UINT8 MaxLength); 774 775ACPI_STATUS 776AcpiUtDivide ( 777 ACPI_INTEGER InDividend, 778 ACPI_INTEGER InDivisor, 779 ACPI_INTEGER *OutQuotient, 780 ACPI_INTEGER *OutRemainder); 781 782ACPI_STATUS 783AcpiUtShortDivide ( 784 ACPI_INTEGER InDividend, 785 UINT32 Divisor, 786 ACPI_INTEGER *OutQuotient, 787 UINT32 *OutRemainder); 788 789BOOLEAN 790AcpiUtValidAcpiName ( 791 UINT32 Name); 792 793BOOLEAN 794AcpiUtValidAcpiCharacter ( 795 char Character); 796 797ACPI_STATUS 798AcpiUtStrtoul64 ( 799 char *String, 800 UINT32 Base, 801 ACPI_INTEGER *RetInteger); 802 803/* Values for Base above (16=Hex, 10=Decimal) */ 804 805#define ACPI_ANY_BASE 0 806 807char * 808AcpiUtStrupr ( 809 char *SrcString); 810 811UINT8 * 812AcpiUtGetResourceEndTag ( 813 ACPI_OPERAND_OBJECT *ObjDesc); 814 815UINT8 816AcpiUtGenerateChecksum ( 817 UINT8 *Buffer, 818 UINT32 Length); 819 820UINT32 821AcpiUtDwordByteSwap ( 822 UINT32 Value); 823 824void 825AcpiUtSetIntegerWidth ( 826 UINT8 Revision); 827 828#ifdef ACPI_DEBUG_OUTPUT 829void 830AcpiUtDisplayInitPathname ( 831 UINT8 Type, 832 ACPI_NAMESPACE_NODE *ObjHandle, 833 char *Path); 834 835#endif 836 837 838/* 839 * Utalloc - memory allocation and object caching 840 */ 841 842void * 843AcpiUtAcquireFromCache ( 844 UINT32 ListId); 845 846void 847AcpiUtReleaseToCache ( 848 UINT32 ListId, 849 void *Object); 850 851void 852AcpiUtDeleteGenericCache ( 853 UINT32 ListId); 854 855ACPI_STATUS 856AcpiUtValidateBuffer ( 857 ACPI_BUFFER *Buffer); 858 859ACPI_STATUS 860AcpiUtInitializeBuffer ( 861 ACPI_BUFFER *Buffer, 862 ACPI_SIZE RequiredLength); 863 864 865/* Memory allocation functions */ 866 867void * 868AcpiUtAllocate ( 869 ACPI_SIZE Size, 870 UINT32 Component, 871 char *Module, 872 UINT32 Line); 873 874void * 875AcpiUtCallocate ( 876 ACPI_SIZE Size, 877 UINT32 Component, 878 char *Module, 879 UINT32 Line); 880 881 882#ifdef ACPI_DBG_TRACK_ALLOCATIONS 883 884void * 885AcpiUtAllocateAndTrack ( 886 ACPI_SIZE Size, 887 UINT32 Component, 888 char *Module, 889 UINT32 Line); 890 891void * 892AcpiUtCallocateAndTrack ( 893 ACPI_SIZE Size, 894 UINT32 Component, 895 char *Module, 896 UINT32 Line); 897 898void 899AcpiUtFreeAndTrack ( 900 void *Address, 901 UINT32 Component, 902 char *Module, 903 UINT32 Line); 904 905ACPI_DEBUG_MEM_BLOCK * 906AcpiUtFindAllocation ( 907 UINT32 ListId, 908 void *Allocation); 909 910ACPI_STATUS 911AcpiUtTrackAllocation ( 912 UINT32 ListId, 913 ACPI_DEBUG_MEM_BLOCK *Address, 914 ACPI_SIZE Size, 915 UINT8 AllocType, 916 UINT32 Component, 917 char *Module, 918 UINT32 Line); 919 920ACPI_STATUS 921AcpiUtRemoveAllocation ( 922 UINT32 ListId, 923 ACPI_DEBUG_MEM_BLOCK *Address, 924 UINT32 Component, 925 char *Module, 926 UINT32 Line); 927 928void 929AcpiUtDumpAllocationInfo ( 930 void); 931 932void 933AcpiUtDumpAllocations ( 934 UINT32 Component, 935 char *Module); 936#endif 937 938 939#endif /* _ACUTILS_H */ 940