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 - 2012, 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_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 /* Types for Resource descriptor entries */ 164 165 #define ACPI_INVALID_RESOURCE 0 166 #define ACPI_FIXED_LENGTH 1 167 #define ACPI_VARIABLE_LENGTH 2 168 #define ACPI_SMALL_VARIABLE_LENGTH 3 169 170 typedef 171 ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( 172 UINT8 *Aml, 173 UINT32 Length, 174 UINT32 Offset, 175 UINT8 ResourceIndex, 176 void *Context); 177 178 typedef 179 ACPI_STATUS (*ACPI_PKG_CALLBACK) ( 180 UINT8 ObjectType, 181 ACPI_OPERAND_OBJECT *SourceObject, 182 ACPI_GENERIC_STATE *State, 183 void *Context); 184 185 typedef struct acpi_pkg_info 186 { 187 UINT8 *FreeSpace; 188 ACPI_SIZE Length; 189 UINT32 ObjectSpace; 190 UINT32 NumPackages; 191 192 } ACPI_PKG_INFO; 193 194 #define REF_INCREMENT (UINT16) 0 195 #define REF_DECREMENT (UINT16) 1 196 #define REF_FORCE_DELETE (UINT16) 2 197 198 /* AcpiUtDumpBuffer */ 199 200 #define DB_BYTE_DISPLAY 1 201 #define DB_WORD_DISPLAY 2 202 #define DB_DWORD_DISPLAY 4 203 #define DB_QWORD_DISPLAY 8 204 205 /* 206 * utglobal - Global data structures and procedures 207 */ 208 ACPI_STATUS 209 AcpiUtInitGlobals ( 210 void); 211 212 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 213 214 char * 215 AcpiUtGetMutexName ( 216 UINT32 MutexId); 217 218 const char * 219 AcpiUtGetNotifyName ( 220 UINT32 NotifyValue); 221 222 #endif 223 224 char * 225 AcpiUtGetTypeName ( 226 ACPI_OBJECT_TYPE Type); 227 228 char * 229 AcpiUtGetNodeName ( 230 void *Object); 231 232 char * 233 AcpiUtGetDescriptorName ( 234 void *Object); 235 236 const char * 237 AcpiUtGetReferenceName ( 238 ACPI_OPERAND_OBJECT *Object); 239 240 char * 241 AcpiUtGetObjectTypeName ( 242 ACPI_OPERAND_OBJECT *ObjDesc); 243 244 char * 245 AcpiUtGetRegionName ( 246 UINT8 SpaceId); 247 248 char * 249 AcpiUtGetEventName ( 250 UINT32 EventId); 251 252 char 253 AcpiUtHexToAsciiChar ( 254 UINT64 Integer, 255 UINT32 Position); 256 257 BOOLEAN 258 AcpiUtValidObjectType ( 259 ACPI_OBJECT_TYPE Type); 260 261 262 /* 263 * utinit - miscellaneous initialization and shutdown 264 */ 265 ACPI_STATUS 266 AcpiUtHardwareInitialize ( 267 void); 268 269 void 270 AcpiUtSubsystemShutdown ( 271 void); 272 273 274 /* 275 * utclib - Local implementations of C library functions 276 */ 277 #ifndef ACPI_USE_SYSTEM_CLIBRARY 278 279 ACPI_SIZE 280 AcpiUtStrlen ( 281 const char *String); 282 283 char * 284 AcpiUtStrcpy ( 285 char *DstString, 286 const char *SrcString); 287 288 char * 289 AcpiUtStrncpy ( 290 char *DstString, 291 const char *SrcString, 292 ACPI_SIZE Count); 293 294 int 295 AcpiUtMemcmp ( 296 const char *Buffer1, 297 const char *Buffer2, 298 ACPI_SIZE Count); 299 300 int 301 AcpiUtStrncmp ( 302 const char *String1, 303 const char *String2, 304 ACPI_SIZE Count); 305 306 int 307 AcpiUtStrcmp ( 308 const char *String1, 309 const char *String2); 310 311 char * 312 AcpiUtStrcat ( 313 char *DstString, 314 const char *SrcString); 315 316 char * 317 AcpiUtStrncat ( 318 char *DstString, 319 const char *SrcString, 320 ACPI_SIZE Count); 321 322 UINT32 323 AcpiUtStrtoul ( 324 const char *String, 325 char **Terminator, 326 UINT32 Base); 327 328 char * 329 AcpiUtStrstr ( 330 char *String1, 331 char *String2); 332 333 void * 334 AcpiUtMemcpy ( 335 void *Dest, 336 const void *Src, 337 ACPI_SIZE Count); 338 339 void * 340 AcpiUtMemset ( 341 void *Dest, 342 UINT8 Value, 343 ACPI_SIZE Count); 344 345 int 346 AcpiUtToUpper ( 347 int c); 348 349 int 350 AcpiUtToLower ( 351 int c); 352 353 extern const UINT8 _acpi_ctype[]; 354 355 #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ 356 #define _ACPI_XS 0x40 /* extra space */ 357 #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ 358 #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ 359 #define _ACPI_DI 0x04 /* '0'-'9' */ 360 #define _ACPI_LO 0x02 /* 'a'-'z' */ 361 #define _ACPI_PU 0x10 /* punctuation */ 362 #define _ACPI_SP 0x08 /* space */ 363 #define _ACPI_UP 0x01 /* 'A'-'Z' */ 364 #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 365 366 #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 367 #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 368 #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 369 #define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 370 #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 371 #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) 372 #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 373 374 #endif /* !ACPI_USE_SYSTEM_CLIBRARY */ 375 376 #define ACPI_IS_ASCII(c) ((c) < 0x80) 377 378 379 /* 380 * utcopy - Object construction and conversion interfaces 381 */ 382 ACPI_STATUS 383 AcpiUtBuildSimpleObject( 384 ACPI_OPERAND_OBJECT *Obj, 385 ACPI_OBJECT *UserObj, 386 UINT8 *DataSpace, 387 UINT32 *BufferSpaceUsed); 388 389 ACPI_STATUS 390 AcpiUtBuildPackageObject ( 391 ACPI_OPERAND_OBJECT *Obj, 392 UINT8 *Buffer, 393 UINT32 *SpaceUsed); 394 395 ACPI_STATUS 396 AcpiUtCopyIobjectToEobject ( 397 ACPI_OPERAND_OBJECT *Obj, 398 ACPI_BUFFER *RetBuffer); 399 400 ACPI_STATUS 401 AcpiUtCopyEobjectToIobject ( 402 ACPI_OBJECT *Obj, 403 ACPI_OPERAND_OBJECT **InternalObj); 404 405 ACPI_STATUS 406 AcpiUtCopyISimpleToIsimple ( 407 ACPI_OPERAND_OBJECT *SourceObj, 408 ACPI_OPERAND_OBJECT *DestObj); 409 410 ACPI_STATUS 411 AcpiUtCopyIobjectToIobject ( 412 ACPI_OPERAND_OBJECT *SourceDesc, 413 ACPI_OPERAND_OBJECT **DestDesc, 414 ACPI_WALK_STATE *WalkState); 415 416 417 /* 418 * utcreate - Object creation 419 */ 420 ACPI_STATUS 421 AcpiUtUpdateObjectReference ( 422 ACPI_OPERAND_OBJECT *Object, 423 UINT16 Action); 424 425 426 /* 427 * utdebug - Debug interfaces 428 */ 429 void 430 AcpiUtInitStackPtrTrace ( 431 void); 432 433 void 434 AcpiUtTrackStackPtr ( 435 void); 436 437 void 438 AcpiUtTrace ( 439 UINT32 LineNumber, 440 const char *FunctionName, 441 const char *ModuleName, 442 UINT32 ComponentId); 443 444 void 445 AcpiUtTracePtr ( 446 UINT32 LineNumber, 447 const char *FunctionName, 448 const char *ModuleName, 449 UINT32 ComponentId, 450 void *Pointer); 451 452 void 453 AcpiUtTraceU32 ( 454 UINT32 LineNumber, 455 const char *FunctionName, 456 const char *ModuleName, 457 UINT32 ComponentId, 458 UINT32 Integer); 459 460 void 461 AcpiUtTraceStr ( 462 UINT32 LineNumber, 463 const char *FunctionName, 464 const char *ModuleName, 465 UINT32 ComponentId, 466 char *String); 467 468 void 469 AcpiUtExit ( 470 UINT32 LineNumber, 471 const char *FunctionName, 472 const char *ModuleName, 473 UINT32 ComponentId); 474 475 void 476 AcpiUtStatusExit ( 477 UINT32 LineNumber, 478 const char *FunctionName, 479 const char *ModuleName, 480 UINT32 ComponentId, 481 ACPI_STATUS Status); 482 483 void 484 AcpiUtValueExit ( 485 UINT32 LineNumber, 486 const char *FunctionName, 487 const char *ModuleName, 488 UINT32 ComponentId, 489 UINT64 Value); 490 491 void 492 AcpiUtPtrExit ( 493 UINT32 LineNumber, 494 const char *FunctionName, 495 const char *ModuleName, 496 UINT32 ComponentId, 497 UINT8 *Ptr); 498 499 void 500 AcpiUtDumpBuffer ( 501 UINT8 *Buffer, 502 UINT32 Count, 503 UINT32 Display, 504 UINT32 ComponentId); 505 506 void 507 AcpiUtDumpBuffer2 ( 508 UINT8 *Buffer, 509 UINT32 Count, 510 UINT32 Display); 511 512 void 513 AcpiUtReportError ( 514 char *ModuleName, 515 UINT32 LineNumber); 516 517 void 518 AcpiUtReportInfo ( 519 char *ModuleName, 520 UINT32 LineNumber); 521 522 void 523 AcpiUtReportWarning ( 524 char *ModuleName, 525 UINT32 LineNumber); 526 527 /* 528 * utdelete - Object deletion and reference counts 529 */ 530 void 531 AcpiUtAddReference ( 532 ACPI_OPERAND_OBJECT *Object); 533 534 void 535 AcpiUtRemoveReference ( 536 ACPI_OPERAND_OBJECT *Object); 537 538 void 539 AcpiUtDeleteInternalPackageObject ( 540 ACPI_OPERAND_OBJECT *Object); 541 542 void 543 AcpiUtDeleteInternalSimpleObject ( 544 ACPI_OPERAND_OBJECT *Object); 545 546 void 547 AcpiUtDeleteInternalObjectList ( 548 ACPI_OPERAND_OBJECT **ObjList); 549 550 551 /* 552 * uteval - object evaluation 553 */ 554 ACPI_STATUS 555 AcpiUtEvaluateObject ( 556 ACPI_NAMESPACE_NODE *PrefixNode, 557 char *Path, 558 UINT32 ExpectedReturnBtypes, 559 ACPI_OPERAND_OBJECT **ReturnDesc); 560 561 ACPI_STATUS 562 AcpiUtEvaluateNumericObject ( 563 char *ObjectName, 564 ACPI_NAMESPACE_NODE *DeviceNode, 565 UINT64 *Value); 566 567 ACPI_STATUS 568 AcpiUtExecute_STA ( 569 ACPI_NAMESPACE_NODE *DeviceNode, 570 UINT32 *StatusFlags); 571 572 ACPI_STATUS 573 AcpiUtExecutePowerMethods ( 574 ACPI_NAMESPACE_NODE *DeviceNode, 575 const char **MethodNames, 576 UINT8 MethodCount, 577 UINT8 *OutValues); 578 579 580 /* 581 * utids - device ID support 582 */ 583 ACPI_STATUS 584 AcpiUtExecute_HID ( 585 ACPI_NAMESPACE_NODE *DeviceNode, 586 ACPI_DEVICE_ID **ReturnId); 587 588 ACPI_STATUS 589 AcpiUtExecute_UID ( 590 ACPI_NAMESPACE_NODE *DeviceNode, 591 ACPI_DEVICE_ID **ReturnId); 592 593 ACPI_STATUS 594 AcpiUtExecute_CID ( 595 ACPI_NAMESPACE_NODE *DeviceNode, 596 ACPI_DEVICE_ID_LIST **ReturnCidList); 597 598 599 /* 600 * utlock - reader/writer locks 601 */ 602 ACPI_STATUS 603 AcpiUtCreateRwLock ( 604 ACPI_RW_LOCK *Lock); 605 606 void 607 AcpiUtDeleteRwLock ( 608 ACPI_RW_LOCK *Lock); 609 610 ACPI_STATUS 611 AcpiUtAcquireReadLock ( 612 ACPI_RW_LOCK *Lock); 613 614 ACPI_STATUS 615 AcpiUtReleaseReadLock ( 616 ACPI_RW_LOCK *Lock); 617 618 ACPI_STATUS 619 AcpiUtAcquireWriteLock ( 620 ACPI_RW_LOCK *Lock); 621 622 void 623 AcpiUtReleaseWriteLock ( 624 ACPI_RW_LOCK *Lock); 625 626 627 /* 628 * utobject - internal object create/delete/cache routines 629 */ 630 ACPI_OPERAND_OBJECT * 631 AcpiUtCreateInternalObjectDbg ( 632 const char *ModuleName, 633 UINT32 LineNumber, 634 UINT32 ComponentId, 635 ACPI_OBJECT_TYPE Type); 636 637 void * 638 AcpiUtAllocateObjectDescDbg ( 639 const char *ModuleName, 640 UINT32 LineNumber, 641 UINT32 ComponentId); 642 643 #define AcpiUtCreateInternalObject(t) AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t) 644 #define AcpiUtAllocateObjectDesc() AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT) 645 646 void 647 AcpiUtDeleteObjectDesc ( 648 ACPI_OPERAND_OBJECT *Object); 649 650 BOOLEAN 651 AcpiUtValidInternalObject ( 652 void *Object); 653 654 ACPI_OPERAND_OBJECT * 655 AcpiUtCreatePackageObject ( 656 UINT32 Count); 657 658 ACPI_OPERAND_OBJECT * 659 AcpiUtCreateIntegerObject ( 660 UINT64 Value); 661 662 ACPI_OPERAND_OBJECT * 663 AcpiUtCreateBufferObject ( 664 ACPI_SIZE BufferSize); 665 666 ACPI_OPERAND_OBJECT * 667 AcpiUtCreateStringObject ( 668 ACPI_SIZE StringSize); 669 670 ACPI_STATUS 671 AcpiUtGetObjectSize( 672 ACPI_OPERAND_OBJECT *Obj, 673 ACPI_SIZE *ObjLength); 674 675 676 /* 677 * utosi - Support for the _OSI predefined control method 678 */ 679 ACPI_STATUS 680 AcpiUtInitializeInterfaces ( 681 void); 682 683 void 684 AcpiUtInterfaceTerminate ( 685 void); 686 687 ACPI_STATUS 688 AcpiUtInstallInterface ( 689 ACPI_STRING InterfaceName); 690 691 ACPI_STATUS 692 AcpiUtRemoveInterface ( 693 ACPI_STRING InterfaceName); 694 695 ACPI_INTERFACE_INFO * 696 AcpiUtGetInterface ( 697 ACPI_STRING InterfaceName); 698 699 ACPI_STATUS 700 AcpiUtOsiImplementation ( 701 ACPI_WALK_STATE *WalkState); 702 703 704 /* 705 * utstate - Generic state creation/cache routines 706 */ 707 void 708 AcpiUtPushGenericState ( 709 ACPI_GENERIC_STATE **ListHead, 710 ACPI_GENERIC_STATE *State); 711 712 ACPI_GENERIC_STATE * 713 AcpiUtPopGenericState ( 714 ACPI_GENERIC_STATE **ListHead); 715 716 717 ACPI_GENERIC_STATE * 718 AcpiUtCreateGenericState ( 719 void); 720 721 ACPI_THREAD_STATE * 722 AcpiUtCreateThreadState ( 723 void); 724 725 ACPI_GENERIC_STATE * 726 AcpiUtCreateUpdateState ( 727 ACPI_OPERAND_OBJECT *Object, 728 UINT16 Action); 729 730 ACPI_GENERIC_STATE * 731 AcpiUtCreatePkgState ( 732 void *InternalObject, 733 void *ExternalObject, 734 UINT16 Index); 735 736 ACPI_STATUS 737 AcpiUtCreateUpdateStateAndPush ( 738 ACPI_OPERAND_OBJECT *Object, 739 UINT16 Action, 740 ACPI_GENERIC_STATE **StateList); 741 742 ACPI_STATUS 743 AcpiUtCreatePkgStateAndPush ( 744 void *InternalObject, 745 void *ExternalObject, 746 UINT16 Index, 747 ACPI_GENERIC_STATE **StateList); 748 749 ACPI_GENERIC_STATE * 750 AcpiUtCreateControlState ( 751 void); 752 753 void 754 AcpiUtDeleteGenericState ( 755 ACPI_GENERIC_STATE *State); 756 757 758 /* 759 * utmath 760 */ 761 ACPI_STATUS 762 AcpiUtDivide ( 763 UINT64 InDividend, 764 UINT64 InDivisor, 765 UINT64 *OutQuotient, 766 UINT64 *OutRemainder); 767 768 ACPI_STATUS 769 AcpiUtShortDivide ( 770 UINT64 InDividend, 771 UINT32 Divisor, 772 UINT64 *OutQuotient, 773 UINT32 *OutRemainder); 774 775 /* 776 * utmisc 777 */ 778 void 779 UtConvertBackslashes ( 780 char *Pathname); 781 782 const char * 783 AcpiUtValidateException ( 784 ACPI_STATUS Status); 785 786 BOOLEAN 787 AcpiUtIsPciRootBridge ( 788 char *Id); 789 790 BOOLEAN 791 AcpiUtIsAmlTable ( 792 ACPI_TABLE_HEADER *Table); 793 794 ACPI_STATUS 795 AcpiUtAllocateOwnerId ( 796 ACPI_OWNER_ID *OwnerId); 797 798 void 799 AcpiUtReleaseOwnerId ( 800 ACPI_OWNER_ID *OwnerId); 801 802 ACPI_STATUS 803 AcpiUtWalkPackageTree ( 804 ACPI_OPERAND_OBJECT *SourceObject, 805 void *TargetObject, 806 ACPI_PKG_CALLBACK WalkCallback, 807 void *Context); 808 809 void 810 AcpiUtStrupr ( 811 char *SrcString); 812 813 void 814 AcpiUtStrlwr ( 815 char *SrcString); 816 817 int 818 AcpiUtStricmp ( 819 char *String1, 820 char *String2); 821 822 void 823 AcpiUtPrintString ( 824 char *String, 825 UINT8 MaxLength); 826 827 BOOLEAN 828 AcpiUtValidAcpiName ( 829 UINT32 Name); 830 831 void 832 AcpiUtRepairName ( 833 char *Name); 834 835 BOOLEAN 836 AcpiUtValidAcpiChar ( 837 char Character, 838 UINT32 Position); 839 840 ACPI_STATUS 841 AcpiUtStrtoul64 ( 842 char *String, 843 UINT32 Base, 844 UINT64 *RetInteger); 845 846 /* Values for Base above (16=Hex, 10=Decimal) */ 847 848 #define ACPI_ANY_BASE 0 849 850 UINT32 851 AcpiUtDwordByteSwap ( 852 UINT32 Value); 853 854 void 855 AcpiUtSetIntegerWidth ( 856 UINT8 Revision); 857 858 #ifdef ACPI_DEBUG_OUTPUT 859 void 860 AcpiUtDisplayInitPathname ( 861 UINT8 Type, 862 ACPI_NAMESPACE_NODE *ObjHandle, 863 char *Path); 864 #endif 865 866 867 /* 868 * utresrc 869 */ 870 ACPI_STATUS 871 AcpiUtWalkAmlResources ( 872 UINT8 *Aml, 873 ACPI_SIZE AmlLength, 874 ACPI_WALK_AML_CALLBACK UserFunction, 875 void *Context); 876 877 ACPI_STATUS 878 AcpiUtValidateResource ( 879 void *Aml, 880 UINT8 *ReturnIndex); 881 882 UINT32 883 AcpiUtGetDescriptorLength ( 884 void *Aml); 885 886 UINT16 887 AcpiUtGetResourceLength ( 888 void *Aml); 889 890 UINT8 891 AcpiUtGetResourceHeaderLength ( 892 void *Aml); 893 894 UINT8 895 AcpiUtGetResourceType ( 896 void *Aml); 897 898 ACPI_STATUS 899 AcpiUtGetResourceEndTag ( 900 ACPI_OPERAND_OBJECT *ObjDesc, 901 UINT8 **EndTag); 902 903 904 /* 905 * utmutex - mutex support 906 */ 907 ACPI_STATUS 908 AcpiUtMutexInitialize ( 909 void); 910 911 void 912 AcpiUtMutexTerminate ( 913 void); 914 915 ACPI_STATUS 916 AcpiUtAcquireMutex ( 917 ACPI_MUTEX_HANDLE MutexId); 918 919 ACPI_STATUS 920 AcpiUtReleaseMutex ( 921 ACPI_MUTEX_HANDLE MutexId); 922 923 924 /* 925 * utalloc - memory allocation and object caching 926 */ 927 ACPI_STATUS 928 AcpiUtCreateCaches ( 929 void); 930 931 ACPI_STATUS 932 AcpiUtDeleteCaches ( 933 void); 934 935 ACPI_STATUS 936 AcpiUtValidateBuffer ( 937 ACPI_BUFFER *Buffer); 938 939 ACPI_STATUS 940 AcpiUtInitializeBuffer ( 941 ACPI_BUFFER *Buffer, 942 ACPI_SIZE RequiredLength); 943 944 void * 945 AcpiUtAllocate ( 946 ACPI_SIZE Size, 947 UINT32 Component, 948 const char *Module, 949 UINT32 Line); 950 951 void * 952 AcpiUtAllocateZeroed ( 953 ACPI_SIZE Size, 954 UINT32 Component, 955 const char *Module, 956 UINT32 Line); 957 958 #ifdef ACPI_DBG_TRACK_ALLOCATIONS 959 void * 960 AcpiUtAllocateAndTrack ( 961 ACPI_SIZE Size, 962 UINT32 Component, 963 const char *Module, 964 UINT32 Line); 965 966 void * 967 AcpiUtAllocateZeroedAndTrack ( 968 ACPI_SIZE Size, 969 UINT32 Component, 970 const char *Module, 971 UINT32 Line); 972 973 void 974 AcpiUtFreeAndTrack ( 975 void *Address, 976 UINT32 Component, 977 const char *Module, 978 UINT32 Line); 979 980 void 981 AcpiUtDumpAllocationInfo ( 982 void); 983 984 void 985 AcpiUtDumpAllocations ( 986 UINT32 Component, 987 const char *Module); 988 989 ACPI_STATUS 990 AcpiUtCreateList ( 991 char *ListName, 992 UINT16 ObjectSize, 993 ACPI_MEMORY_LIST **ReturnCache); 994 995 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 996 997 /* 998 * utaddress - address range check 999 */ 1000 ACPI_STATUS 1001 AcpiUtAddAddressRange ( 1002 ACPI_ADR_SPACE_TYPE SpaceId, 1003 ACPI_PHYSICAL_ADDRESS Address, 1004 UINT32 Length, 1005 ACPI_NAMESPACE_NODE *RegionNode); 1006 1007 void 1008 AcpiUtRemoveAddressRange ( 1009 ACPI_ADR_SPACE_TYPE SpaceId, 1010 ACPI_NAMESPACE_NODE *RegionNode); 1011 1012 UINT32 1013 AcpiUtCheckAddressRange ( 1014 ACPI_ADR_SPACE_TYPE SpaceId, 1015 ACPI_PHYSICAL_ADDRESS Address, 1016 UINT32 Length, 1017 BOOLEAN Warn); 1018 1019 void 1020 AcpiUtDeleteAddressLists ( 1021 void); 1022 1023 /* 1024 * utxferror - various error/warning output functions 1025 */ 1026 void ACPI_INTERNAL_VAR_XFACE 1027 AcpiUtPredefinedWarning ( 1028 const char *ModuleName, 1029 UINT32 LineNumber, 1030 char *Pathname, 1031 UINT8 NodeFlags, 1032 const char *Format, 1033 ...); 1034 1035 void ACPI_INTERNAL_VAR_XFACE 1036 AcpiUtPredefinedInfo ( 1037 const char *ModuleName, 1038 UINT32 LineNumber, 1039 char *Pathname, 1040 UINT8 NodeFlags, 1041 const char *Format, 1042 ...); 1043 1044 void 1045 AcpiUtNamespaceError ( 1046 const char *ModuleName, 1047 UINT32 LineNumber, 1048 const char *InternalName, 1049 ACPI_STATUS LookupStatus); 1050 1051 void 1052 AcpiUtMethodError ( 1053 const char *ModuleName, 1054 UINT32 LineNumber, 1055 const char *Message, 1056 ACPI_NAMESPACE_NODE *Node, 1057 const char *Path, 1058 ACPI_STATUS LookupStatus); 1059 1060 #endif /* _ACUTILS_H */ 1061