acutils.h revision 104470
1/****************************************************************************** 2 * 3 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 4 * $Revision: 146 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2002, 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 128 129ACPI_STATUS 130AcpiUtWalkPackageTree ( 131 ACPI_OPERAND_OBJECT *SourceObject, 132 void *TargetObject, 133 ACPI_PKG_CALLBACK WalkCallback, 134 void *Context); 135 136 137typedef struct acpi_pkg_info 138{ 139 UINT8 *FreeSpace; 140 ACPI_SIZE Length; 141 UINT32 ObjectSpace; 142 UINT32 NumPackages; 143} ACPI_PKG_INFO; 144 145#define REF_INCREMENT (UINT16) 0 146#define REF_DECREMENT (UINT16) 1 147#define REF_FORCE_DELETE (UINT16) 2 148 149/* AcpiUtDumpBuffer */ 150 151#define DB_BYTE_DISPLAY 1 152#define DB_WORD_DISPLAY 2 153#define DB_DWORD_DISPLAY 4 154#define DB_QWORD_DISPLAY 8 155 156 157/* Global initialization interfaces */ 158 159void 160AcpiUtInitGlobals ( 161 void); 162 163void 164AcpiUtTerminate ( 165 void); 166 167 168/* 169 * UtInit - miscellaneous initialization and shutdown 170 */ 171 172ACPI_STATUS 173AcpiUtHardwareInitialize ( 174 void); 175 176void 177AcpiUtSubsystemShutdown ( 178 void); 179 180ACPI_STATUS 181AcpiUtValidateFadt ( 182 void); 183 184/* 185 * UtGlobal - Global data structures and procedures 186 */ 187 188#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 189 190NATIVE_CHAR * 191AcpiUtGetMutexName ( 192 UINT32 MutexId); 193 194#endif 195 196NATIVE_CHAR * 197AcpiUtGetTypeName ( 198 ACPI_OBJECT_TYPE Type); 199 200NATIVE_CHAR * 201AcpiUtGetObjectTypeName ( 202 ACPI_OPERAND_OBJECT *ObjDesc); 203 204NATIVE_CHAR * 205AcpiUtGetRegionName ( 206 UINT8 SpaceId); 207 208NATIVE_CHAR * 209AcpiUtGetEventName ( 210 UINT32 EventId); 211 212char 213AcpiUtHexToAsciiChar ( 214 ACPI_INTEGER Integer, 215 UINT32 Position); 216 217BOOLEAN 218AcpiUtValidObjectType ( 219 ACPI_OBJECT_TYPE Type); 220 221ACPI_OWNER_ID 222AcpiUtAllocateOwnerId ( 223 UINT32 IdType); 224 225 226/* 227 * UtClib - Local implementations of C library functions 228 */ 229 230#ifndef ACPI_USE_SYSTEM_CLIBRARY 231 232ACPI_SIZE 233AcpiUtStrlen ( 234 const NATIVE_CHAR *String); 235 236NATIVE_CHAR * 237AcpiUtStrcpy ( 238 NATIVE_CHAR *DstString, 239 const NATIVE_CHAR *SrcString); 240 241NATIVE_CHAR * 242AcpiUtStrncpy ( 243 NATIVE_CHAR *DstString, 244 const NATIVE_CHAR *SrcString, 245 ACPI_SIZE Count); 246 247int 248AcpiUtStrncmp ( 249 const NATIVE_CHAR *String1, 250 const NATIVE_CHAR *String2, 251 ACPI_SIZE Count); 252 253int 254AcpiUtStrcmp ( 255 const NATIVE_CHAR *String1, 256 const NATIVE_CHAR *String2); 257 258NATIVE_CHAR * 259AcpiUtStrcat ( 260 NATIVE_CHAR *DstString, 261 const NATIVE_CHAR *SrcString); 262 263NATIVE_CHAR * 264AcpiUtStrncat ( 265 NATIVE_CHAR *DstString, 266 const NATIVE_CHAR *SrcString, 267 ACPI_SIZE Count); 268 269UINT32 270AcpiUtStrtoul ( 271 const NATIVE_CHAR *String, 272 NATIVE_CHAR **Terminator, 273 UINT32 Base); 274 275NATIVE_CHAR * 276AcpiUtStrstr ( 277 NATIVE_CHAR *String1, 278 NATIVE_CHAR *String2); 279 280void * 281AcpiUtMemcpy ( 282 void *Dest, 283 const void *Src, 284 ACPI_SIZE Count); 285 286void * 287AcpiUtMemset ( 288 void *Dest, 289 NATIVE_UINT Value, 290 ACPI_SIZE Count); 291 292int 293AcpiUtToUpper ( 294 int c); 295 296int 297AcpiUtToLower ( 298 int c); 299 300extern const UINT8 _acpi_ctype[]; 301 302#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 303#define _ACPI_XS 0x40 /* extra space */ 304#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 305#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 306#define _ACPI_DI 0x04 /* '0'-'9' */ 307#define _ACPI_LO 0x02 /* 'a'-'z' */ 308#define _ACPI_PU 0x10 /* punctuation */ 309#define _ACPI_SP 0x08 /* space */ 310#define _ACPI_UP 0x01 /* 'A'-'Z' */ 311#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 312 313#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 314#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 315#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 316#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 317#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 318#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 319#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 320#define ACPI_IS_ASCII(c) ((c) < 0x80) 321 322#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 323 324/* 325 * UtCopy - Object construction and conversion interfaces 326 */ 327 328ACPI_STATUS 329AcpiUtBuildSimpleObject( 330 ACPI_OPERAND_OBJECT *Obj, 331 ACPI_OBJECT *UserObj, 332 UINT8 *DataSpace, 333 UINT32 *BufferSpaceUsed); 334 335ACPI_STATUS 336AcpiUtBuildPackageObject ( 337 ACPI_OPERAND_OBJECT *Obj, 338 UINT8 *Buffer, 339 UINT32 *SpaceUsed); 340 341ACPI_STATUS 342AcpiUtCopyIelementToEelement ( 343 UINT8 ObjectType, 344 ACPI_OPERAND_OBJECT *SourceObject, 345 ACPI_GENERIC_STATE *State, 346 void *Context); 347 348ACPI_STATUS 349AcpiUtCopyIelementToIelement ( 350 UINT8 ObjectType, 351 ACPI_OPERAND_OBJECT *SourceObject, 352 ACPI_GENERIC_STATE *State, 353 void *Context); 354 355ACPI_STATUS 356AcpiUtCopyIobjectToEobject ( 357 ACPI_OPERAND_OBJECT *Obj, 358 ACPI_BUFFER *RetBuffer); 359 360ACPI_STATUS 361AcpiUtCopyEsimpleToIsimple( 362 ACPI_OBJECT *UserObj, 363 ACPI_OPERAND_OBJECT **ReturnObj); 364 365ACPI_STATUS 366AcpiUtCopyEobjectToIobject ( 367 ACPI_OBJECT *Obj, 368 ACPI_OPERAND_OBJECT **InternalObj); 369 370ACPI_STATUS 371AcpiUtCopyISimpleToIsimple ( 372 ACPI_OPERAND_OBJECT *SourceObj, 373 ACPI_OPERAND_OBJECT *DestObj); 374 375ACPI_STATUS 376AcpiUtCopyIpackageToIpackage ( 377 ACPI_OPERAND_OBJECT *SourceObj, 378 ACPI_OPERAND_OBJECT *DestObj, 379 ACPI_WALK_STATE *WalkState); 380 381ACPI_STATUS 382AcpiUtCopySimpleObject ( 383 ACPI_OPERAND_OBJECT *SourceDesc, 384 ACPI_OPERAND_OBJECT *DestDesc); 385 386ACPI_STATUS 387AcpiUtCopyIobjectToIobject ( 388 ACPI_OPERAND_OBJECT *SourceDesc, 389 ACPI_OPERAND_OBJECT **DestDesc, 390 ACPI_WALK_STATE *WalkState); 391 392 393/* 394 * UtCreate - Object creation 395 */ 396 397ACPI_STATUS 398AcpiUtUpdateObjectReference ( 399 ACPI_OPERAND_OBJECT *Object, 400 UINT16 Action); 401 402 403/* 404 * UtDebug - Debug interfaces 405 */ 406 407void 408AcpiUtInitStackPtrTrace ( 409 void); 410 411void 412AcpiUtTrackStackPtr ( 413 void); 414 415void 416AcpiUtTrace ( 417 UINT32 LineNumber, 418 ACPI_DEBUG_PRINT_INFO *DbgInfo); 419 420void 421AcpiUtTracePtr ( 422 UINT32 LineNumber, 423 ACPI_DEBUG_PRINT_INFO *DbgInfo, 424 void *Pointer); 425 426void 427AcpiUtTraceU32 ( 428 UINT32 LineNumber, 429 ACPI_DEBUG_PRINT_INFO *DbgInfo, 430 UINT32 Integer); 431 432void 433AcpiUtTraceStr ( 434 UINT32 LineNumber, 435 ACPI_DEBUG_PRINT_INFO *DbgInfo, 436 NATIVE_CHAR *String); 437 438void 439AcpiUtExit ( 440 UINT32 LineNumber, 441 ACPI_DEBUG_PRINT_INFO *DbgInfo); 442 443void 444AcpiUtStatusExit ( 445 UINT32 LineNumber, 446 ACPI_DEBUG_PRINT_INFO *DbgInfo, 447 ACPI_STATUS Status); 448 449void 450AcpiUtValueExit ( 451 UINT32 LineNumber, 452 ACPI_DEBUG_PRINT_INFO *DbgInfo, 453 ACPI_INTEGER Value); 454 455void 456AcpiUtPtrExit ( 457 UINT32 LineNumber, 458 ACPI_DEBUG_PRINT_INFO *DbgInfo, 459 UINT8 *Ptr); 460 461void 462AcpiUtReportInfo ( 463 NATIVE_CHAR *ModuleName, 464 UINT32 LineNumber, 465 UINT32 ComponentId); 466 467void 468AcpiUtReportError ( 469 NATIVE_CHAR *ModuleName, 470 UINT32 LineNumber, 471 UINT32 ComponentId); 472 473void 474AcpiUtReportWarning ( 475 NATIVE_CHAR *ModuleName, 476 UINT32 LineNumber, 477 UINT32 ComponentId); 478 479void 480AcpiUtDumpBuffer ( 481 UINT8 *Buffer, 482 UINT32 Count, 483 UINT32 Display, 484 UINT32 componentId); 485 486void ACPI_INTERNAL_VAR_XFACE 487AcpiUtDebugPrint ( 488 UINT32 RequestedDebugLevel, 489 UINT32 LineNumber, 490 ACPI_DEBUG_PRINT_INFO *DbgInfo, 491 char *Format, 492 ...) ACPI_PRINTF_LIKE_FUNC; 493 494void ACPI_INTERNAL_VAR_XFACE 495AcpiUtDebugPrintRaw ( 496 UINT32 RequestedDebugLevel, 497 UINT32 LineNumber, 498 ACPI_DEBUG_PRINT_INFO *DbgInfo, 499 char *Format, 500 ...) ACPI_PRINTF_LIKE_FUNC; 501 502 503/* 504 * UtDelete - Object deletion 505 */ 506 507void 508AcpiUtDeleteInternalObj ( 509 ACPI_OPERAND_OBJECT *Object); 510 511void 512AcpiUtDeleteInternalPackageObject ( 513 ACPI_OPERAND_OBJECT *Object); 514 515void 516AcpiUtDeleteInternalSimpleObject ( 517 ACPI_OPERAND_OBJECT *Object); 518 519void 520AcpiUtDeleteInternalObjectList ( 521 ACPI_OPERAND_OBJECT **ObjList); 522 523 524/* 525 * UtEval - object evaluation 526 */ 527 528/* Method name strings */ 529 530#define METHOD_NAME__HID "_HID" 531#define METHOD_NAME__CID "_CID" 532#define METHOD_NAME__UID "_UID" 533#define METHOD_NAME__ADR "_ADR" 534#define METHOD_NAME__STA "_STA" 535#define METHOD_NAME__REG "_REG" 536#define METHOD_NAME__SEG "_SEG" 537#define METHOD_NAME__BBN "_BBN" 538#define METHOD_NAME__PRT "_PRT" 539 540 541ACPI_STATUS 542AcpiUtEvaluateNumericObject ( 543 NATIVE_CHAR *ObjectName, 544 ACPI_NAMESPACE_NODE *DeviceNode, 545 ACPI_INTEGER *Address); 546 547ACPI_STATUS 548AcpiUtExecute_HID ( 549 ACPI_NAMESPACE_NODE *DeviceNode, 550 ACPI_DEVICE_ID *Hid); 551 552ACPI_STATUS 553AcpiUtExecute_CID ( 554 ACPI_NAMESPACE_NODE *DeviceNode, 555 ACPI_DEVICE_ID *Cid); 556 557ACPI_STATUS 558AcpiUtExecute_STA ( 559 ACPI_NAMESPACE_NODE *DeviceNode, 560 UINT32 *StatusFlags); 561 562ACPI_STATUS 563AcpiUtExecute_UID ( 564 ACPI_NAMESPACE_NODE *DeviceNode, 565 ACPI_DEVICE_ID *Uid); 566 567 568/* 569 * UtMutex - mutual exclusion interfaces 570 */ 571 572ACPI_STATUS 573AcpiUtMutexInitialize ( 574 void); 575 576void 577AcpiUtMutexTerminate ( 578 void); 579 580ACPI_STATUS 581AcpiUtCreateMutex ( 582 ACPI_MUTEX_HANDLE MutexId); 583 584ACPI_STATUS 585AcpiUtDeleteMutex ( 586 ACPI_MUTEX_HANDLE MutexId); 587 588ACPI_STATUS 589AcpiUtAcquireMutex ( 590 ACPI_MUTEX_HANDLE MutexId); 591 592ACPI_STATUS 593AcpiUtReleaseMutex ( 594 ACPI_MUTEX_HANDLE MutexId); 595 596 597/* 598 * UtObject - internal object create/delete/cache routines 599 */ 600 601ACPI_OPERAND_OBJECT * 602AcpiUtCreateInternalObjectDbg ( 603 NATIVE_CHAR *ModuleName, 604 UINT32 LineNumber, 605 UINT32 ComponentId, 606 ACPI_OBJECT_TYPE Type); 607 608void * 609AcpiUtAllocateObjectDescDbg ( 610 NATIVE_CHAR *ModuleName, 611 UINT32 LineNumber, 612 UINT32 ComponentId); 613 614#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_THIS_MODULE,__LINE__,_COMPONENT,t) 615#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_THIS_MODULE,__LINE__,_COMPONENT) 616 617void 618AcpiUtDeleteObjectDesc ( 619 ACPI_OPERAND_OBJECT *Object); 620 621BOOLEAN 622AcpiUtValidInternalObject ( 623 void *Object); 624 625 626/* 627 * UtRefCnt - Object reference count management 628 */ 629 630void 631AcpiUtAddReference ( 632 ACPI_OPERAND_OBJECT *Object); 633 634void 635AcpiUtRemoveReference ( 636 ACPI_OPERAND_OBJECT *Object); 637 638/* 639 * UtSize - Object size routines 640 */ 641 642ACPI_STATUS 643AcpiUtGetSimpleObjectSize ( 644 ACPI_OPERAND_OBJECT *Obj, 645 ACPI_SIZE *ObjLength); 646 647ACPI_STATUS 648AcpiUtGetPackageObjectSize ( 649 ACPI_OPERAND_OBJECT *Obj, 650 ACPI_SIZE *ObjLength); 651 652ACPI_STATUS 653AcpiUtGetObjectSize( 654 ACPI_OPERAND_OBJECT *Obj, 655 ACPI_SIZE *ObjLength); 656 657ACPI_STATUS 658AcpiUtGetElementLength ( 659 UINT8 ObjectType, 660 ACPI_OPERAND_OBJECT *SourceObject, 661 ACPI_GENERIC_STATE *State, 662 void *Context); 663 664 665/* 666 * UtState - Generic state creation/cache routines 667 */ 668 669void 670AcpiUtPushGenericState ( 671 ACPI_GENERIC_STATE **ListHead, 672 ACPI_GENERIC_STATE *State); 673 674ACPI_GENERIC_STATE * 675AcpiUtPopGenericState ( 676 ACPI_GENERIC_STATE **ListHead); 677 678 679ACPI_GENERIC_STATE * 680AcpiUtCreateGenericState ( 681 void); 682 683ACPI_THREAD_STATE * 684AcpiUtCreateThreadState ( 685 void); 686 687ACPI_GENERIC_STATE * 688AcpiUtCreateUpdateState ( 689 ACPI_OPERAND_OBJECT *Object, 690 UINT16 Action); 691 692ACPI_GENERIC_STATE * 693AcpiUtCreatePkgState ( 694 void *InternalObject, 695 void *ExternalObject, 696 UINT16 Index); 697 698ACPI_STATUS 699AcpiUtCreateUpdateStateAndPush ( 700 ACPI_OPERAND_OBJECT *Object, 701 UINT16 Action, 702 ACPI_GENERIC_STATE **StateList); 703 704ACPI_STATUS 705AcpiUtCreatePkgStateAndPush ( 706 void *InternalObject, 707 void *ExternalObject, 708 UINT16 Index, 709 ACPI_GENERIC_STATE **StateList); 710 711ACPI_GENERIC_STATE * 712AcpiUtCreateControlState ( 713 void); 714 715void 716AcpiUtDeleteGenericState ( 717 ACPI_GENERIC_STATE *State); 718 719void 720AcpiUtDeleteGenericStateCache ( 721 void); 722 723void 724AcpiUtDeleteObjectCache ( 725 void); 726 727/* 728 * utmisc 729 */ 730 731ACPI_STATUS 732AcpiUtDivide ( 733 ACPI_INTEGER *InDividend, 734 ACPI_INTEGER *InDivisor, 735 ACPI_INTEGER *OutQuotient, 736 ACPI_INTEGER *OutRemainder); 737 738ACPI_STATUS 739AcpiUtShortDivide ( 740 ACPI_INTEGER *InDividend, 741 UINT32 Divisor, 742 ACPI_INTEGER *OutQuotient, 743 UINT32 *OutRemainder); 744 745BOOLEAN 746AcpiUtValidAcpiName ( 747 UINT32 Name); 748 749BOOLEAN 750AcpiUtValidAcpiCharacter ( 751 NATIVE_CHAR Character); 752 753ACPI_STATUS 754AcpiUtStrtoul64 ( 755 NATIVE_CHAR *String, 756 UINT32 Base, 757 ACPI_INTEGER *RetInteger); 758 759NATIVE_CHAR * 760AcpiUtStrupr ( 761 NATIVE_CHAR *SrcString); 762 763UINT8 * 764AcpiUtGetResourceEndTag ( 765 ACPI_OPERAND_OBJECT *ObjDesc); 766 767UINT8 768AcpiUtGenerateChecksum ( 769 UINT8 *Buffer, 770 UINT32 Length); 771 772UINT32 773AcpiUtDwordByteSwap ( 774 UINT32 Value); 775 776void 777AcpiUtSetIntegerWidth ( 778 UINT8 Revision); 779 780#ifdef ACPI_DEBUG_OUTPUT 781void 782AcpiUtDisplayInitPathname ( 783 ACPI_HANDLE ObjHandle, 784 char *Path); 785 786#endif 787 788 789/* 790 * Utalloc - memory allocation and object caching 791 */ 792 793void * 794AcpiUtAcquireFromCache ( 795 UINT32 ListId); 796 797void 798AcpiUtReleaseToCache ( 799 UINT32 ListId, 800 void *Object); 801 802void 803AcpiUtDeleteGenericCache ( 804 UINT32 ListId); 805 806ACPI_STATUS 807AcpiUtValidateBuffer ( 808 ACPI_BUFFER *Buffer); 809 810ACPI_STATUS 811AcpiUtInitializeBuffer ( 812 ACPI_BUFFER *Buffer, 813 ACPI_SIZE RequiredLength); 814 815 816/* Memory allocation functions */ 817 818void * 819AcpiUtAllocate ( 820 ACPI_SIZE Size, 821 UINT32 Component, 822 NATIVE_CHAR *Module, 823 UINT32 Line); 824 825void * 826AcpiUtCallocate ( 827 ACPI_SIZE Size, 828 UINT32 Component, 829 NATIVE_CHAR *Module, 830 UINT32 Line); 831 832 833#ifdef ACPI_DBG_TRACK_ALLOCATIONS 834 835void * 836AcpiUtAllocateAndTrack ( 837 ACPI_SIZE Size, 838 UINT32 Component, 839 NATIVE_CHAR *Module, 840 UINT32 Line); 841 842void * 843AcpiUtCallocateAndTrack ( 844 ACPI_SIZE Size, 845 UINT32 Component, 846 NATIVE_CHAR *Module, 847 UINT32 Line); 848 849void 850AcpiUtFreeAndTrack ( 851 void *Address, 852 UINT32 Component, 853 NATIVE_CHAR *Module, 854 UINT32 Line); 855 856ACPI_DEBUG_MEM_BLOCK * 857AcpiUtFindAllocation ( 858 UINT32 ListId, 859 void *Allocation); 860 861ACPI_STATUS 862AcpiUtTrackAllocation ( 863 UINT32 ListId, 864 ACPI_DEBUG_MEM_BLOCK *Address, 865 ACPI_SIZE Size, 866 UINT8 AllocType, 867 UINT32 Component, 868 NATIVE_CHAR *Module, 869 UINT32 Line); 870 871ACPI_STATUS 872AcpiUtRemoveAllocation ( 873 UINT32 ListId, 874 ACPI_DEBUG_MEM_BLOCK *Address, 875 UINT32 Component, 876 NATIVE_CHAR *Module, 877 UINT32 Line); 878 879void 880AcpiUtDumpAllocationInfo ( 881 void); 882 883void 884AcpiUtDumpAllocations ( 885 UINT32 Component, 886 NATIVE_CHAR *Module); 887#endif 888 889 890#endif /* _ACUTILS_H */ 891