1 /****************************************************************************** 2 * 3 * Module Name: aslcompiler.h - common include file for iASL 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2013, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44 45 #ifndef __ASLCOMPILER_H 46 #define __ASLCOMPILER_H 47 48 #include <contrib/dev/acpica/include/acpi.h> 49 #include <contrib/dev/acpica/include/accommon.h> 50 #include <contrib/dev/acpica/include/amlresrc.h> 51 #include <contrib/dev/acpica/include/acdebug.h> 52 53 /* Microsoft-specific */ 54 55 #if (defined WIN32 || defined WIN64) 56 57 /* warn : used #pragma pack */ 58 #pragma warning(disable:4103) 59 60 /* warn : named type definition in parentheses */ 61 #pragma warning(disable:4115) 62 #endif 63 64 #include <stdio.h> 65 #include <stdlib.h> 66 #include <stdarg.h> 67 #include <string.h> 68 #include <errno.h> 69 #include <ctype.h> 70 71 /* Compiler headers */ 72 73 #include <contrib/dev/acpica/compiler/asldefine.h> 74 #include <contrib/dev/acpica/compiler/asltypes.h> 75 #include <contrib/dev/acpica/compiler/aslmessages.h> 76 #include <contrib/dev/acpica/compiler/aslglobal.h> 77 #include <contrib/dev/acpica/compiler/preprocess.h> 78 79 80 /******************************************************************************* 81 * 82 * Compiler prototypes 83 * 84 ******************************************************************************/ 85 86 /* 87 * Main ASL parser - generated from flex/bison, lex/yacc, etc. 88 */ 89 ACPI_PARSE_OBJECT * 90 AslDoError ( 91 void); 92 93 int 94 AslCompilerlex( 95 void); 96 97 void 98 AslResetCurrentLineBuffer ( 99 void); 100 101 void 102 AslInsertLineBuffer ( 103 int SourceChar); 104 105 int 106 AslPopInputFileStack ( 107 void); 108 109 void 110 AslPushInputFileStack ( 111 FILE *InputFile, 112 char *Filename); 113 114 /* 115 * aslstartup - entered from main() 116 */ 117 void 118 AslInitializeGlobals ( 119 void); 120 121 typedef 122 ACPI_STATUS (*ASL_PATHNAME_CALLBACK) ( 123 char *); 124 125 ACPI_STATUS 126 AslDoOnePathname ( 127 char *Pathname, 128 ASL_PATHNAME_CALLBACK Callback); 129 130 ACPI_STATUS 131 AslDoOneFile ( 132 char *Filename); 133 134 ACPI_STATUS 135 AslCheckForErrorExit ( 136 void); 137 138 139 /* 140 * aslcompile - compile mainline 141 */ 142 void 143 AslCompilerSignon ( 144 UINT32 FileId); 145 146 void 147 AslCompilerFileHeader ( 148 UINT32 FileId); 149 150 int 151 CmDoCompile ( 152 void); 153 154 void 155 CmDoOutputFiles ( 156 void); 157 158 void 159 CmCleanupAndExit ( 160 void); 161 162 ACPI_STATUS 163 FlCheckForAscii ( 164 FILE *Handle, 165 char *Filename, 166 BOOLEAN DisplayErrors); 167 168 169 /* 170 * aslwalks - semantic analysis and parse tree walks 171 */ 172 ACPI_STATUS 173 AnOtherSemanticAnalysisWalkBegin ( 174 ACPI_PARSE_OBJECT *Op, 175 UINT32 Level, 176 void *Context); 177 178 ACPI_STATUS 179 AnOtherSemanticAnalysisWalkEnd ( 180 ACPI_PARSE_OBJECT *Op, 181 UINT32 Level, 182 void *Context); 183 184 ACPI_STATUS 185 AnOperandTypecheckWalkEnd ( 186 ACPI_PARSE_OBJECT *Op, 187 UINT32 Level, 188 void *Context); 189 190 ACPI_STATUS 191 AnMethodTypingWalkEnd ( 192 ACPI_PARSE_OBJECT *Op, 193 UINT32 Level, 194 void *Context); 195 196 197 /* 198 * aslmethod - Control method analysis walk 199 */ 200 ACPI_STATUS 201 MtMethodAnalysisWalkBegin ( 202 ACPI_PARSE_OBJECT *Op, 203 UINT32 Level, 204 void *Context); 205 206 ACPI_STATUS 207 MtMethodAnalysisWalkEnd ( 208 ACPI_PARSE_OBJECT *Op, 209 UINT32 Level, 210 void *Context); 211 212 213 /* 214 * aslbtypes - bitfield data types 215 */ 216 UINT32 217 AnMapObjTypeToBtype ( 218 ACPI_PARSE_OBJECT *Op); 219 220 UINT32 221 AnMapArgTypeToBtype ( 222 UINT32 ArgType); 223 224 UINT32 225 AnGetBtype ( 226 ACPI_PARSE_OBJECT *Op); 227 228 void 229 AnFormatBtype ( 230 char *Buffer, 231 UINT32 Btype); 232 233 234 /* 235 * aslanalyze - Support functions for parse tree walks 236 */ 237 void 238 AnCheckId ( 239 ACPI_PARSE_OBJECT *Op, 240 ACPI_NAME Type); 241 242 /* Values for Type argument above */ 243 244 #define ASL_TYPE_HID 0 245 #define ASL_TYPE_CID 1 246 247 BOOLEAN 248 AnIsInternalMethod ( 249 ACPI_PARSE_OBJECT *Op); 250 251 UINT32 252 AnGetInternalMethodReturnType ( 253 ACPI_PARSE_OBJECT *Op); 254 255 BOOLEAN 256 AnLastStatementIsReturn ( 257 ACPI_PARSE_OBJECT *Op); 258 259 void 260 AnCheckMethodReturnValue ( 261 ACPI_PARSE_OBJECT *Op, 262 const ACPI_OPCODE_INFO *OpInfo, 263 ACPI_PARSE_OBJECT *ArgOp, 264 UINT32 RequiredBtypes, 265 UINT32 ThisNodeBtype); 266 267 BOOLEAN 268 AnIsResultUsed ( 269 ACPI_PARSE_OBJECT *Op); 270 271 void 272 ApCheckForGpeNameConflict ( 273 ACPI_PARSE_OBJECT *Op); 274 275 void 276 ApCheckRegMethod ( 277 ACPI_PARSE_OBJECT *Op); 278 279 280 /* 281 * aslerror - error handling/reporting 282 */ 283 void 284 AslError ( 285 UINT8 Level, 286 UINT8 MessageId, 287 ACPI_PARSE_OBJECT *Op, 288 char *ExtraMessage); 289 290 void 291 AslCoreSubsystemError ( 292 ACPI_PARSE_OBJECT *Op, 293 ACPI_STATUS Status, 294 char *ExtraMessage, 295 BOOLEAN Abort); 296 297 int 298 AslCompilererror( 299 const char *s); 300 301 void 302 AslCommonError ( 303 UINT8 Level, 304 UINT8 MessageId, 305 UINT32 CurrentLineNumber, 306 UINT32 LogicalLineNumber, 307 UINT32 LogicalByteOffset, 308 UINT32 Column, 309 char *Filename, 310 char *ExtraMessage); 311 312 void 313 AslCommonError2 ( 314 UINT8 Level, 315 UINT8 MessageId, 316 UINT32 LineNumber, 317 UINT32 Column, 318 char *SourceLine, 319 char *Filename, 320 char *ExtraMessage); 321 322 void 323 AePrintException ( 324 UINT32 FileId, 325 ASL_ERROR_MSG *Enode, 326 char *Header); 327 328 void 329 AePrintErrorLog ( 330 UINT32 FileId); 331 332 void 333 AeClearErrorLog ( 334 void); 335 336 ACPI_PHYSICAL_ADDRESS 337 AeLocalGetRootPointer ( 338 void); 339 340 341 /* 342 * asllisting - generate all "listing" type files 343 */ 344 void 345 LsDoListings ( 346 void); 347 348 void 349 LsDumpAsciiInComment ( 350 UINT32 FileId, 351 UINT32 Count, 352 UINT8 *Buffer); 353 354 void 355 LsWriteNodeToAsmListing ( 356 ACPI_PARSE_OBJECT *Op); 357 358 void 359 LsWriteNode ( 360 ACPI_PARSE_OBJECT *Op, 361 UINT32 FileId); 362 363 void 364 LsDumpParseTree ( 365 void); 366 367 368 /* 369 * aslhex - generate all "hex" output files (C, ASM, ASL) 370 */ 371 void 372 HxDoHexOutput ( 373 void); 374 375 376 /* 377 * aslfold - constant folding 378 */ 379 ACPI_STATUS 380 OpcAmlConstantWalk ( 381 ACPI_PARSE_OBJECT *Op, 382 UINT32 Level, 383 void *Context); 384 385 386 /* 387 * aslopcodes - generate AML opcodes 388 */ 389 ACPI_STATUS 390 OpcAmlOpcodeWalk ( 391 ACPI_PARSE_OBJECT *Op, 392 UINT32 Level, 393 void *Context); 394 395 ACPI_STATUS 396 OpcAmlOpcodeUpdateWalk ( 397 ACPI_PARSE_OBJECT *Op, 398 UINT32 Level, 399 void *Context); 400 401 void 402 OpcGenerateAmlOpcode ( 403 ACPI_PARSE_OBJECT *Op); 404 405 UINT32 406 OpcSetOptimalIntegerSize ( 407 ACPI_PARSE_OBJECT *Op); 408 409 void 410 OpcGetIntegerWidth ( 411 ACPI_PARSE_OBJECT *Op); 412 413 414 /* 415 * asloperands - generate AML operands for the AML opcodes 416 */ 417 ACPI_PARSE_OBJECT * 418 UtGetArg ( 419 ACPI_PARSE_OBJECT *Op, 420 UINT32 Argn); 421 422 void 423 OpnGenerateAmlOperands ( 424 ACPI_PARSE_OBJECT *Op); 425 426 void 427 OpnDoPackage ( 428 ACPI_PARSE_OBJECT *Op); 429 430 431 /* 432 * aslopt - optmization 433 */ 434 void 435 OptOptimizeNamePath ( 436 ACPI_PARSE_OBJECT *Op, 437 UINT32 Flags, 438 ACPI_WALK_STATE *WalkState, 439 char *AmlNameString, 440 ACPI_NAMESPACE_NODE *TargetNode); 441 442 443 /* 444 * aslcodegen - code generation 445 */ 446 void 447 CgGenerateAmlOutput ( 448 void); 449 450 451 /* 452 * aslfile 453 */ 454 void 455 FlOpenFile ( 456 UINT32 FileId, 457 char *Filename, 458 char *Mode); 459 460 461 /* 462 * asllength - calculate/adjust AML package lengths 463 */ 464 ACPI_STATUS 465 LnPackageLengthWalk ( 466 ACPI_PARSE_OBJECT *Op, 467 UINT32 Level, 468 void *Context); 469 470 ACPI_STATUS 471 LnInitLengthsWalk ( 472 ACPI_PARSE_OBJECT *Op, 473 UINT32 Level, 474 void *Context); 475 476 void 477 CgGenerateAmlLengths ( 478 ACPI_PARSE_OBJECT *Op); 479 480 481 /* 482 * aslmap - opcode mappings and reserved method names 483 */ 484 ACPI_OBJECT_TYPE 485 AslMapNamedOpcodeToDataType ( 486 UINT16 Opcode); 487 488 489 /* 490 * aslpredef - ACPI predefined names support 491 */ 492 BOOLEAN 493 ApCheckForPredefinedMethod ( 494 ACPI_PARSE_OBJECT *Op, 495 ASL_METHOD_INFO *MethodInfo); 496 497 void 498 ApCheckPredefinedReturnValue ( 499 ACPI_PARSE_OBJECT *Op, 500 ASL_METHOD_INFO *MethodInfo); 501 502 UINT32 503 ApCheckForPredefinedName ( 504 ACPI_PARSE_OBJECT *Op, 505 char *Name); 506 507 void 508 ApCheckForPredefinedObject ( 509 ACPI_PARSE_OBJECT *Op, 510 char *Name); 511 512 void 513 ApDisplayReservedNames ( 514 void); 515 516 517 /* 518 * asltransform - parse tree transformations 519 */ 520 ACPI_STATUS 521 TrAmlTransformWalk ( 522 ACPI_PARSE_OBJECT *Op, 523 UINT32 Level, 524 void *Context); 525 526 527 /* 528 * asltree - parse tree support 529 */ 530 ACPI_STATUS 531 TrWalkParseTree ( 532 ACPI_PARSE_OBJECT *Op, 533 UINT32 Visitation, 534 ASL_WALK_CALLBACK DescendingCallback, 535 ASL_WALK_CALLBACK AscendingCallback, 536 void *Context); 537 538 /* Values for "Visitation" parameter above */ 539 540 #define ASL_WALK_VISIT_DOWNWARD 0x01 541 #define ASL_WALK_VISIT_UPWARD 0x02 542 #define ASL_WALK_VISIT_TWICE (ASL_WALK_VISIT_DOWNWARD | ASL_WALK_VISIT_UPWARD) 543 544 545 ACPI_PARSE_OBJECT * 546 TrAllocateNode ( 547 UINT32 ParseOpcode); 548 549 void 550 TrReleaseNode ( 551 ACPI_PARSE_OBJECT *Op); 552 553 ACPI_PARSE_OBJECT * 554 TrUpdateNode ( 555 UINT32 ParseOpcode, 556 ACPI_PARSE_OBJECT *Op); 557 558 ACPI_PARSE_OBJECT * 559 TrCreateNode ( 560 UINT32 ParseOpcode, 561 UINT32 NumChildren, 562 ...); 563 564 ACPI_PARSE_OBJECT * 565 TrCreateLeafNode ( 566 UINT32 ParseOpcode); 567 568 ACPI_PARSE_OBJECT * 569 TrCreateValuedLeafNode ( 570 UINT32 ParseOpcode, 571 UINT64 Value); 572 573 ACPI_PARSE_OBJECT * 574 TrCreateConstantLeafNode ( 575 UINT32 ParseOpcode); 576 577 ACPI_PARSE_OBJECT * 578 TrLinkChildren ( 579 ACPI_PARSE_OBJECT *Op, 580 UINT32 NumChildren, 581 ...); 582 583 void 584 TrSetEndLineNumber ( 585 ACPI_PARSE_OBJECT *Op); 586 587 void 588 TrWalkTree ( 589 void); 590 591 ACPI_PARSE_OBJECT * 592 TrLinkPeerNode ( 593 ACPI_PARSE_OBJECT *Op1, 594 ACPI_PARSE_OBJECT *Op2); 595 596 ACPI_PARSE_OBJECT * 597 TrLinkChildNode ( 598 ACPI_PARSE_OBJECT *Op1, 599 ACPI_PARSE_OBJECT *Op2); 600 601 ACPI_PARSE_OBJECT * 602 TrSetNodeFlags ( 603 ACPI_PARSE_OBJECT *Op, 604 UINT32 Flags); 605 606 ACPI_PARSE_OBJECT * 607 TrSetNodeAmlLength ( 608 ACPI_PARSE_OBJECT *Op, 609 UINT32 Length); 610 611 ACPI_PARSE_OBJECT * 612 TrLinkPeerNodes ( 613 UINT32 NumPeers, 614 ...); 615 616 617 /* 618 * aslfiles - File I/O support 619 */ 620 void 621 AslAbort ( 622 void); 623 624 void 625 FlAddIncludeDirectory ( 626 char *Dir); 627 628 char * 629 FlMergePathnames ( 630 char *PrefixDir, 631 char *FilePathname); 632 633 void 634 FlOpenIncludeFile ( 635 ACPI_PARSE_OBJECT *Op); 636 637 void 638 FlFileError ( 639 UINT32 FileId, 640 UINT8 ErrorId); 641 642 UINT32 643 FlGetFileSize ( 644 UINT32 FileId); 645 646 ACPI_STATUS 647 FlReadFile ( 648 UINT32 FileId, 649 void *Buffer, 650 UINT32 Length); 651 652 void 653 FlWriteFile ( 654 UINT32 FileId, 655 void *Buffer, 656 UINT32 Length); 657 658 void 659 FlSeekFile ( 660 UINT32 FileId, 661 long Offset); 662 663 void 664 FlCloseFile ( 665 UINT32 FileId); 666 667 void 668 FlPrintFile ( 669 UINT32 FileId, 670 char *Format, 671 ...); 672 673 void 674 FlDeleteFile ( 675 UINT32 FileId); 676 677 void 678 FlSetLineNumber ( 679 UINT32 LineNumber); 680 681 void 682 FlSetFilename ( 683 char *Filename); 684 685 ACPI_STATUS 686 FlOpenInputFile ( 687 char *InputFilename); 688 689 ACPI_STATUS 690 FlOpenAmlOutputFile ( 691 char *InputFilename); 692 693 ACPI_STATUS 694 FlOpenMiscOutputFiles ( 695 char *InputFilename); 696 697 698 /* 699 * asload - load namespace in prep for cross reference 700 */ 701 ACPI_STATUS 702 LdLoadNamespace ( 703 ACPI_PARSE_OBJECT *RootOp); 704 705 706 /* 707 * asllookup - namespace lookup functions 708 */ 709 void 710 LkFindUnreferencedObjects ( 711 void); 712 713 714 /* 715 * aslnamesp - namespace output file generation 716 */ 717 ACPI_STATUS 718 NsDisplayNamespace ( 719 void); 720 721 void 722 NsSetupNamespaceListing ( 723 void *Handle); 724 725 726 /* 727 * aslxref - namespace cross reference 728 */ 729 ACPI_STATUS 730 XfCrossReferenceNamespace ( 731 void); 732 733 734 /* 735 * aslutils - common compiler utilites 736 */ 737 void 738 DbgPrint ( 739 UINT32 Type, 740 char *Format, 741 ...); 742 743 /* Type values for above */ 744 745 #define ASL_DEBUG_OUTPUT 0 746 #define ASL_PARSE_OUTPUT 1 747 #define ASL_TREE_OUTPUT 2 748 749 void 750 UtDisplaySupportedTables ( 751 void); 752 753 void 754 UtDisplayConstantOpcodes ( 755 void); 756 757 UINT8 758 UtBeginEvent ( 759 char *Name); 760 761 void 762 UtEndEvent ( 763 UINT8 Event); 764 765 void * 766 UtLocalCalloc ( 767 UINT32 Size); 768 769 void 770 UtPrintFormattedName ( 771 UINT16 ParseOpcode, 772 UINT32 Level); 773 774 void 775 UtDisplaySummary ( 776 UINT32 FileId); 777 778 UINT8 779 UtHexCharToValue ( 780 int HexChar); 781 782 void 783 UtConvertByteToHex ( 784 UINT8 RawByte, 785 UINT8 *Buffer); 786 787 void 788 UtConvertByteToAsmHex ( 789 UINT8 RawByte, 790 UINT8 *Buffer); 791 792 char * 793 UtGetOpName ( 794 UINT32 ParseOpcode); 795 796 void 797 UtSetParseOpName ( 798 ACPI_PARSE_OBJECT *Op); 799 800 char * 801 UtGetStringBuffer ( 802 UINT32 Length); 803 804 void 805 UtExpandLineBuffers ( 806 void); 807 808 ACPI_STATUS 809 UtInternalizeName ( 810 char *ExternalName, 811 char **ConvertedName); 812 813 void 814 UtAttachNamepathToOwner ( 815 ACPI_PARSE_OBJECT *Op, 816 ACPI_PARSE_OBJECT *NameNode); 817 818 ACPI_PARSE_OBJECT * 819 UtCheckIntegerRange ( 820 ACPI_PARSE_OBJECT *Op, 821 UINT32 LowValue, 822 UINT32 HighValue); 823 824 UINT64 825 UtDoConstant ( 826 char *String); 827 828 ACPI_STATUS 829 UtStrtoul64 ( 830 char *String, 831 UINT32 Base, 832 UINT64 *RetInteger); 833 834 835 /* 836 * asluuid - UUID support 837 */ 838 ACPI_STATUS 839 AuValidateUuid ( 840 char *InString); 841 842 ACPI_STATUS 843 AuConvertStringToUuid ( 844 char *InString, 845 char *UuIdBuffer); 846 847 ACPI_STATUS 848 AuConvertUuidToString ( 849 char *UuIdBuffer, 850 char *OutString); 851 852 /* 853 * aslresource - Resource template generation utilities 854 */ 855 void 856 RsSmallAddressCheck ( 857 UINT8 Type, 858 UINT32 Minimum, 859 UINT32 Maximum, 860 UINT32 Length, 861 UINT32 Alignment, 862 ACPI_PARSE_OBJECT *MinOp, 863 ACPI_PARSE_OBJECT *MaxOp, 864 ACPI_PARSE_OBJECT *LengthOp, 865 ACPI_PARSE_OBJECT *AlignOp, 866 ACPI_PARSE_OBJECT *Op); 867 868 void 869 RsLargeAddressCheck ( 870 UINT64 Minimum, 871 UINT64 Maximum, 872 UINT64 Length, 873 UINT64 Granularity, 874 UINT8 Flags, 875 ACPI_PARSE_OBJECT *MinOp, 876 ACPI_PARSE_OBJECT *MaxOp, 877 ACPI_PARSE_OBJECT *LengthOp, 878 ACPI_PARSE_OBJECT *GranOp, 879 ACPI_PARSE_OBJECT *Op); 880 881 UINT16 882 RsGetStringDataLength ( 883 ACPI_PARSE_OBJECT *InitializerOp); 884 885 ASL_RESOURCE_NODE * 886 RsAllocateResourceNode ( 887 UINT32 Size); 888 889 void 890 RsCreateResourceField ( 891 ACPI_PARSE_OBJECT *Op, 892 char *Name, 893 UINT32 ByteOffset, 894 UINT32 BitOffset, 895 UINT32 BitLength); 896 897 void 898 RsSetFlagBits ( 899 UINT8 *Flags, 900 ACPI_PARSE_OBJECT *Op, 901 UINT8 Position, 902 UINT8 DefaultBit); 903 904 void 905 RsSetFlagBits16 ( 906 UINT16 *Flags, 907 ACPI_PARSE_OBJECT *Op, 908 UINT8 Position, 909 UINT8 DefaultBit); 910 911 ACPI_PARSE_OBJECT * 912 RsCompleteNodeAndGetNext ( 913 ACPI_PARSE_OBJECT *Op); 914 915 void 916 RsCheckListForDuplicates ( 917 ACPI_PARSE_OBJECT *Op); 918 919 ASL_RESOURCE_NODE * 920 RsDoOneResourceDescriptor ( 921 ACPI_PARSE_OBJECT *DescriptorTypeOp, 922 UINT32 CurrentByteOffset, 923 UINT8 *State); 924 925 /* Values for State above */ 926 927 #define ACPI_RSTATE_NORMAL 0 928 #define ACPI_RSTATE_START_DEPENDENT 1 929 #define ACPI_RSTATE_DEPENDENT_LIST 2 930 931 UINT32 932 RsLinkDescriptorChain ( 933 ASL_RESOURCE_NODE **PreviousRnode, 934 ASL_RESOURCE_NODE *Rnode); 935 936 void 937 RsDoResourceTemplate ( 938 ACPI_PARSE_OBJECT *Op); 939 940 941 /* 942 * aslrestype1 - Miscellaneous Small descriptors 943 */ 944 ASL_RESOURCE_NODE * 945 RsDoEndTagDescriptor ( 946 ACPI_PARSE_OBJECT *Op, 947 UINT32 CurrentByteOffset); 948 949 ASL_RESOURCE_NODE * 950 RsDoEndDependentDescriptor ( 951 ACPI_PARSE_OBJECT *Op, 952 UINT32 CurrentByteOffset); 953 954 ASL_RESOURCE_NODE * 955 RsDoMemory24Descriptor ( 956 ACPI_PARSE_OBJECT *Op, 957 UINT32 CurrentByteOffset); 958 959 ASL_RESOURCE_NODE * 960 RsDoMemory32Descriptor ( 961 ACPI_PARSE_OBJECT *Op, 962 UINT32 CurrentByteOffset); 963 964 ASL_RESOURCE_NODE * 965 RsDoMemory32FixedDescriptor ( 966 ACPI_PARSE_OBJECT *Op, 967 UINT32 CurrentByteOffset); 968 969 ASL_RESOURCE_NODE * 970 RsDoStartDependentDescriptor ( 971 ACPI_PARSE_OBJECT *Op, 972 UINT32 CurrentByteOffset); 973 974 ASL_RESOURCE_NODE * 975 RsDoStartDependentNoPriDescriptor ( 976 ACPI_PARSE_OBJECT *Op, 977 UINT32 CurrentByteOffset); 978 979 ASL_RESOURCE_NODE * 980 RsDoVendorSmallDescriptor ( 981 ACPI_PARSE_OBJECT *Op, 982 UINT32 CurrentByteOffset); 983 984 985 /* 986 * aslrestype1i - I/O-related Small descriptors 987 */ 988 ASL_RESOURCE_NODE * 989 RsDoDmaDescriptor ( 990 ACPI_PARSE_OBJECT *Op, 991 UINT32 CurrentByteOffset); 992 993 ASL_RESOURCE_NODE * 994 RsDoFixedDmaDescriptor ( 995 ACPI_PARSE_OBJECT *Op, 996 UINT32 CurrentByteOffset); 997 998 ASL_RESOURCE_NODE * 999 RsDoFixedIoDescriptor ( 1000 ACPI_PARSE_OBJECT *Op, 1001 UINT32 CurrentByteOffset); 1002 1003 ASL_RESOURCE_NODE * 1004 RsDoIoDescriptor ( 1005 ACPI_PARSE_OBJECT *Op, 1006 UINT32 CurrentByteOffset); 1007 1008 ASL_RESOURCE_NODE * 1009 RsDoIrqDescriptor ( 1010 ACPI_PARSE_OBJECT *Op, 1011 UINT32 CurrentByteOffset); 1012 1013 ASL_RESOURCE_NODE * 1014 RsDoIrqNoFlagsDescriptor ( 1015 ACPI_PARSE_OBJECT *Op, 1016 UINT32 CurrentByteOffset); 1017 1018 1019 /* 1020 * aslrestype2 - Large resource descriptors 1021 */ 1022 ASL_RESOURCE_NODE * 1023 RsDoInterruptDescriptor ( 1024 ACPI_PARSE_OBJECT *Op, 1025 UINT32 CurrentByteOffset); 1026 1027 ASL_RESOURCE_NODE * 1028 RsDoVendorLargeDescriptor ( 1029 ACPI_PARSE_OBJECT *Op, 1030 UINT32 CurrentByteOffset); 1031 1032 ASL_RESOURCE_NODE * 1033 RsDoGeneralRegisterDescriptor ( 1034 ACPI_PARSE_OBJECT *Op, 1035 UINT32 CurrentByteOffset); 1036 1037 ASL_RESOURCE_NODE * 1038 RsDoGpioIntDescriptor ( 1039 ACPI_PARSE_OBJECT *Op, 1040 UINT32 CurrentByteOffset); 1041 1042 ASL_RESOURCE_NODE * 1043 RsDoGpioIoDescriptor ( 1044 ACPI_PARSE_OBJECT *Op, 1045 UINT32 CurrentByteOffset); 1046 1047 ASL_RESOURCE_NODE * 1048 RsDoI2cSerialBusDescriptor ( 1049 ACPI_PARSE_OBJECT *Op, 1050 UINT32 CurrentByteOffset); 1051 1052 ASL_RESOURCE_NODE * 1053 RsDoSpiSerialBusDescriptor ( 1054 ACPI_PARSE_OBJECT *Op, 1055 UINT32 CurrentByteOffset); 1056 1057 ASL_RESOURCE_NODE * 1058 RsDoUartSerialBusDescriptor ( 1059 ACPI_PARSE_OBJECT *Op, 1060 UINT32 CurrentByteOffset); 1061 1062 /* 1063 * aslrestype2d - DWord address descriptors 1064 */ 1065 ASL_RESOURCE_NODE * 1066 RsDoDwordIoDescriptor ( 1067 ACPI_PARSE_OBJECT *Op, 1068 UINT32 CurrentByteOffset); 1069 1070 ASL_RESOURCE_NODE * 1071 RsDoDwordMemoryDescriptor ( 1072 ACPI_PARSE_OBJECT *Op, 1073 UINT32 CurrentByteOffset); 1074 1075 ASL_RESOURCE_NODE * 1076 RsDoDwordSpaceDescriptor ( 1077 ACPI_PARSE_OBJECT *Op, 1078 UINT32 CurrentByteOffset); 1079 1080 1081 /* 1082 * aslrestype2e - Extended address descriptors 1083 */ 1084 ASL_RESOURCE_NODE * 1085 RsDoExtendedIoDescriptor ( 1086 ACPI_PARSE_OBJECT *Op, 1087 UINT32 CurrentByteOffset); 1088 1089 ASL_RESOURCE_NODE * 1090 RsDoExtendedMemoryDescriptor ( 1091 ACPI_PARSE_OBJECT *Op, 1092 UINT32 CurrentByteOffset); 1093 1094 ASL_RESOURCE_NODE * 1095 RsDoExtendedSpaceDescriptor ( 1096 ACPI_PARSE_OBJECT *Op, 1097 UINT32 CurrentByteOffset); 1098 1099 1100 /* 1101 * aslrestype2q - QWord address descriptors 1102 */ 1103 ASL_RESOURCE_NODE * 1104 RsDoQwordIoDescriptor ( 1105 ACPI_PARSE_OBJECT *Op, 1106 UINT32 CurrentByteOffset); 1107 1108 ASL_RESOURCE_NODE * 1109 RsDoQwordMemoryDescriptor ( 1110 ACPI_PARSE_OBJECT *Op, 1111 UINT32 CurrentByteOffset); 1112 1113 ASL_RESOURCE_NODE * 1114 RsDoQwordSpaceDescriptor ( 1115 ACPI_PARSE_OBJECT *Op, 1116 UINT32 CurrentByteOffset); 1117 1118 1119 /* 1120 * aslrestype2w - Word address descriptors 1121 */ 1122 ASL_RESOURCE_NODE * 1123 RsDoWordIoDescriptor ( 1124 ACPI_PARSE_OBJECT *Op, 1125 UINT32 CurrentByteOffset); 1126 1127 ASL_RESOURCE_NODE * 1128 RsDoWordSpaceDescriptor ( 1129 ACPI_PARSE_OBJECT *Op, 1130 UINT32 CurrentByteOffset); 1131 1132 ASL_RESOURCE_NODE * 1133 RsDoWordBusNumberDescriptor ( 1134 ACPI_PARSE_OBJECT *Op, 1135 UINT32 CurrentByteOffset); 1136 1137 /* 1138 * Entry to data table compiler subsystem 1139 */ 1140 ACPI_STATUS 1141 DtDoCompile( 1142 void); 1143 1144 ACPI_STATUS 1145 DtCreateTemplates ( 1146 char *Signature); 1147 1148 #endif /* __ASLCOMPILER_H */ 1149