1 2 /****************************************************************************** 3 * 4 * Module Name: aslcompiler.h - common include file for iASL 5 * 6 *****************************************************************************/ 7 8 /****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2010, 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 118 #ifndef __ASLCOMPILER_H 119 #define __ASLCOMPILER_H 120 121 122 /* Microsoft-specific */ 123 124 #if (defined WIN32 || defined WIN64) 125 126 /* warn : used #pragma pack */ 127 #pragma warning(disable:4103) 128 129 /* warn : named type definition in parentheses */ 130 #pragma warning(disable:4115) 131 #endif 132 133 #include <stdio.h> 134 #include <stdlib.h> 135 #include <stdarg.h> 136 #include <string.h> 137 #include <errno.h> 138 #include <ctype.h> 139 140 141 #include <contrib/dev/acpica/include/acpi.h> 142 #include <contrib/dev/acpica/include/accommon.h> 143 #include <contrib/dev/acpica/include/amlresrc.h> 144 #include <contrib/dev/acpica/include/acdebug.h> 145 146 /* Compiler headers */ 147 148 #include <contrib/dev/acpica/compiler/asldefine.h> 149 #include <contrib/dev/acpica/compiler/asltypes.h> 150 #include <contrib/dev/acpica/compiler/aslmessages.h> 151 #include <contrib/dev/acpica/compiler/aslglobal.h> 152 153 154 /******************************************************************************* 155 * 156 * Compiler prototypes 157 * 158 ******************************************************************************/ 159 160 /* 161 * parser - generated from flex/bison, lex/yacc, etc. 162 */ 163 int 164 AslCompilerparse( 165 void); 166 167 ACPI_PARSE_OBJECT * 168 AslDoError ( 169 void); 170 171 int 172 AslCompilerlex( 173 void); 174 175 void 176 ResetCurrentLineBuffer ( 177 void); 178 179 void 180 InsertLineBuffer ( 181 int SourceChar); 182 183 int 184 AslPopInputFileStack ( 185 void); 186 187 void 188 AslPushInputFileStack ( 189 FILE *InputFile, 190 char *Filename); 191 192 /* 193 * aslstartup - entered from main() 194 */ 195 void 196 AslInitializeGlobals ( 197 void); 198 199 typedef 200 ACPI_STATUS (*ASL_PATHNAME_CALLBACK) ( 201 char *); 202 203 ACPI_STATUS 204 AslDoOnePathname ( 205 char *Pathname, 206 ASL_PATHNAME_CALLBACK Callback); 207 208 ACPI_STATUS 209 AslDoOneFile ( 210 char *Filename); 211 212 /* 213 * aslcompile - compile mainline 214 */ 215 void 216 AslCompilerSignon ( 217 UINT32 FileId); 218 219 void 220 AslCompilerFileHeader ( 221 UINT32 FileId); 222 223 int 224 CmDoCompile ( 225 void); 226 227 void 228 CmDoOutputFiles ( 229 void); 230 231 void 232 CmCleanupAndExit ( 233 void); 234 235 ACPI_STATUS 236 FlCheckForAscii ( 237 ASL_FILE_INFO *FileInfo); 238 239 240 /* 241 * aslanalyze - semantic analysis 242 */ 243 ACPI_STATUS 244 AnOtherSemanticAnalysisWalkBegin ( 245 ACPI_PARSE_OBJECT *Op, 246 UINT32 Level, 247 void *Context); 248 249 ACPI_STATUS 250 AnOtherSemanticAnalysisWalkEnd ( 251 ACPI_PARSE_OBJECT *Op, 252 UINT32 Level, 253 void *Context); 254 255 ACPI_STATUS 256 AnOperandTypecheckWalkBegin ( 257 ACPI_PARSE_OBJECT *Op, 258 UINT32 Level, 259 void *Context); 260 261 ACPI_STATUS 262 AnOperandTypecheckWalkEnd ( 263 ACPI_PARSE_OBJECT *Op, 264 UINT32 Level, 265 void *Context); 266 267 ACPI_STATUS 268 AnMethodAnalysisWalkBegin ( 269 ACPI_PARSE_OBJECT *Op, 270 UINT32 Level, 271 void *Context); 272 273 ACPI_STATUS 274 AnMethodAnalysisWalkEnd ( 275 ACPI_PARSE_OBJECT *Op, 276 UINT32 Level, 277 void *Context); 278 279 ACPI_STATUS 280 AnMethodTypingWalkBegin ( 281 ACPI_PARSE_OBJECT *Op, 282 UINT32 Level, 283 void *Context); 284 285 ACPI_STATUS 286 AnMethodTypingWalkEnd ( 287 ACPI_PARSE_OBJECT *Op, 288 UINT32 Level, 289 void *Context); 290 291 292 /* 293 * aslerror - error handling/reporting 294 */ 295 void 296 AslError ( 297 UINT8 Level, 298 UINT8 MessageId, 299 ACPI_PARSE_OBJECT *Op, 300 char *ExtraMessage); 301 302 void 303 AslCoreSubsystemError ( 304 ACPI_PARSE_OBJECT *Op, 305 ACPI_STATUS Status, 306 char *ExtraMessage, 307 BOOLEAN Abort); 308 309 int 310 AslCompilererror( 311 char *s); 312 313 void 314 AslCommonError ( 315 UINT8 Level, 316 UINT8 MessageId, 317 UINT32 CurrentLineNumber, 318 UINT32 LogicalLineNumber, 319 UINT32 LogicalByteOffset, 320 UINT32 Column, 321 char *Filename, 322 char *ExtraMessage); 323 324 void 325 AePrintException ( 326 UINT32 FileId, 327 ASL_ERROR_MSG *Enode, 328 char *Header); 329 330 void 331 AePrintErrorLog ( 332 UINT32 FileId); 333 334 void 335 AeClearErrorLog ( 336 void); 337 338 ACPI_PHYSICAL_ADDRESS 339 AeLocalGetRootPointer ( 340 void); 341 342 343 /* 344 * asllisting - generate all "listing" type files 345 */ 346 void 347 LsDoListings ( 348 void); 349 350 void 351 LsWriteNodeToAsmListing ( 352 ACPI_PARSE_OBJECT *Op); 353 354 void 355 LsWriteNode ( 356 ACPI_PARSE_OBJECT *Op, 357 UINT32 FileId); 358 359 void 360 LsDoHexOutput ( 361 void); 362 363 void 364 LsDumpParseTree ( 365 void); 366 367 /* 368 * aslfold - constant folding 369 */ 370 ACPI_STATUS 371 OpcAmlConstantWalk ( 372 ACPI_PARSE_OBJECT *Op, 373 UINT32 Level, 374 void *Context); 375 376 377 /* 378 * aslopcodes - generate AML opcodes 379 */ 380 ACPI_STATUS 381 OpcAmlOpcodeWalk ( 382 ACPI_PARSE_OBJECT *Op, 383 UINT32 Level, 384 void *Context); 385 386 ACPI_STATUS 387 OpcAmlOpcodeUpdateWalk ( 388 ACPI_PARSE_OBJECT *Op, 389 UINT32 Level, 390 void *Context); 391 392 void 393 OpcGenerateAmlOpcode ( 394 ACPI_PARSE_OBJECT *Op); 395 396 UINT32 397 OpcSetOptimalIntegerSize ( 398 ACPI_PARSE_OBJECT *Op); 399 400 void 401 OpcGetIntegerWidth ( 402 ACPI_PARSE_OBJECT *Op); 403 404 405 /* 406 * asloperands - generate AML operands for the AML opcodes 407 */ 408 ACPI_PARSE_OBJECT * 409 UtGetArg ( 410 ACPI_PARSE_OBJECT *Op, 411 UINT32 Argn); 412 413 void 414 OpnGenerateAmlOperands ( 415 ACPI_PARSE_OBJECT *Op); 416 417 void 418 OpnDoPackage ( 419 ACPI_PARSE_OBJECT *Op); 420 421 422 /* 423 * aslopt - optmization 424 */ 425 void 426 OptOptimizeNamePath ( 427 ACPI_PARSE_OBJECT *Op, 428 UINT32 Flags, 429 ACPI_WALK_STATE *WalkState, 430 char *AmlNameString, 431 ACPI_NAMESPACE_NODE *TargetNode); 432 433 434 /* 435 * aslcodegen - code generation 436 */ 437 void 438 CgGenerateAmlOutput ( 439 void); 440 441 442 /* 443 * aslfile 444 */ 445 void 446 FlOpenFile ( 447 UINT32 FileId, 448 char *Filename, 449 char *Mode); 450 451 452 /* 453 * asllength - calculate/adjust AML package lengths 454 */ 455 ACPI_STATUS 456 LnPackageLengthWalk ( 457 ACPI_PARSE_OBJECT *Op, 458 UINT32 Level, 459 void *Context); 460 461 ACPI_STATUS 462 LnInitLengthsWalk ( 463 ACPI_PARSE_OBJECT *Op, 464 UINT32 Level, 465 void *Context); 466 467 void 468 CgGenerateAmlLengths ( 469 ACPI_PARSE_OBJECT *Op); 470 471 472 /* 473 * aslmap - opcode mappings and reserved method names 474 */ 475 ACPI_OBJECT_TYPE 476 AslMapNamedOpcodeToDataType ( 477 UINT16 Opcode); 478 479 480 /* 481 * aslpredef - ACPI predefined names support 482 */ 483 void 484 ApCheckForPredefinedMethod ( 485 ACPI_PARSE_OBJECT *Op, 486 ASL_METHOD_INFO *MethodInfo); 487 488 void 489 ApCheckPredefinedReturnValue ( 490 ACPI_PARSE_OBJECT *Op, 491 ASL_METHOD_INFO *MethodInfo); 492 493 UINT32 494 ApCheckForPredefinedName ( 495 ACPI_PARSE_OBJECT *Op, 496 char *Name); 497 498 void 499 ApCheckForPredefinedObject ( 500 ACPI_PARSE_OBJECT *Op, 501 char *Name); 502 503 void 504 ApDisplayReservedNames ( 505 void); 506 507 508 /* 509 * asltransform - parse tree transformations 510 */ 511 ACPI_STATUS 512 TrAmlTransformWalk ( 513 ACPI_PARSE_OBJECT *Op, 514 UINT32 Level, 515 void *Context); 516 517 518 /* 519 * asltree - parse tree support 520 */ 521 ACPI_STATUS 522 TrWalkParseTree ( 523 ACPI_PARSE_OBJECT *Op, 524 UINT32 Visitation, 525 ASL_WALK_CALLBACK DescendingCallback, 526 ASL_WALK_CALLBACK AscendingCallback, 527 void *Context); 528 529 /* Values for "Visitation" parameter above */ 530 531 #define ASL_WALK_VISIT_DOWNWARD 0x01 532 #define ASL_WALK_VISIT_UPWARD 0x02 533 #define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD) 534 535 536 ACPI_PARSE_OBJECT * 537 TrAllocateNode ( 538 UINT32 ParseOpcode); 539 540 void 541 TrReleaseNode ( 542 ACPI_PARSE_OBJECT *Op); 543 544 ACPI_PARSE_OBJECT * 545 TrUpdateNode ( 546 UINT32 ParseOpcode, 547 ACPI_PARSE_OBJECT *Op); 548 549 ACPI_PARSE_OBJECT * 550 TrCreateNode ( 551 UINT32 ParseOpcode, 552 UINT32 NumChildren, 553 ...); 554 555 ACPI_PARSE_OBJECT * 556 TrCreateLeafNode ( 557 UINT32 ParseOpcode); 558 559 ACPI_PARSE_OBJECT * 560 TrCreateValuedLeafNode ( 561 UINT32 ParseOpcode, 562 UINT64 Value); 563 564 ACPI_PARSE_OBJECT * 565 TrLinkChildren ( 566 ACPI_PARSE_OBJECT *Op, 567 UINT32 NumChildren, 568 ...); 569 570 void 571 TrSetEndLineNumber ( 572 ACPI_PARSE_OBJECT *Op); 573 574 void 575 TrWalkTree ( 576 void); 577 578 ACPI_PARSE_OBJECT * 579 TrLinkPeerNode ( 580 ACPI_PARSE_OBJECT *Op1, 581 ACPI_PARSE_OBJECT *Op2); 582 583 ACPI_PARSE_OBJECT * 584 TrLinkChildNode ( 585 ACPI_PARSE_OBJECT *Op1, 586 ACPI_PARSE_OBJECT *Op2); 587 588 ACPI_PARSE_OBJECT * 589 TrSetNodeFlags ( 590 ACPI_PARSE_OBJECT *Op, 591 UINT32 Flags); 592 593 ACPI_PARSE_OBJECT * 594 TrLinkPeerNodes ( 595 UINT32 NumPeers, 596 ...); 597 598 599 /* 600 * aslfiles - File I/O support 601 */ 602 void 603 AslAbort ( 604 void); 605 606 void 607 FlAddIncludeDirectory ( 608 char *Dir); 609 610 void 611 FlOpenIncludeFile ( 612 ACPI_PARSE_OBJECT *Op); 613 614 void 615 FlFileError ( 616 UINT32 FileId, 617 UINT8 ErrorId); 618 619 UINT32 620 FlGetFileSize ( 621 UINT32 FileId); 622 623 ACPI_STATUS 624 FlReadFile ( 625 UINT32 FileId, 626 void *Buffer, 627 UINT32 Length); 628 629 void 630 FlWriteFile ( 631 UINT32 FileId, 632 void *Buffer, 633 UINT32 Length); 634 635 void 636 FlSeekFile ( 637 UINT32 FileId, 638 long Offset); 639 640 void 641 FlCloseFile ( 642 UINT32 FileId); 643 644 void 645 FlPrintFile ( 646 UINT32 FileId, 647 char *Format, 648 ...); 649 650 void 651 FlSetLineNumber ( 652 ACPI_PARSE_OBJECT *Op); 653 654 ACPI_STATUS 655 FlOpenInputFile ( 656 char *InputFilename); 657 658 ACPI_STATUS 659 FlOpenAmlOutputFile ( 660 char *InputFilename); 661 662 ACPI_STATUS 663 FlOpenMiscOutputFiles ( 664 char *InputFilename); 665 666 667 /* 668 * asload - load namespace in prep for cross reference 669 */ 670 ACPI_STATUS 671 LdLoadNamespace ( 672 ACPI_PARSE_OBJECT *RootOp); 673 674 675 /* 676 * asllookup - namespace cross reference 677 */ 678 ACPI_STATUS 679 LkCrossReferenceNamespace ( 680 void); 681 682 void 683 LkFindUnreferencedObjects ( 684 void); 685 686 ACPI_STATUS 687 LsDisplayNamespace ( 688 void); 689 690 void 691 LsSetupNsList ( 692 void *Handle); 693 694 695 /* 696 * aslutils - common compiler utilites 697 */ 698 void 699 DbgPrint ( 700 UINT32 Type, 701 char *Format, 702 ...); 703 704 /* Type values for above */ 705 706 #define ASL_DEBUG_OUTPUT 0 707 #define ASL_PARSE_OUTPUT 1 708 #define ASL_TREE_OUTPUT 2 709 710 void 711 UtDisplaySupportedTables ( 712 void); 713 714 void 715 UtDisplayConstantOpcodes ( 716 void); 717 718 UINT8 719 UtBeginEvent ( 720 char *Name); 721 722 void 723 UtEndEvent ( 724 UINT8 Event); 725 726 void * 727 UtLocalCalloc ( 728 UINT32 Size); 729 730 void 731 UtPrintFormattedName ( 732 UINT16 ParseOpcode, 733 UINT32 Level); 734 735 void 736 UtDisplaySummary ( 737 UINT32 FileId); 738 739 UINT8 740 UtHexCharToValue ( 741 int HexChar); 742 743 void 744 UtConvertByteToHex ( 745 UINT8 RawByte, 746 UINT8 *Buffer); 747 748 void 749 UtConvertByteToAsmHex ( 750 UINT8 RawByte, 751 UINT8 *Buffer); 752 753 char * 754 UtGetOpName ( 755 UINT32 ParseOpcode); 756 757 void 758 UtSetParseOpName ( 759 ACPI_PARSE_OBJECT *Op); 760 761 char * 762 UtGetStringBuffer ( 763 UINT32 Length); 764 765 ACPI_STATUS 766 UtInternalizeName ( 767 char *ExternalName, 768 char **ConvertedName); 769 770 void 771 UtAttachNamepathToOwner ( 772 ACPI_PARSE_OBJECT *Op, 773 ACPI_PARSE_OBJECT *NameNode); 774 775 ACPI_PARSE_OBJECT * 776 UtCheckIntegerRange ( 777 ACPI_PARSE_OBJECT *Op, 778 UINT32 LowValue, 779 UINT32 HighValue); 780 781 UINT64 782 UtDoConstant ( 783 char *String); 784 785 786 /* 787 * aslresource - Resource template generation utilities 788 */ 789 void 790 RsSmallAddressCheck ( 791 UINT8 Type, 792 UINT32 Minimum, 793 UINT32 Maximum, 794 UINT32 Length, 795 UINT32 Alignment, 796 ACPI_PARSE_OBJECT *MinOp, 797 ACPI_PARSE_OBJECT *MaxOp, 798 ACPI_PARSE_OBJECT *LengthOp, 799 ACPI_PARSE_OBJECT *AlignOp, 800 ACPI_PARSE_OBJECT *Op); 801 802 void 803 RsLargeAddressCheck ( 804 UINT64 Minimum, 805 UINT64 Maximum, 806 UINT64 Length, 807 UINT64 Granularity, 808 UINT8 Flags, 809 ACPI_PARSE_OBJECT *MinOp, 810 ACPI_PARSE_OBJECT *MaxOp, 811 ACPI_PARSE_OBJECT *LengthOp, 812 ACPI_PARSE_OBJECT *GranOp, 813 ACPI_PARSE_OBJECT *Op); 814 815 UINT16 816 RsGetStringDataLength ( 817 ACPI_PARSE_OBJECT *InitializerOp); 818 819 ASL_RESOURCE_NODE * 820 RsAllocateResourceNode ( 821 UINT32 Size); 822 823 void 824 RsCreateBitField ( 825 ACPI_PARSE_OBJECT *Op, 826 char *Name, 827 UINT32 ByteOffset, 828 UINT32 BitOffset); 829 830 void 831 RsCreateByteField ( 832 ACPI_PARSE_OBJECT *Op, 833 char *Name, 834 UINT32 ByteOffset); 835 836 void 837 RsSetFlagBits ( 838 UINT8 *Flags, 839 ACPI_PARSE_OBJECT *Op, 840 UINT8 Position, 841 UINT8 DefaultBit); 842 843 ACPI_PARSE_OBJECT * 844 RsCompleteNodeAndGetNext ( 845 ACPI_PARSE_OBJECT *Op); 846 847 void 848 RsCheckListForDuplicates ( 849 ACPI_PARSE_OBJECT *Op); 850 851 ASL_RESOURCE_NODE * 852 RsDoOneResourceDescriptor ( 853 ACPI_PARSE_OBJECT *DescriptorTypeOp, 854 UINT32 CurrentByteOffset, 855 UINT8 *State); 856 857 /* Values for State above */ 858 859 #define ACPI_RSTATE_NORMAL 0 860 #define ACPI_RSTATE_START_DEPENDENT 1 861 #define ACPI_RSTATE_DEPENDENT_LIST 2 862 863 UINT32 864 RsLinkDescriptorChain ( 865 ASL_RESOURCE_NODE **PreviousRnode, 866 ASL_RESOURCE_NODE *Rnode); 867 868 void 869 RsDoResourceTemplate ( 870 ACPI_PARSE_OBJECT *Op); 871 872 873 /* 874 * aslrestype1 - Miscellaneous Small descriptors 875 */ 876 ASL_RESOURCE_NODE * 877 RsDoEndTagDescriptor ( 878 ACPI_PARSE_OBJECT *Op, 879 UINT32 CurrentByteOffset); 880 881 ASL_RESOURCE_NODE * 882 RsDoEndDependentDescriptor ( 883 ACPI_PARSE_OBJECT *Op, 884 UINT32 CurrentByteOffset); 885 886 ASL_RESOURCE_NODE * 887 RsDoMemory24Descriptor ( 888 ACPI_PARSE_OBJECT *Op, 889 UINT32 CurrentByteOffset); 890 891 ASL_RESOURCE_NODE * 892 RsDoMemory32Descriptor ( 893 ACPI_PARSE_OBJECT *Op, 894 UINT32 CurrentByteOffset); 895 896 ASL_RESOURCE_NODE * 897 RsDoMemory32FixedDescriptor ( 898 ACPI_PARSE_OBJECT *Op, 899 UINT32 CurrentByteOffset); 900 901 ASL_RESOURCE_NODE * 902 RsDoStartDependentDescriptor ( 903 ACPI_PARSE_OBJECT *Op, 904 UINT32 CurrentByteOffset); 905 906 ASL_RESOURCE_NODE * 907 RsDoStartDependentNoPriDescriptor ( 908 ACPI_PARSE_OBJECT *Op, 909 UINT32 CurrentByteOffset); 910 911 ASL_RESOURCE_NODE * 912 RsDoVendorSmallDescriptor ( 913 ACPI_PARSE_OBJECT *Op, 914 UINT32 CurrentByteOffset); 915 916 917 /* 918 * aslrestype1i - I/O-related Small descriptors 919 */ 920 ASL_RESOURCE_NODE * 921 RsDoDmaDescriptor ( 922 ACPI_PARSE_OBJECT *Op, 923 UINT32 CurrentByteOffset); 924 925 ASL_RESOURCE_NODE * 926 RsDoFixedIoDescriptor ( 927 ACPI_PARSE_OBJECT *Op, 928 UINT32 CurrentByteOffset); 929 930 ASL_RESOURCE_NODE * 931 RsDoIoDescriptor ( 932 ACPI_PARSE_OBJECT *Op, 933 UINT32 CurrentByteOffset); 934 935 ASL_RESOURCE_NODE * 936 RsDoIrqDescriptor ( 937 ACPI_PARSE_OBJECT *Op, 938 UINT32 CurrentByteOffset); 939 940 ASL_RESOURCE_NODE * 941 RsDoIrqNoFlagsDescriptor ( 942 ACPI_PARSE_OBJECT *Op, 943 UINT32 CurrentByteOffset); 944 945 946 /* 947 * aslrestype2 - Large resource descriptors 948 */ 949 ASL_RESOURCE_NODE * 950 RsDoInterruptDescriptor ( 951 ACPI_PARSE_OBJECT *Op, 952 UINT32 CurrentByteOffset); 953 954 ASL_RESOURCE_NODE * 955 RsDoVendorLargeDescriptor ( 956 ACPI_PARSE_OBJECT *Op, 957 UINT32 CurrentByteOffset); 958 959 ASL_RESOURCE_NODE * 960 RsDoGeneralRegisterDescriptor ( 961 ACPI_PARSE_OBJECT *Op, 962 UINT32 CurrentByteOffset); 963 964 965 /* 966 * aslrestype2d - DWord address descriptors 967 */ 968 ASL_RESOURCE_NODE * 969 RsDoDwordIoDescriptor ( 970 ACPI_PARSE_OBJECT *Op, 971 UINT32 CurrentByteOffset); 972 973 ASL_RESOURCE_NODE * 974 RsDoDwordMemoryDescriptor ( 975 ACPI_PARSE_OBJECT *Op, 976 UINT32 CurrentByteOffset); 977 978 ASL_RESOURCE_NODE * 979 RsDoDwordSpaceDescriptor ( 980 ACPI_PARSE_OBJECT *Op, 981 UINT32 CurrentByteOffset); 982 983 984 /* 985 * aslrestype2e - Extended address descriptors 986 */ 987 ASL_RESOURCE_NODE * 988 RsDoExtendedIoDescriptor ( 989 ACPI_PARSE_OBJECT *Op, 990 UINT32 CurrentByteOffset); 991 992 ASL_RESOURCE_NODE * 993 RsDoExtendedMemoryDescriptor ( 994 ACPI_PARSE_OBJECT *Op, 995 UINT32 CurrentByteOffset); 996 997 ASL_RESOURCE_NODE * 998 RsDoExtendedSpaceDescriptor ( 999 ACPI_PARSE_OBJECT *Op, 1000 UINT32 CurrentByteOffset); 1001 1002 1003 /* 1004 * aslrestype2q - QWord address descriptors 1005 */ 1006 ASL_RESOURCE_NODE * 1007 RsDoQwordIoDescriptor ( 1008 ACPI_PARSE_OBJECT *Op, 1009 UINT32 CurrentByteOffset); 1010 1011 ASL_RESOURCE_NODE * 1012 RsDoQwordMemoryDescriptor ( 1013 ACPI_PARSE_OBJECT *Op, 1014 UINT32 CurrentByteOffset); 1015 1016 ASL_RESOURCE_NODE * 1017 RsDoQwordSpaceDescriptor ( 1018 ACPI_PARSE_OBJECT *Op, 1019 UINT32 CurrentByteOffset); 1020 1021 1022 /* 1023 * aslrestype2w - Word address descriptors 1024 */ 1025 ASL_RESOURCE_NODE * 1026 RsDoWordIoDescriptor ( 1027 ACPI_PARSE_OBJECT *Op, 1028 UINT32 CurrentByteOffset); 1029 1030 ASL_RESOURCE_NODE * 1031 RsDoWordSpaceDescriptor ( 1032 ACPI_PARSE_OBJECT *Op, 1033 UINT32 CurrentByteOffset); 1034 1035 ASL_RESOURCE_NODE * 1036 RsDoWordBusNumberDescriptor ( 1037 ACPI_PARSE_OBJECT *Op, 1038 UINT32 CurrentByteOffset); 1039 1040 /* 1041 * Entry to data table compiler subsystem 1042 */ 1043 ACPI_STATUS 1044 DtDoCompile( 1045 void); 1046 1047 ACPI_STATUS 1048 DtCreateTemplates ( 1049 char *Signature); 1050 1051 #endif /* __ASLCOMPILER_H */ 1052 1053