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