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 - 2016, 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 120 extern const UINT8 AcpiGbl_ResourceAmlSizes[]; 121 extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[]; 122 123 /* Strings used by the disassembler and debugger resource dump routines */ 124 125 #if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) 126 127 extern const char *AcpiGbl_BmDecode[]; 128 extern const char *AcpiGbl_ConfigDecode[]; 129 extern const char *AcpiGbl_ConsumeDecode[]; 130 extern const char *AcpiGbl_DecDecode[]; 131 extern const char *AcpiGbl_HeDecode[]; 132 extern const char *AcpiGbl_IoDecode[]; 133 extern const char *AcpiGbl_LlDecode[]; 134 extern const char *AcpiGbl_MaxDecode[]; 135 extern const char *AcpiGbl_MemDecode[]; 136 extern const char *AcpiGbl_MinDecode[]; 137 extern const char *AcpiGbl_MtpDecode[]; 138 extern const char *AcpiGbl_RngDecode[]; 139 extern const char *AcpiGbl_RwDecode[]; 140 extern const char *AcpiGbl_ShrDecode[]; 141 extern const char *AcpiGbl_SizDecode[]; 142 extern const char *AcpiGbl_TrsDecode[]; 143 extern const char *AcpiGbl_TtpDecode[]; 144 extern const char *AcpiGbl_TypDecode[]; 145 extern const char *AcpiGbl_PpcDecode[]; 146 extern const char *AcpiGbl_IorDecode[]; 147 extern const char *AcpiGbl_DtsDecode[]; 148 extern const char *AcpiGbl_CtDecode[]; 149 extern const char *AcpiGbl_SbtDecode[]; 150 extern const char *AcpiGbl_AmDecode[]; 151 extern const char *AcpiGbl_SmDecode[]; 152 extern const char *AcpiGbl_WmDecode[]; 153 extern const char *AcpiGbl_CphDecode[]; 154 extern const char *AcpiGbl_CpoDecode[]; 155 extern const char *AcpiGbl_DpDecode[]; 156 extern const char *AcpiGbl_EdDecode[]; 157 extern const char *AcpiGbl_BpbDecode[]; 158 extern const char *AcpiGbl_SbDecode[]; 159 extern const char *AcpiGbl_FcDecode[]; 160 extern const char *AcpiGbl_PtDecode[]; 161 #endif 162 163 /* 164 * For the iASL compiler case, the output is redirected to stderr so that 165 * any of the various ACPI errors and warnings do not appear in the output 166 * files, for either the compiler or disassembler portions of the tool. 167 */ 168 #ifdef ACPI_ASL_COMPILER 169 170 #include <stdio.h> 171 172 #define ACPI_MSG_REDIRECT_BEGIN \ 173 FILE *OutputFile = AcpiGbl_OutputFile; \ 174 AcpiOsRedirectOutput (stderr); 175 176 #define ACPI_MSG_REDIRECT_END \ 177 AcpiOsRedirectOutput (OutputFile); 178 179 #else 180 /* 181 * non-iASL case - no redirection, nothing to do 182 */ 183 #define ACPI_MSG_REDIRECT_BEGIN 184 #define ACPI_MSG_REDIRECT_END 185 #endif 186 187 /* 188 * Common error message prefixes 189 */ 190 #define ACPI_MSG_ERROR "ACPI Error: " 191 #define ACPI_MSG_EXCEPTION "ACPI Exception: " 192 #define ACPI_MSG_WARNING "ACPI Warning: " 193 #define ACPI_MSG_INFO "ACPI: " 194 195 #define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " 196 #define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " 197 198 /* 199 * Common message suffix 200 */ 201 #define ACPI_MSG_SUFFIX \ 202 AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) 203 204 205 /* Types for Resource descriptor entries */ 206 207 #define ACPI_INVALID_RESOURCE 0 208 #define ACPI_FIXED_LENGTH 1 209 #define ACPI_VARIABLE_LENGTH 2 210 #define ACPI_SMALL_VARIABLE_LENGTH 3 211 212 typedef 213 ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( 214 UINT8 *Aml, 215 UINT32 Length, 216 UINT32 Offset, 217 UINT8 ResourceIndex, 218 void **Context); 219 220 typedef 221 ACPI_STATUS (*ACPI_PKG_CALLBACK) ( 222 UINT8 ObjectType, 223 ACPI_OPERAND_OBJECT *SourceObject, 224 ACPI_GENERIC_STATE *State, 225 void *Context); 226 227 typedef struct acpi_pkg_info 228 { 229 UINT8 *FreeSpace; 230 ACPI_SIZE Length; 231 UINT32 ObjectSpace; 232 UINT32 NumPackages; 233 234 } ACPI_PKG_INFO; 235 236 /* Object reference counts */ 237 238 #define REF_INCREMENT (UINT16) 0 239 #define REF_DECREMENT (UINT16) 1 240 241 /* AcpiUtDumpBuffer */ 242 243 #define DB_BYTE_DISPLAY 1 244 #define DB_WORD_DISPLAY 2 245 #define DB_DWORD_DISPLAY 4 246 #define DB_QWORD_DISPLAY 8 247 248 249 /* 250 * utnonansi - Non-ANSI C library functions 251 */ 252 void 253 AcpiUtStrupr ( 254 char *SrcString); 255 256 void 257 AcpiUtStrlwr ( 258 char *SrcString); 259 260 int 261 AcpiUtStricmp ( 262 char *String1, 263 char *String2); 264 265 ACPI_STATUS 266 AcpiUtStrtoul64 ( 267 char *String, 268 UINT32 Base, 269 UINT64 *RetInteger); 270 271 272 /* 273 * utglobal - Global data structures and procedures 274 */ 275 ACPI_STATUS 276 AcpiUtInitGlobals ( 277 void); 278 279 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 280 281 const char * 282 AcpiUtGetMutexName ( 283 UINT32 MutexId); 284 285 const char * 286 AcpiUtGetNotifyName ( 287 UINT32 NotifyValue, 288 ACPI_OBJECT_TYPE Type); 289 #endif 290 291 const char * 292 AcpiUtGetTypeName ( 293 ACPI_OBJECT_TYPE Type); 294 295 const char * 296 AcpiUtGetNodeName ( 297 void *Object); 298 299 const char * 300 AcpiUtGetDescriptorName ( 301 void *Object); 302 303 const char * 304 AcpiUtGetReferenceName ( 305 ACPI_OPERAND_OBJECT *Object); 306 307 const char * 308 AcpiUtGetObjectTypeName ( 309 ACPI_OPERAND_OBJECT *ObjDesc); 310 311 const char * 312 AcpiUtGetRegionName ( 313 UINT8 SpaceId); 314 315 const char * 316 AcpiUtGetEventName ( 317 UINT32 EventId); 318 319 char 320 AcpiUtHexToAsciiChar ( 321 UINT64 Integer, 322 UINT32 Position); 323 324 UINT8 325 AcpiUtAsciiCharToHex ( 326 int HexChar); 327 328 BOOLEAN 329 AcpiUtValidObjectType ( 330 ACPI_OBJECT_TYPE Type); 331 332 333 /* 334 * utinit - miscellaneous initialization and shutdown 335 */ 336 ACPI_STATUS 337 AcpiUtHardwareInitialize ( 338 void); 339 340 void 341 AcpiUtSubsystemShutdown ( 342 void); 343 344 345 /* 346 * utcopy - Object construction and conversion interfaces 347 */ 348 ACPI_STATUS 349 AcpiUtBuildSimpleObject( 350 ACPI_OPERAND_OBJECT *Obj, 351 ACPI_OBJECT *UserObj, 352 UINT8 *DataSpace, 353 UINT32 *BufferSpaceUsed); 354 355 ACPI_STATUS 356 AcpiUtBuildPackageObject ( 357 ACPI_OPERAND_OBJECT *Obj, 358 UINT8 *Buffer, 359 UINT32 *SpaceUsed); 360 361 ACPI_STATUS 362 AcpiUtCopyIobjectToEobject ( 363 ACPI_OPERAND_OBJECT *Obj, 364 ACPI_BUFFER *RetBuffer); 365 366 ACPI_STATUS 367 AcpiUtCopyEobjectToIobject ( 368 ACPI_OBJECT *Obj, 369 ACPI_OPERAND_OBJECT **InternalObj); 370 371 ACPI_STATUS 372 AcpiUtCopyISimpleToIsimple ( 373 ACPI_OPERAND_OBJECT *SourceObj, 374 ACPI_OPERAND_OBJECT *DestObj); 375 376 ACPI_STATUS 377 AcpiUtCopyIobjectToIobject ( 378 ACPI_OPERAND_OBJECT *SourceDesc, 379 ACPI_OPERAND_OBJECT **DestDesc, 380 ACPI_WALK_STATE *WalkState); 381 382 383 /* 384 * utcreate - Object creation 385 */ 386 ACPI_STATUS 387 AcpiUtUpdateObjectReference ( 388 ACPI_OPERAND_OBJECT *Object, 389 UINT16 Action); 390 391 392 /* 393 * utdebug - Debug interfaces 394 */ 395 void 396 AcpiUtInitStackPtrTrace ( 397 void); 398 399 void 400 AcpiUtTrackStackPtr ( 401 void); 402 403 void 404 AcpiUtTrace ( 405 UINT32 LineNumber, 406 const char *FunctionName, 407 const char *ModuleName, 408 UINT32 ComponentId); 409 410 void 411 AcpiUtTracePtr ( 412 UINT32 LineNumber, 413 const char *FunctionName, 414 const char *ModuleName, 415 UINT32 ComponentId, 416 void *Pointer); 417 418 void 419 AcpiUtTraceU32 ( 420 UINT32 LineNumber, 421 const char *FunctionName, 422 const char *ModuleName, 423 UINT32 ComponentId, 424 UINT32 Integer); 425 426 void 427 AcpiUtTraceStr ( 428 UINT32 LineNumber, 429 const char *FunctionName, 430 const char *ModuleName, 431 UINT32 ComponentId, 432 char *String); 433 434 void 435 AcpiUtExit ( 436 UINT32 LineNumber, 437 const char *FunctionName, 438 const char *ModuleName, 439 UINT32 ComponentId); 440 441 void 442 AcpiUtStatusExit ( 443 UINT32 LineNumber, 444 const char *FunctionName, 445 const char *ModuleName, 446 UINT32 ComponentId, 447 ACPI_STATUS Status); 448 449 void 450 AcpiUtValueExit ( 451 UINT32 LineNumber, 452 const char *FunctionName, 453 const char *ModuleName, 454 UINT32 ComponentId, 455 UINT64 Value); 456 457 void 458 AcpiUtPtrExit ( 459 UINT32 LineNumber, 460 const char *FunctionName, 461 const char *ModuleName, 462 UINT32 ComponentId, 463 UINT8 *Ptr); 464 465 void 466 AcpiUtDebugDumpBuffer ( 467 UINT8 *Buffer, 468 UINT32 Count, 469 UINT32 Display, 470 UINT32 ComponentId); 471 472 void 473 AcpiUtDumpBuffer ( 474 UINT8 *Buffer, 475 UINT32 Count, 476 UINT32 Display, 477 UINT32 Offset); 478 479 #ifdef ACPI_APPLICATION 480 void 481 AcpiUtDumpBufferToFile ( 482 ACPI_FILE File, 483 UINT8 *Buffer, 484 UINT32 Count, 485 UINT32 Display, 486 UINT32 BaseOffset); 487 #endif 488 489 void 490 AcpiUtReportError ( 491 char *ModuleName, 492 UINT32 LineNumber); 493 494 void 495 AcpiUtReportInfo ( 496 char *ModuleName, 497 UINT32 LineNumber); 498 499 void 500 AcpiUtReportWarning ( 501 char *ModuleName, 502 UINT32 LineNumber); 503 504 505 /* 506 * utdelete - Object deletion and reference counts 507 */ 508 void 509 AcpiUtAddReference ( 510 ACPI_OPERAND_OBJECT *Object); 511 512 void 513 AcpiUtRemoveReference ( 514 ACPI_OPERAND_OBJECT *Object); 515 516 void 517 AcpiUtDeleteInternalPackageObject ( 518 ACPI_OPERAND_OBJECT *Object); 519 520 void 521 AcpiUtDeleteInternalSimpleObject ( 522 ACPI_OPERAND_OBJECT *Object); 523 524 void 525 AcpiUtDeleteInternalObjectList ( 526 ACPI_OPERAND_OBJECT **ObjList); 527 528 529 /* 530 * uteval - object evaluation 531 */ 532 ACPI_STATUS 533 AcpiUtEvaluateObject ( 534 ACPI_NAMESPACE_NODE *PrefixNode, 535 char *Path, 536 UINT32 ExpectedReturnBtypes, 537 ACPI_OPERAND_OBJECT **ReturnDesc); 538 539 ACPI_STATUS 540 AcpiUtEvaluateNumericObject ( 541 char *ObjectName, 542 ACPI_NAMESPACE_NODE *DeviceNode, 543 UINT64 *Value); 544 545 ACPI_STATUS 546 AcpiUtExecute_STA ( 547 ACPI_NAMESPACE_NODE *DeviceNode, 548 UINT32 *StatusFlags); 549 550 ACPI_STATUS 551 AcpiUtExecutePowerMethods ( 552 ACPI_NAMESPACE_NODE *DeviceNode, 553 const char **MethodNames, 554 UINT8 MethodCount, 555 UINT8 *OutValues); 556 557 558 /* 559 * utids - device ID support 560 */ 561 ACPI_STATUS 562 AcpiUtExecute_HID ( 563 ACPI_NAMESPACE_NODE *DeviceNode, 564 ACPI_PNP_DEVICE_ID **ReturnId); 565 566 ACPI_STATUS 567 AcpiUtExecute_UID ( 568 ACPI_NAMESPACE_NODE *DeviceNode, 569 ACPI_PNP_DEVICE_ID **ReturnId); 570 571 ACPI_STATUS 572 AcpiUtExecute_CID ( 573 ACPI_NAMESPACE_NODE *DeviceNode, 574 ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); 575 576 ACPI_STATUS 577 AcpiUtExecute_CLS ( 578 ACPI_NAMESPACE_NODE *DeviceNode, 579 ACPI_PNP_DEVICE_ID **ReturnId); 580 581 582 /* 583 * utlock - reader/writer locks 584 */ 585 ACPI_STATUS 586 AcpiUtCreateRwLock ( 587 ACPI_RW_LOCK *Lock); 588 589 void 590 AcpiUtDeleteRwLock ( 591 ACPI_RW_LOCK *Lock); 592 593 ACPI_STATUS 594 AcpiUtAcquireReadLock ( 595 ACPI_RW_LOCK *Lock); 596 597 ACPI_STATUS 598 AcpiUtReleaseReadLock ( 599 ACPI_RW_LOCK *Lock); 600 601 ACPI_STATUS 602 AcpiUtAcquireWriteLock ( 603 ACPI_RW_LOCK *Lock); 604 605 void 606 AcpiUtReleaseWriteLock ( 607 ACPI_RW_LOCK *Lock); 608 609 610 /* 611 * utobject - internal object create/delete/cache routines 612 */ 613 ACPI_OPERAND_OBJECT * 614 AcpiUtCreateInternalObjectDbg ( 615 const char *ModuleName, 616 UINT32 LineNumber, 617 UINT32 ComponentId, 618 ACPI_OBJECT_TYPE Type); 619 620 void * 621 AcpiUtAllocateObjectDescDbg ( 622 const char *ModuleName, 623 UINT32 LineNumber, 624 UINT32 ComponentId); 625 626 #define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) 627 #define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) 628 629 void 630 AcpiUtDeleteObjectDesc ( 631 ACPI_OPERAND_OBJECT *Object); 632 633 BOOLEAN 634 AcpiUtValidInternalObject ( 635 void *Object); 636 637 ACPI_OPERAND_OBJECT * 638 AcpiUtCreatePackageObject ( 639 UINT32 Count); 640 641 ACPI_OPERAND_OBJECT * 642 AcpiUtCreateIntegerObject ( 643 UINT64 Value); 644 645 ACPI_OPERAND_OBJECT * 646 AcpiUtCreateBufferObject ( 647 ACPI_SIZE BufferSize); 648 649 ACPI_OPERAND_OBJECT * 650 AcpiUtCreateStringObject ( 651 ACPI_SIZE StringSize); 652 653 ACPI_STATUS 654 AcpiUtGetObjectSize( 655 ACPI_OPERAND_OBJECT *Obj, 656 ACPI_SIZE *ObjLength); 657 658 659 /* 660 * utosi - Support for the _OSI predefined control method 661 */ 662 ACPI_STATUS 663 AcpiUtInitializeInterfaces ( 664 void); 665 666 ACPI_STATUS 667 AcpiUtInterfaceTerminate ( 668 void); 669 670 ACPI_STATUS 671 AcpiUtInstallInterface ( 672 ACPI_STRING InterfaceName); 673 674 ACPI_STATUS 675 AcpiUtRemoveInterface ( 676 ACPI_STRING InterfaceName); 677 678 ACPI_STATUS 679 AcpiUtUpdateInterfaces ( 680 UINT8 Action); 681 682 ACPI_INTERFACE_INFO * 683 AcpiUtGetInterface ( 684 ACPI_STRING InterfaceName); 685 686 ACPI_STATUS 687 AcpiUtOsiImplementation ( 688 ACPI_WALK_STATE *WalkState); 689 690 691 /* 692 * utpredef - support for predefined names 693 */ 694 const ACPI_PREDEFINED_INFO * 695 AcpiUtGetNextPredefinedMethod ( 696 const ACPI_PREDEFINED_INFO *ThisName); 697 698 const ACPI_PREDEFINED_INFO * 699 AcpiUtMatchPredefinedMethod ( 700 char *Name); 701 702 void 703 AcpiUtGetExpectedReturnTypes ( 704 char *Buffer, 705 UINT32 ExpectedBtypes); 706 707 #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP) 708 const ACPI_PREDEFINED_INFO * 709 AcpiUtMatchResourceName ( 710 char *Name); 711 712 void 713 AcpiUtDisplayPredefinedMethod ( 714 char *Buffer, 715 const ACPI_PREDEFINED_INFO *ThisName, 716 BOOLEAN MultiLine); 717 718 UINT32 719 AcpiUtGetResourceBitWidth ( 720 char *Buffer, 721 UINT16 Types); 722 #endif 723 724 725 /* 726 * utstate - Generic state creation/cache routines 727 */ 728 void 729 AcpiUtPushGenericState ( 730 ACPI_GENERIC_STATE **ListHead, 731 ACPI_GENERIC_STATE *State); 732 733 ACPI_GENERIC_STATE * 734 AcpiUtPopGenericState ( 735 ACPI_GENERIC_STATE **ListHead); 736 737 738 ACPI_GENERIC_STATE * 739 AcpiUtCreateGenericState ( 740 void); 741 742 ACPI_THREAD_STATE * 743 AcpiUtCreateThreadState ( 744 void); 745 746 ACPI_GENERIC_STATE * 747 AcpiUtCreateUpdateState ( 748 ACPI_OPERAND_OBJECT *Object, 749 UINT16 Action); 750 751 ACPI_GENERIC_STATE * 752 AcpiUtCreatePkgState ( 753 void *InternalObject, 754 void *ExternalObject, 755 UINT16 Index); 756 757 ACPI_STATUS 758 AcpiUtCreateUpdateStateAndPush ( 759 ACPI_OPERAND_OBJECT *Object, 760 UINT16 Action, 761 ACPI_GENERIC_STATE **StateList); 762 763 ACPI_GENERIC_STATE * 764 AcpiUtCreateControlState ( 765 void); 766 767 void 768 AcpiUtDeleteGenericState ( 769 ACPI_GENERIC_STATE *State); 770 771 772 /* 773 * utmath 774 */ 775 ACPI_STATUS 776 AcpiUtDivide ( 777 UINT64 InDividend, 778 UINT64 InDivisor, 779 UINT64 *OutQuotient, 780 UINT64 *OutRemainder); 781 782 ACPI_STATUS 783 AcpiUtShortDivide ( 784 UINT64 InDividend, 785 UINT32 Divisor, 786 UINT64 *OutQuotient, 787 UINT32 *OutRemainder); 788 789 790 /* 791 * utmisc 792 */ 793 const ACPI_EXCEPTION_INFO * 794 AcpiUtValidateException ( 795 ACPI_STATUS Status); 796 797 BOOLEAN 798 AcpiUtIsPciRootBridge ( 799 char *Id); 800 801 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP) 802 BOOLEAN 803 AcpiUtIsAmlTable ( 804 ACPI_TABLE_HEADER *Table); 805 #endif 806 807 ACPI_STATUS 808 AcpiUtWalkPackageTree ( 809 ACPI_OPERAND_OBJECT *SourceObject, 810 void *TargetObject, 811 ACPI_PKG_CALLBACK WalkCallback, 812 void *Context); 813 814 /* Values for Base above (16=Hex, 10=Decimal) */ 815 816 #define ACPI_ANY_BASE 0 817 818 819 UINT32 820 AcpiUtDwordByteSwap ( 821 UINT32 Value); 822 823 void 824 AcpiUtSetIntegerWidth ( 825 UINT8 Revision); 826 827 #ifdef ACPI_DEBUG_OUTPUT 828 void 829 AcpiUtDisplayInitPathname ( 830 UINT8 Type, 831 ACPI_NAMESPACE_NODE *ObjHandle, 832 char *Path); 833 #endif 834 835 836 /* 837 * utownerid - Support for Table/Method Owner IDs 838 */ 839 ACPI_STATUS 840 AcpiUtAllocateOwnerId ( 841 ACPI_OWNER_ID *OwnerId); 842 843 void 844 AcpiUtReleaseOwnerId ( 845 ACPI_OWNER_ID *OwnerId); 846 847 848 /* 849 * utresrc 850 */ 851 ACPI_STATUS 852 AcpiUtWalkAmlResources ( 853 ACPI_WALK_STATE *WalkState, 854 UINT8 *Aml, 855 ACPI_SIZE AmlLength, 856 ACPI_WALK_AML_CALLBACK UserFunction, 857 void **Context); 858 859 ACPI_STATUS 860 AcpiUtValidateResource ( 861 ACPI_WALK_STATE *WalkState, 862 void *Aml, 863 UINT8 *ReturnIndex); 864 865 UINT32 866 AcpiUtGetDescriptorLength ( 867 void *Aml); 868 869 UINT16 870 AcpiUtGetResourceLength ( 871 void *Aml); 872 873 UINT8 874 AcpiUtGetResourceHeaderLength ( 875 void *Aml); 876 877 UINT8 878 AcpiUtGetResourceType ( 879 void *Aml); 880 881 ACPI_STATUS 882 AcpiUtGetResourceEndTag ( 883 ACPI_OPERAND_OBJECT *ObjDesc, 884 UINT8 **EndTag); 885 886 887 /* 888 * utstring - String and character utilities 889 */ 890 void 891 AcpiUtPrintString ( 892 char *String, 893 UINT16 MaxLength); 894 895 #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP 896 void 897 UtConvertBackslashes ( 898 char *Pathname); 899 #endif 900 901 BOOLEAN 902 AcpiUtValidAcpiName ( 903 char *Name); 904 905 BOOLEAN 906 AcpiUtValidAcpiChar ( 907 char Character, 908 UINT32 Position); 909 910 void 911 AcpiUtRepairName ( 912 char *Name); 913 914 #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) 915 BOOLEAN 916 AcpiUtSafeStrcpy ( 917 char *Dest, 918 ACPI_SIZE DestSize, 919 char *Source); 920 921 BOOLEAN 922 AcpiUtSafeStrcat ( 923 char *Dest, 924 ACPI_SIZE DestSize, 925 char *Source); 926 927 BOOLEAN 928 AcpiUtSafeStrncat ( 929 char *Dest, 930 ACPI_SIZE DestSize, 931 char *Source, 932 ACPI_SIZE MaxTransferLength); 933 #endif 934 935 936 /* 937 * utmutex - mutex support 938 */ 939 ACPI_STATUS 940 AcpiUtMutexInitialize ( 941 void); 942 943 void 944 AcpiUtMutexTerminate ( 945 void); 946 947 ACPI_STATUS 948 AcpiUtAcquireMutex ( 949 ACPI_MUTEX_HANDLE MutexId); 950 951 ACPI_STATUS 952 AcpiUtReleaseMutex ( 953 ACPI_MUTEX_HANDLE MutexId); 954 955 956 /* 957 * utalloc - memory allocation and object caching 958 */ 959 ACPI_STATUS 960 AcpiUtCreateCaches ( 961 void); 962 963 ACPI_STATUS 964 AcpiUtDeleteCaches ( 965 void); 966 967 ACPI_STATUS 968 AcpiUtValidateBuffer ( 969 ACPI_BUFFER *Buffer); 970 971 ACPI_STATUS 972 AcpiUtInitializeBuffer ( 973 ACPI_BUFFER *Buffer, 974 ACPI_SIZE RequiredLength); 975 976 #ifdef ACPI_DBG_TRACK_ALLOCATIONS 977 void * 978 AcpiUtAllocateAndTrack ( 979 ACPI_SIZE Size, 980 UINT32 Component, 981 const char *Module, 982 UINT32 Line); 983 984 void * 985 AcpiUtAllocateZeroedAndTrack ( 986 ACPI_SIZE Size, 987 UINT32 Component, 988 const char *Module, 989 UINT32 Line); 990 991 void 992 AcpiUtFreeAndTrack ( 993 void *Address, 994 UINT32 Component, 995 const char *Module, 996 UINT32 Line); 997 998 void 999 AcpiUtDumpAllocationInfo ( 1000 void); 1001 1002 void 1003 AcpiUtDumpAllocations ( 1004 UINT32 Component, 1005 const char *Module); 1006 1007 ACPI_STATUS 1008 AcpiUtCreateList ( 1009 char *ListName, 1010 UINT16 ObjectSize, 1011 ACPI_MEMORY_LIST **ReturnCache); 1012 1013 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 1014 1015 1016 /* 1017 * utaddress - address range check 1018 */ 1019 ACPI_STATUS 1020 AcpiUtAddAddressRange ( 1021 ACPI_ADR_SPACE_TYPE SpaceId, 1022 ACPI_PHYSICAL_ADDRESS Address, 1023 UINT32 Length, 1024 ACPI_NAMESPACE_NODE *RegionNode); 1025 1026 void 1027 AcpiUtRemoveAddressRange ( 1028 ACPI_ADR_SPACE_TYPE SpaceId, 1029 ACPI_NAMESPACE_NODE *RegionNode); 1030 1031 UINT32 1032 AcpiUtCheckAddressRange ( 1033 ACPI_ADR_SPACE_TYPE SpaceId, 1034 ACPI_PHYSICAL_ADDRESS Address, 1035 UINT32 Length, 1036 BOOLEAN Warn); 1037 1038 void 1039 AcpiUtDeleteAddressLists ( 1040 void); 1041 1042 1043 /* 1044 * utxferror - various error/warning output functions 1045 */ 1046 void ACPI_INTERNAL_VAR_XFACE 1047 AcpiUtPredefinedWarning ( 1048 const char *ModuleName, 1049 UINT32 LineNumber, 1050 char *Pathname, 1051 UINT8 NodeFlags, 1052 const char *Format, 1053 ...); 1054 1055 void ACPI_INTERNAL_VAR_XFACE 1056 AcpiUtPredefinedInfo ( 1057 const char *ModuleName, 1058 UINT32 LineNumber, 1059 char *Pathname, 1060 UINT8 NodeFlags, 1061 const char *Format, 1062 ...); 1063 1064 void ACPI_INTERNAL_VAR_XFACE 1065 AcpiUtPredefinedBiosError ( 1066 const char *ModuleName, 1067 UINT32 LineNumber, 1068 char *Pathname, 1069 UINT8 NodeFlags, 1070 const char *Format, 1071 ...); 1072 1073 void 1074 AcpiUtNamespaceError ( 1075 const char *ModuleName, 1076 UINT32 LineNumber, 1077 const char *InternalName, 1078 ACPI_STATUS LookupStatus); 1079 1080 void 1081 AcpiUtMethodError ( 1082 const char *ModuleName, 1083 UINT32 LineNumber, 1084 const char *Message, 1085 ACPI_NAMESPACE_NODE *Node, 1086 const char *Path, 1087 ACPI_STATUS LookupStatus); 1088 1089 1090 /* 1091 * Utility functions for ACPI names and IDs 1092 */ 1093 const AH_PREDEFINED_NAME * 1094 AcpiAhMatchPredefinedName ( 1095 char *Nameseg); 1096 1097 const AH_DEVICE_ID * 1098 AcpiAhMatchHardwareId ( 1099 char *Hid); 1100 1101 const char * 1102 AcpiAhMatchUuid ( 1103 UINT8 *Data); 1104 1105 1106 /* 1107 * utprint - printf/vprintf output functions 1108 */ 1109 const char * 1110 AcpiUtScanNumber ( 1111 const char *String, 1112 UINT64 *NumberPtr); 1113 1114 const char * 1115 AcpiUtPrintNumber ( 1116 char *String, 1117 UINT64 Number); 1118 1119 int 1120 AcpiUtVsnprintf ( 1121 char *String, 1122 ACPI_SIZE Size, 1123 const char *Format, 1124 va_list Args); 1125 1126 int 1127 AcpiUtSnprintf ( 1128 char *String, 1129 ACPI_SIZE Size, 1130 const char *Format, 1131 ...); 1132 1133 #ifdef ACPI_APPLICATION 1134 int 1135 AcpiUtFileVprintf ( 1136 ACPI_FILE File, 1137 const char *Format, 1138 va_list Args); 1139 1140 int 1141 AcpiUtFilePrintf ( 1142 ACPI_FILE File, 1143 const char *Format, 1144 ...); 1145 #endif 1146 1147 1148 /* 1149 * utuuid -- UUID support functions 1150 */ 1151 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP) 1152 void 1153 AcpiUtConvertStringToUuid ( 1154 char *InString, 1155 UINT8 *UuidBuffer); 1156 #endif 1157 1158 #endif /* _ACUTILS_H */ 1159