acutils.h revision 210976
1/****************************************************************************** 2 * 3 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures 4 * 5 *****************************************************************************/ 6 7/****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. 12 * All rights reserved. 13 * 14 * 2. License 15 * 16 * 2.1. This is your license from Intel Corp. under its intellectual property 17 * rights. You may have additional license terms from the party that provided 18 * you this software, covering your right to use that party's intellectual 19 * property rights. 20 * 21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22 * copy of the source code appearing in this file ("Covered Code") an 23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 24 * base code distributed originally by Intel ("Original Intel Code") to copy, 25 * make derivatives, distribute, use and display any portion of the Covered 26 * Code in any form, with the right to sublicense such rights; and 27 * 28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 29 * license (with the right to sublicense), under only those claims of Intel 30 * patents that are infringed by the Original Intel Code, to make, use, sell, 31 * offer to sell, and import the Covered Code and derivative works thereof 32 * solely to the minimum extent necessary to exercise the above copyright 33 * license, and in no event shall the patent license extend to any additions 34 * to or modifications of the Original Intel Code. No other license or right 35 * is granted directly or by implication, estoppel or otherwise; 36 * 37 * The above copyright and patent license is granted only if the following 38 * conditions are met: 39 * 40 * 3. Conditions 41 * 42 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 43 * Redistribution of source code of any substantial portion of the Covered 44 * Code or modification with rights to further distribute source must include 45 * the above Copyright Notice, the above License, this list of Conditions, 46 * and the following Disclaimer and Export Compliance provision. In addition, 47 * Licensee must cause all Covered Code to which Licensee contributes to 48 * contain a file documenting the changes Licensee made to create that Covered 49 * Code and the date of any change. Licensee must include in that file the 50 * documentation of any changes made by any predecessor Licensee. Licensee 51 * must include a prominent statement that the modification is derived, 52 * directly or indirectly, from Original Intel Code. 53 * 54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 55 * Redistribution of source code of any substantial portion of the Covered 56 * Code or modification without rights to further distribute source must 57 * include the following Disclaimer and Export Compliance provision in the 58 * documentation and/or other materials provided with distribution. In 59 * addition, Licensee may not authorize further sublicense of source of any 60 * portion of the Covered Code, and must include terms to the effect that the 61 * license from Licensee to its licensee is limited to the intellectual 62 * property embodied in the software Licensee provides to its licensee, and 63 * not to intellectual property embodied in modifications its licensee may 64 * make. 65 * 66 * 3.3. Redistribution of Executable. Redistribution in executable form of any 67 * substantial portion of the Covered Code or modification must reproduce the 68 * above Copyright Notice, and the following Disclaimer and Export Compliance 69 * provision in the documentation and/or other materials provided with the 70 * distribution. 71 * 72 * 3.4. Intel retains all right, title, and interest in and to the Original 73 * Intel Code. 74 * 75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 76 * Intel shall be used in advertising or otherwise to promote the sale, use or 77 * other dealings in products derived from or relating to the Covered Code 78 * without prior written authorization from Intel. 79 * 80 * 4. Disclaimer and Export Compliance 81 * 82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 88 * PARTICULAR PURPOSE. 89 * 90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 97 * LIMITED REMEDY. 98 * 99 * 4.3. Licensee shall not export, either directly or indirectly, any of this 100 * software or system incorporating such software without first obtaining any 101 * required license or other approval from the U. S. Department of Commerce or 102 * any other agency or department of the United States Government. In the 103 * event Licensee exports any such software from the United States or 104 * re-exports any such software from a foreign destination, Licensee shall 105 * ensure that the distribution and export/re-export of the software is in 106 * compliance with all laws, regulations, orders, or other restrictions of the 107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 108 * any of its subsidiaries will export/re-export any technical data, process, 109 * software, or service, directly or indirectly, to any country for which the 110 * United States government or any agency thereof requires an export license, 111 * other governmental approval, or letter of assurance, without first obtaining 112 * such license, approval or letter. 113 * 114 *****************************************************************************/ 115 116#ifndef _ACUTILS_H 117#define _ACUTILS_H 118 119 120extern const UINT8 AcpiGbl_ResourceAmlSizes[]; 121 122/* Strings used by the disassembler and debugger resource dump routines */ 123 124#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 125 126extern const char *AcpiGbl_BmDecode[]; 127extern const char *AcpiGbl_ConfigDecode[]; 128extern const char *AcpiGbl_ConsumeDecode[]; 129extern const char *AcpiGbl_DecDecode[]; 130extern const char *AcpiGbl_HeDecode[]; 131extern const char *AcpiGbl_IoDecode[]; 132extern const char *AcpiGbl_LlDecode[]; 133extern const char *AcpiGbl_MaxDecode[]; 134extern const char *AcpiGbl_MemDecode[]; 135extern const char *AcpiGbl_MinDecode[]; 136extern const char *AcpiGbl_MtpDecode[]; 137extern const char *AcpiGbl_RngDecode[]; 138extern const char *AcpiGbl_RwDecode[]; 139extern const char *AcpiGbl_ShrDecode[]; 140extern const char *AcpiGbl_SizDecode[]; 141extern const char *AcpiGbl_TrsDecode[]; 142extern const char *AcpiGbl_TtpDecode[]; 143extern const char *AcpiGbl_TypDecode[]; 144#endif 145 146/* Types for Resource descriptor entries */ 147 148#define ACPI_INVALID_RESOURCE 0 149#define ACPI_FIXED_LENGTH 1 150#define ACPI_VARIABLE_LENGTH 2 151#define ACPI_SMALL_VARIABLE_LENGTH 3 152 153typedef 154ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( 155 UINT8 *Aml, 156 UINT32 Length, 157 UINT32 Offset, 158 UINT8 ResourceIndex, 159 void *Context); 160 161typedef 162ACPI_STATUS (*ACPI_PKG_CALLBACK) ( 163 UINT8 ObjectType, 164 ACPI_OPERAND_OBJECT *SourceObject, 165 ACPI_GENERIC_STATE *State, 166 void *Context); 167 168typedef struct acpi_pkg_info 169{ 170 UINT8 *FreeSpace; 171 ACPI_SIZE Length; 172 UINT32 ObjectSpace; 173 UINT32 NumPackages; 174 175} ACPI_PKG_INFO; 176 177#define REF_INCREMENT (UINT16) 0 178#define REF_DECREMENT (UINT16) 1 179#define REF_FORCE_DELETE (UINT16) 2 180 181/* AcpiUtDumpBuffer */ 182 183#define DB_BYTE_DISPLAY 1 184#define DB_WORD_DISPLAY 2 185#define DB_DWORD_DISPLAY 4 186#define DB_QWORD_DISPLAY 8 187 188 189/* 190 * utglobal - Global data structures and procedures 191 */ 192ACPI_STATUS 193AcpiUtInitGlobals ( 194 void); 195 196#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 197 198char * 199AcpiUtGetMutexName ( 200 UINT32 MutexId); 201 202const char * 203AcpiUtGetNotifyName ( 204 UINT32 NotifyValue); 205 206#endif 207 208char * 209AcpiUtGetTypeName ( 210 ACPI_OBJECT_TYPE Type); 211 212char * 213AcpiUtGetNodeName ( 214 void *Object); 215 216char * 217AcpiUtGetDescriptorName ( 218 void *Object); 219 220const char * 221AcpiUtGetReferenceName ( 222 ACPI_OPERAND_OBJECT *Object); 223 224char * 225AcpiUtGetObjectTypeName ( 226 ACPI_OPERAND_OBJECT *ObjDesc); 227 228char * 229AcpiUtGetRegionName ( 230 UINT8 SpaceId); 231 232char * 233AcpiUtGetEventName ( 234 UINT32 EventId); 235 236char 237AcpiUtHexToAsciiChar ( 238 UINT64 Integer, 239 UINT32 Position); 240 241BOOLEAN 242AcpiUtValidObjectType ( 243 ACPI_OBJECT_TYPE Type); 244 245 246/* 247 * utinit - miscellaneous initialization and shutdown 248 */ 249ACPI_STATUS 250AcpiUtHardwareInitialize ( 251 void); 252 253void 254AcpiUtSubsystemShutdown ( 255 void); 256 257 258/* 259 * utclib - Local implementations of C library functions 260 */ 261#ifndef ACPI_USE_SYSTEM_CLIBRARY 262 263ACPI_SIZE 264AcpiUtStrlen ( 265 const char *String); 266 267char * 268AcpiUtStrcpy ( 269 char *DstString, 270 const char *SrcString); 271 272char * 273AcpiUtStrncpy ( 274 char *DstString, 275 const char *SrcString, 276 ACPI_SIZE Count); 277 278int 279AcpiUtMemcmp ( 280 const char *Buffer1, 281 const char *Buffer2, 282 ACPI_SIZE Count); 283 284int 285AcpiUtStrncmp ( 286 const char *String1, 287 const char *String2, 288 ACPI_SIZE Count); 289 290int 291AcpiUtStrcmp ( 292 const char *String1, 293 const char *String2); 294 295char * 296AcpiUtStrcat ( 297 char *DstString, 298 const char *SrcString); 299 300char * 301AcpiUtStrncat ( 302 char *DstString, 303 const char *SrcString, 304 ACPI_SIZE Count); 305 306UINT32 307AcpiUtStrtoul ( 308 const char *String, 309 char **Terminator, 310 UINT32 Base); 311 312char * 313AcpiUtStrstr ( 314 char *String1, 315 char *String2); 316 317void * 318AcpiUtMemcpy ( 319 void *Dest, 320 const void *Src, 321 ACPI_SIZE Count); 322 323void * 324AcpiUtMemset ( 325 void *Dest, 326 UINT8 Value, 327 ACPI_SIZE Count); 328 329int 330AcpiUtToUpper ( 331 int c); 332 333int 334AcpiUtToLower ( 335 int c); 336 337extern const UINT8 _acpi_ctype[]; 338 339#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 340#define _ACPI_XS 0x40 /* extra space */ 341#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 342#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 343#define _ACPI_DI 0x04 /* '0'-'9' */ 344#define _ACPI_LO 0x02 /* 'a'-'z' */ 345#define _ACPI_PU 0x10 /* punctuation */ 346#define _ACPI_SP 0x08 /* space */ 347#define _ACPI_UP 0x01 /* 'A'-'Z' */ 348#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 349 350#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 351#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 352#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 353#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 354#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 355#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 356#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 357 358#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ 359 360#define ACPI_IS_ASCII(c) ((c) < 0x80) 361 362 363/* 364 * utcopy - Object construction and conversion interfaces 365 */ 366ACPI_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 UINT64 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 539AcpiUtEvaluateObject ( 540 ACPI_NAMESPACE_NODE *PrefixNode, 541 char *Path, 542 UINT32 ExpectedReturnBtypes, 543 ACPI_OPERAND_OBJECT **ReturnDesc); 544 545ACPI_STATUS 546AcpiUtEvaluateNumericObject ( 547 char *ObjectName, 548 ACPI_NAMESPACE_NODE *DeviceNode, 549 UINT64 *Value); 550 551ACPI_STATUS 552AcpiUtExecute_STA ( 553 ACPI_NAMESPACE_NODE *DeviceNode, 554 UINT32 *StatusFlags); 555 556ACPI_STATUS 557AcpiUtExecutePowerMethods ( 558 ACPI_NAMESPACE_NODE *DeviceNode, 559 const char **MethodNames, 560 UINT8 MethodCount, 561 UINT8 *OutValues); 562 563 564/* 565 * utids - device ID support 566 */ 567ACPI_STATUS 568AcpiUtExecute_HID ( 569 ACPI_NAMESPACE_NODE *DeviceNode, 570 ACPI_DEVICE_ID **ReturnId); 571 572ACPI_STATUS 573AcpiUtExecute_UID ( 574 ACPI_NAMESPACE_NODE *DeviceNode, 575 ACPI_DEVICE_ID **ReturnId); 576 577ACPI_STATUS 578AcpiUtExecute_CID ( 579 ACPI_NAMESPACE_NODE *DeviceNode, 580 ACPI_DEVICE_ID_LIST **ReturnCidList); 581 582 583/* 584 * utlock - reader/writer locks 585 */ 586ACPI_STATUS 587AcpiUtCreateRwLock ( 588 ACPI_RW_LOCK *Lock); 589 590void 591AcpiUtDeleteRwLock ( 592 ACPI_RW_LOCK *Lock); 593 594ACPI_STATUS 595AcpiUtAcquireReadLock ( 596 ACPI_RW_LOCK *Lock); 597 598ACPI_STATUS 599AcpiUtReleaseReadLock ( 600 ACPI_RW_LOCK *Lock); 601 602ACPI_STATUS 603AcpiUtAcquireWriteLock ( 604 ACPI_RW_LOCK *Lock); 605 606void 607AcpiUtReleaseWriteLock ( 608 ACPI_RW_LOCK *Lock); 609 610 611/* 612 * utobject - internal object create/delete/cache routines 613 */ 614ACPI_OPERAND_OBJECT * 615AcpiUtCreateInternalObjectDbg ( 616 const char *ModuleName, 617 UINT32 LineNumber, 618 UINT32 ComponentId, 619 ACPI_OBJECT_TYPE Type); 620 621void * 622AcpiUtAllocateObjectDescDbg ( 623 const char *ModuleName, 624 UINT32 LineNumber, 625 UINT32 ComponentId); 626 627#define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) 628#define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) 629 630void 631AcpiUtDeleteObjectDesc ( 632 ACPI_OPERAND_OBJECT *Object); 633 634BOOLEAN 635AcpiUtValidInternalObject ( 636 void *Object); 637 638ACPI_OPERAND_OBJECT * 639AcpiUtCreatePackageObject ( 640 UINT32 Count); 641 642ACPI_OPERAND_OBJECT * 643AcpiUtCreateIntegerObject ( 644 UINT64 Value); 645 646ACPI_OPERAND_OBJECT * 647AcpiUtCreateBufferObject ( 648 ACPI_SIZE BufferSize); 649 650ACPI_OPERAND_OBJECT * 651AcpiUtCreateStringObject ( 652 ACPI_SIZE StringSize); 653 654ACPI_STATUS 655AcpiUtGetObjectSize( 656 ACPI_OPERAND_OBJECT *Obj, 657 ACPI_SIZE *ObjLength); 658 659 660/* 661 * utosi - Support for the _OSI predefined control method 662 */ 663ACPI_STATUS 664AcpiUtInitializeInterfaces ( 665 void); 666 667void 668AcpiUtInterfaceTerminate ( 669 void); 670 671ACPI_STATUS 672AcpiUtInstallInterface ( 673 ACPI_STRING InterfaceName); 674 675ACPI_STATUS 676AcpiUtRemoveInterface ( 677 ACPI_STRING InterfaceName); 678 679ACPI_INTERFACE_INFO * 680AcpiUtGetInterface ( 681 ACPI_STRING InterfaceName); 682 683ACPI_STATUS 684AcpiUtOsiImplementation ( 685 ACPI_WALK_STATE *WalkState); 686 687 688/* 689 * utstate - Generic state creation/cache routines 690 */ 691void 692AcpiUtPushGenericState ( 693 ACPI_GENERIC_STATE **ListHead, 694 ACPI_GENERIC_STATE *State); 695 696ACPI_GENERIC_STATE * 697AcpiUtPopGenericState ( 698 ACPI_GENERIC_STATE **ListHead); 699 700 701ACPI_GENERIC_STATE * 702AcpiUtCreateGenericState ( 703 void); 704 705ACPI_THREAD_STATE * 706AcpiUtCreateThreadState ( 707 void); 708 709ACPI_GENERIC_STATE * 710AcpiUtCreateUpdateState ( 711 ACPI_OPERAND_OBJECT *Object, 712 UINT16 Action); 713 714ACPI_GENERIC_STATE * 715AcpiUtCreatePkgState ( 716 void *InternalObject, 717 void *ExternalObject, 718 UINT16 Index); 719 720ACPI_STATUS 721AcpiUtCreateUpdateStateAndPush ( 722 ACPI_OPERAND_OBJECT *Object, 723 UINT16 Action, 724 ACPI_GENERIC_STATE **StateList); 725 726ACPI_STATUS 727AcpiUtCreatePkgStateAndPush ( 728 void *InternalObject, 729 void *ExternalObject, 730 UINT16 Index, 731 ACPI_GENERIC_STATE **StateList); 732 733ACPI_GENERIC_STATE * 734AcpiUtCreateControlState ( 735 void); 736 737void 738AcpiUtDeleteGenericState ( 739 ACPI_GENERIC_STATE *State); 740 741 742/* 743 * utmath 744 */ 745ACPI_STATUS 746AcpiUtDivide ( 747 UINT64 InDividend, 748 UINT64 InDivisor, 749 UINT64 *OutQuotient, 750 UINT64 *OutRemainder); 751 752ACPI_STATUS 753AcpiUtShortDivide ( 754 UINT64 InDividend, 755 UINT32 Divisor, 756 UINT64 *OutQuotient, 757 UINT32 *OutRemainder); 758 759/* 760 * utmisc 761 */ 762const char * 763AcpiUtValidateException ( 764 ACPI_STATUS Status); 765 766BOOLEAN 767AcpiUtIsPciRootBridge ( 768 char *Id); 769 770BOOLEAN 771AcpiUtIsAmlTable ( 772 ACPI_TABLE_HEADER *Table); 773 774ACPI_STATUS 775AcpiUtAllocateOwnerId ( 776 ACPI_OWNER_ID *OwnerId); 777 778void 779AcpiUtReleaseOwnerId ( 780 ACPI_OWNER_ID *OwnerId); 781 782ACPI_STATUS 783AcpiUtWalkPackageTree ( 784 ACPI_OPERAND_OBJECT *SourceObject, 785 void *TargetObject, 786 ACPI_PKG_CALLBACK WalkCallback, 787 void *Context); 788 789void 790AcpiUtStrupr ( 791 char *SrcString); 792 793void 794AcpiUtStrlwr ( 795 char *SrcString); 796 797void 798AcpiUtPrintString ( 799 char *String, 800 UINT8 MaxLength); 801 802BOOLEAN 803AcpiUtValidAcpiName ( 804 UINT32 Name); 805 806void 807AcpiUtRepairName ( 808 char *Name); 809 810BOOLEAN 811AcpiUtValidAcpiChar ( 812 char Character, 813 UINT32 Position); 814 815ACPI_STATUS 816AcpiUtStrtoul64 ( 817 char *String, 818 UINT32 Base, 819 UINT64 *RetInteger); 820 821void ACPI_INTERNAL_VAR_XFACE 822AcpiUtPredefinedWarning ( 823 const char *ModuleName, 824 UINT32 LineNumber, 825 char *Pathname, 826 UINT8 NodeFlags, 827 const char *Format, 828 ...); 829 830void ACPI_INTERNAL_VAR_XFACE 831AcpiUtPredefinedInfo ( 832 const char *ModuleName, 833 UINT32 LineNumber, 834 char *Pathname, 835 UINT8 NodeFlags, 836 const char *Format, 837 ...); 838 839/* Values for Base above (16=Hex, 10=Decimal) */ 840 841#define ACPI_ANY_BASE 0 842 843UINT32 844AcpiUtDwordByteSwap ( 845 UINT32 Value); 846 847void 848AcpiUtSetIntegerWidth ( 849 UINT8 Revision); 850 851#ifdef ACPI_DEBUG_OUTPUT 852void 853AcpiUtDisplayInitPathname ( 854 UINT8 Type, 855 ACPI_NAMESPACE_NODE *ObjHandle, 856 char *Path); 857#endif 858 859 860/* 861 * utresrc 862 */ 863ACPI_STATUS 864AcpiUtWalkAmlResources ( 865 UINT8 *Aml, 866 ACPI_SIZE AmlLength, 867 ACPI_WALK_AML_CALLBACK UserFunction, 868 void *Context); 869 870ACPI_STATUS 871AcpiUtValidateResource ( 872 void *Aml, 873 UINT8 *ReturnIndex); 874 875UINT32 876AcpiUtGetDescriptorLength ( 877 void *Aml); 878 879UINT16 880AcpiUtGetResourceLength ( 881 void *Aml); 882 883UINT8 884AcpiUtGetResourceHeaderLength ( 885 void *Aml); 886 887UINT8 888AcpiUtGetResourceType ( 889 void *Aml); 890 891ACPI_STATUS 892AcpiUtGetResourceEndTag ( 893 ACPI_OPERAND_OBJECT *ObjDesc, 894 UINT8 **EndTag); 895 896 897/* 898 * utmutex - mutex support 899 */ 900ACPI_STATUS 901AcpiUtMutexInitialize ( 902 void); 903 904void 905AcpiUtMutexTerminate ( 906 void); 907 908ACPI_STATUS 909AcpiUtAcquireMutex ( 910 ACPI_MUTEX_HANDLE MutexId); 911 912ACPI_STATUS 913AcpiUtReleaseMutex ( 914 ACPI_MUTEX_HANDLE MutexId); 915 916 917/* 918 * utalloc - memory allocation and object caching 919 */ 920ACPI_STATUS 921AcpiUtCreateCaches ( 922 void); 923 924ACPI_STATUS 925AcpiUtDeleteCaches ( 926 void); 927 928ACPI_STATUS 929AcpiUtValidateBuffer ( 930 ACPI_BUFFER *Buffer); 931 932ACPI_STATUS 933AcpiUtInitializeBuffer ( 934 ACPI_BUFFER *Buffer, 935 ACPI_SIZE RequiredLength); 936 937void * 938AcpiUtAllocate ( 939 ACPI_SIZE Size, 940 UINT32 Component, 941 const char *Module, 942 UINT32 Line); 943 944void * 945AcpiUtAllocateZeroed ( 946 ACPI_SIZE Size, 947 UINT32 Component, 948 const char *Module, 949 UINT32 Line); 950 951#ifdef ACPI_DBG_TRACK_ALLOCATIONS 952void * 953AcpiUtAllocateAndTrack ( 954 ACPI_SIZE Size, 955 UINT32 Component, 956 const char *Module, 957 UINT32 Line); 958 959void * 960AcpiUtAllocateZeroedAndTrack ( 961 ACPI_SIZE Size, 962 UINT32 Component, 963 const char *Module, 964 UINT32 Line); 965 966void 967AcpiUtFreeAndTrack ( 968 void *Address, 969 UINT32 Component, 970 const char *Module, 971 UINT32 Line); 972 973void 974AcpiUtDumpAllocationInfo ( 975 void); 976 977void 978AcpiUtDumpAllocations ( 979 UINT32 Component, 980 const char *Module); 981 982ACPI_STATUS 983AcpiUtCreateList ( 984 char *ListName, 985 UINT16 ObjectSize, 986 ACPI_MEMORY_LIST **ReturnCache); 987 988 989#endif 990 991#endif /* _ACUTILS_H */ 992