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