Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
Line 115... | Line 115... | ||
115 | 115 | ||
Line 116... | Line 116... | ||
116 | 116 | ||
117 | #include "aslcompiler.h" |
117 | #include "aslcompiler.h" |
- | 118 | #include "aslcompiler.y.h" |
|
118 | #include "aslcompiler.y.h" |
119 | #include "acdisasm.h" |
119 | #include "acnamesp.h" |
120 | #include "acnamesp.h" |
- | 121 | #include "amlcode.h" |
|
Line 120... | Line 122... | ||
120 | #include "amlcode.h" |
122 | #include |
121 | 123 | ||
Line 122... | Line -... | ||
122 | #define _COMPONENT ACPI_COMPILER |
- | |
123 | ACPI_MODULE_NAME ("aslutils") |
- | |
124 | - | ||
125 | #ifdef _USE_BERKELEY_YACC |
- | |
126 | extern const char * const AslCompilername[]; |
- | |
127 | static const char * const *yytname = &AslCompilername[254]; |
- | |
128 | #else |
- | |
129 | extern const char * const yytname[]; |
124 | #define _COMPONENT ACPI_COMPILER |
130 | #endif |
125 | ACPI_MODULE_NAME ("aslutils") |
131 | 126 | ||
132 | char HexLookup[] = |
127 | char AslHexLookup[] = |
Line 133... | Line 128... | ||
133 | { |
128 | { |
Line 134... | Line -... | ||
134 | '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' |
- | |
135 | }; |
- | |
136 | - | ||
137 | - | ||
138 | /* Local prototypes */ |
- | |
139 | - | ||
140 | static ACPI_STATUS |
129 | '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' |
141 | UtStrtoul64 ( |
130 | }; |
142 | char *String, |
131 | |
143 | UINT32 Base, |
132 | |
Line 155... | Line 144... | ||
155 | 144 | ||
Line 156... | Line 145... | ||
156 | 145 | ||
157 | /******************************************************************************* |
146 | /******************************************************************************* |
- | 147 | * |
|
- | 148 | * FUNCTION: UtDisplaySupportedTables |
|
- | 149 | * |
|
- | 150 | * PARAMETERS: None |
|
- | 151 | * |
|
- | 152 | * RETURN: None |
|
- | 153 | * |
|
- | 154 | * DESCRIPTION: Print all supported ACPI table names. |
|
- | 155 | * |
|
- | 156 | ******************************************************************************/ |
|
- | 157 | ||
- | 158 | void |
|
- | 159 | UtDisplaySupportedTables ( |
|
- | 160 | void) |
|
- | 161 | { |
|
- | 162 | ACPI_DMTABLE_DATA *TableData; |
|
- | 163 | UINT32 i = 6; |
|
- | 164 | ||
- | 165 | ||
- | 166 | printf ("\nACPI tables supported by iASL subsystems in " |
|
- | 167 | "version %8.8X:\n" |
|
- | 168 | " ASL and Data Table compilers\n" |
|
- | 169 | " AML and Data Table disassemblers\n" |
|
- | 170 | " ACPI table template generator\n\n", ACPI_CA_VERSION); |
|
- | 171 | ||
- | 172 | /* Special tables */ |
|
- | 173 | ||
- | 174 | printf ("%8u) %s %s\n", 1, ACPI_SIG_DSDT, "Differentiated System Description Table"); |
|
- | 175 | printf ("%8u) %s %s\n", 2, ACPI_SIG_SSDT, "Secondary System Description Table"); |
|
- | 176 | printf ("%8u) %s %s\n", 3, ACPI_SIG_FADT, "Fixed ACPI Description Table (FADT)"); |
|
- | 177 | printf ("%8u) %s %s\n", 4, ACPI_SIG_FACS, "Firmware ACPI Control Structure"); |
|
- | 178 | printf ("%8u) %s %s\n", 5, ACPI_RSDP_NAME, "Root System Description Pointer"); |
|
- | 179 | ||
- | 180 | /* All data tables with common table header */ |
|
- | 181 | ||
- | 182 | for (TableData = AcpiDmTableData; TableData->Signature; TableData++) |
|
- | 183 | { |
|
- | 184 | printf ("%8u) %s %s\n", i, TableData->Signature, TableData->Name); |
|
- | 185 | i++; |
|
- | 186 | } |
|
- | 187 | } |
|
- | 188 | ||
- | 189 | ||
- | 190 | /******************************************************************************* |
|
158 | * |
191 | * |
159 | * FUNCTION: AcpiPsDisplayConstantOpcodes |
192 | * FUNCTION: AcpiPsDisplayConstantOpcodes |
160 | * |
193 | * |
161 | * PARAMETERS: None |
194 | * PARAMETERS: None |
162 | * |
195 | * |
Line 338... | Line 371... | ||
338 | 371 | ||
Line 339... | Line 372... | ||
339 | Buffer[0] = '0'; |
372 | Buffer[0] = '0'; |
340 | Buffer[1] = 'x'; |
373 | Buffer[1] = 'x'; |
Line 341... | Line 374... | ||
341 | 374 | ||
342 | Buffer[2] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; |
375 | Buffer[2] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF]; |
343 | Buffer[3] = (UINT8) HexLookup[RawByte & 0xF]; |
376 | Buffer[3] = (UINT8) AslHexLookup[RawByte & 0xF]; |
Line 344... | Line 377... | ||
344 | } |
377 | } |
345 | 378 | ||
Line 364... | Line 397... | ||
364 | UINT8 *Buffer) |
397 | UINT8 *Buffer) |
365 | { |
398 | { |
366 | 399 | ||
Line 367... | Line 400... | ||
367 | Buffer[0] = '0'; |
400 | Buffer[0] = '0'; |
368 | Buffer[1] = (UINT8) HexLookup[(RawByte >> 4) & 0xF]; |
401 | Buffer[1] = (UINT8) AslHexLookup[(RawByte >> 4) & 0xF]; |
369 | Buffer[2] = (UINT8) HexLookup[RawByte & 0xF]; |
402 | Buffer[2] = (UINT8) AslHexLookup[RawByte & 0xF]; |
370 | Buffer[3] = 'h'; |
403 | Buffer[3] = 'h'; |
371 | } |
404 | } |
Line 372... | Line 405... | ||
372 | 405 | ||
Line 474... | Line 507... | ||
474 | 507 | ||
Line 475... | Line 508... | ||
475 | 508 | ||
476 | /******************************************************************************* |
509 | /******************************************************************************* |
477 | * |
- | |
478 | * FUNCTION: UtGetOpName |
- | |
479 | * |
- | |
480 | * PARAMETERS: ParseOpcode - Parser keyword ID |
- | |
481 | * |
- | |
482 | * RETURN: Pointer to the opcode name |
- | |
483 | * |
- | |
484 | * DESCRIPTION: Get the ascii name of the parse opcode |
- | |
485 | * |
- | |
486 | ******************************************************************************/ |
- | |
487 | - | ||
488 | char * |
- | |
489 | UtGetOpName ( |
- | |
490 | UINT32 ParseOpcode) |
- | |
491 | { |
- | |
492 | - | ||
493 | /* |
- | |
494 | * First entries (ASL_YYTNAME_START) in yytname are special reserved names. |
- | |
495 | * Ignore first 8 characters of the name |
- | |
496 | */ |
- | |
497 | return ((char *) yytname |
- | |
498 | [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8); |
- | |
499 | } |
- | |
500 | - | ||
501 | - | ||
502 | /******************************************************************************* |
- | |
503 | * |
510 | * |
504 | * FUNCTION: UtDisplaySummary |
511 | * FUNCTION: UtDisplaySummary |
505 | * |
512 | * |
506 | * PARAMETERS: FileID - ID of outpout file |
513 | * PARAMETERS: FileID - ID of outpout file |
507 | * |
514 | * |
Line 519... | Line 526... | ||
519 | if (FileId != ASL_FILE_STDOUT) |
526 | if (FileId != ASL_FILE_STDOUT) |
520 | { |
527 | { |
521 | /* Compiler name and version number */ |
528 | /* Compiler name and version number */ |
Line 522... | Line 529... | ||
522 | 529 | ||
523 | FlPrintFile (FileId, "%s version %X [%s]\n", |
530 | FlPrintFile (FileId, "%s version %X%s [%s]\n", |
524 | CompilerId, (UINT32) ACPI_CA_VERSION, __DATE__); |
531 | ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, ACPI_WIDTH, __DATE__); |
Line 525... | Line 532... | ||
525 | } |
532 | } |
526 | 533 | ||
527 | if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) |
534 | if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) |
Line 908... | Line 915... | ||
908 | * DESCRIPTION: Convert a string into an unsigned value. |
915 | * DESCRIPTION: Convert a string into an unsigned value. |
909 | * |
916 | * |
910 | ******************************************************************************/ |
917 | ******************************************************************************/ |
911 | 918 | ||
Line 912... | Line 919... | ||
912 | static ACPI_STATUS |
919 | ACPI_STATUS |
913 | UtStrtoul64 ( |
920 | UtStrtoul64 ( |
914 | char *String, |
921 | char *String, |
915 | UINT32 Base, |
922 | UINT32 Base, |
916 | UINT64 *RetInteger) |
923 | UINT64 *RetInteger) |
917 | { |
924 | { |