Deleted Added
full compact
aslcodegen.c (151937) aslcodegen.c (167802)
1
2/******************************************************************************
3 *
4 * Module Name: aslcodegen - AML code generation
1
2/******************************************************************************
3 *
4 * Module Name: aslcodegen - AML code generation
5 * $Revision: 1.57 $
5 * $Revision: 1.62 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13 * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
14 * All rights reserved.
15 *
16 * 2. License
17 *
18 * 2.1. This is your license from Intel Corp. under its intellectual property
19 * rights. You may have additional license terms from the party that provided
20 * you this software, covering your right to use that party's intellectual
21 * property rights.

--- 178 unchanged lines hidden (view full) ---

200
201static ACPI_STATUS
202CgAmlWriteWalk (
203 ACPI_PARSE_OBJECT *Op,
204 UINT32 Level,
205 void *Context)
206{
207
14 * All rights reserved.
15 *
16 * 2. License
17 *
18 * 2.1. This is your license from Intel Corp. under its intellectual property
19 * rights. You may have additional license terms from the party that provided
20 * you this software, covering your right to use that party's intellectual
21 * property rights.

--- 178 unchanged lines hidden (view full) ---

200
201static ACPI_STATUS
202CgAmlWriteWalk (
203 ACPI_PARSE_OBJECT *Op,
204 UINT32 Level,
205 void *Context)
206{
207
208 /*
209 * Print header at level 0. Alignment assumes 32-bit pointers
210 */
211 if (!Level)
212 {
213 DbgPrint (ASL_TREE_OUTPUT,
214 "Final parse tree used for AML output:\n");
215 DbgPrint (ASL_TREE_OUTPUT,
216 "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr Child Parent Flags AcTyp Final Col L\n",
217 76, " ");
218 }
219
208 /* Debug output */
209
210 DbgPrint (ASL_TREE_OUTPUT,
211 "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
212 UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
213
214 if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG ||
215 Op->Asl.ParseOpcode == PARSEOP_NAMESTRING ||
216 Op->Asl.ParseOpcode == PARSEOP_METHODCALL)
217 {
218 DbgPrint (ASL_TREE_OUTPUT,
219 "%10.32s ", Op->Asl.ExternalName);
220 }
221 else
222 {
223 DbgPrint (ASL_TREE_OUTPUT, " ");
224 }
225
220 /* Debug output */
221
222 DbgPrint (ASL_TREE_OUTPUT,
223 "%5.5d [%2d]", Op->Asl.LogicalLineNumber, Level);
224 UtPrintFormattedName (Op->Asl.ParseOpcode, Level);
225
226 if (Op->Asl.ParseOpcode == PARSEOP_NAMESEG ||
227 Op->Asl.ParseOpcode == PARSEOP_NAMESTRING ||
228 Op->Asl.ParseOpcode == PARSEOP_METHODCALL)
229 {
230 DbgPrint (ASL_TREE_OUTPUT,
231 "%10.32s ", Op->Asl.ExternalName);
232 }
233 else
234 {
235 DbgPrint (ASL_TREE_OUTPUT, " ");
236 }
237
226 DbgPrint (ASL_TREE_OUTPUT,
227 "Val-%08X POp-%04X AOp-%04X OpLen-%01X PByts-%01X Len-%04X SubLen-%04X PSubLen-%04X Op-%08X Chld-%08X Paren-%08X Flags-%04X AcTyp-%08X C-%2d L-%d\n",
228 (UINT32) Op->Asl.Value.Integer,
229 Op->Asl.ParseOpcode,
230 Op->Asl.AmlOpcode,
231 Op->Asl.AmlOpcodeLength,
232 Op->Asl.AmlPkgLenBytes,
233 Op->Asl.AmlLength,
234 Op->Asl.AmlSubtreeLength,
235 Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
236 Op,
237 Op->Asl.Child,
238 Op->Asl.Parent,
239 Op->Asl.CompileFlags,
240 Op->Asl.AcpiBtype,
241 Op->Asl.Column,
242 Op->Asl.LineNumber);
238 DbgPrint (ASL_TREE_OUTPUT,
239 "%08X %04X %04X %01X %04X %04X %04X %04X %08X %08X %08X %08X %08X %04X %02d %02d\n",
240 /* 1 */ (UINT32) Op->Asl.Value.Integer,
241 /* 2 */ Op->Asl.ParseOpcode,
242 /* 3 */ Op->Asl.AmlOpcode,
243 /* 4 */ Op->Asl.AmlOpcodeLength,
244 /* 5 */ Op->Asl.AmlPkgLenBytes,
245 /* 6 */ Op->Asl.AmlLength,
246 /* 7 */ Op->Asl.AmlSubtreeLength,
247 /* 8 */ Op->Asl.Parent ? Op->Asl.Parent->Asl.AmlSubtreeLength : 0,
248 /* 9 */ Op,
249 /* 10 */ Op->Asl.Child,
250 /* 11 */ Op->Asl.Parent,
251 /* 12 */ Op->Asl.CompileFlags,
252 /* 13 */ Op->Asl.AcpiBtype,
253 /* 14 */ Op->Asl.FinalAmlLength,
254 /* 15 */ Op->Asl.Column,
255 /* 16 */ Op->Asl.LineNumber);
243
244 /* Generate the AML for this node */
245
246 CgWriteNode (Op);
247 return (AE_OK);
248}
249
250

--- 127 unchanged lines hidden (view full) ---

378 if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
379 {
380 if (Op->Asl.AmlPkgLenBytes == 1)
381 {
382 /* Simplest case -- no bytes to follow, just write the count */
383
384 CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
385 }
256
257 /* Generate the AML for this node */
258
259 CgWriteNode (Op);
260 return (AE_OK);
261}
262
263

--- 127 unchanged lines hidden (view full) ---

391 if (Op->Asl.CompileFlags & NODE_AML_PACKAGE)
392 {
393 if (Op->Asl.AmlPkgLenBytes == 1)
394 {
395 /* Simplest case -- no bytes to follow, just write the count */
396
397 CgLocalWriteAmlData (Op, &PkgLen.LenBytes[0], 1);
398 }
386 else
399 else if (Op->Asl.AmlPkgLenBytes != 0)
387 {
388 /*
389 * Encode the "bytes to follow" in the first byte, top two bits.
390 * The low-order nybble of the length is in the bottom 4 bits
391 */
392 PkgLenFirstByte = (UINT8)
393 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
394 (PkgLen.LenBytes[0] & 0x0F));

--- 175 unchanged lines hidden (view full) ---

570
571static void
572CgWriteNode (
573 ACPI_PARSE_OBJECT *Op)
574{
575 ASL_RESOURCE_NODE *Rnode;
576
577
400 {
401 /*
402 * Encode the "bytes to follow" in the first byte, top two bits.
403 * The low-order nybble of the length is in the bottom 4 bits
404 */
405 PkgLenFirstByte = (UINT8)
406 (((UINT32) (Op->Asl.AmlPkgLenBytes - 1) << 6) |
407 (PkgLen.LenBytes[0] & 0x0F));

--- 175 unchanged lines hidden (view full) ---

583
584static void
585CgWriteNode (
586 ACPI_PARSE_OBJECT *Op)
587{
588 ASL_RESOURCE_NODE *Rnode;
589
590
578 Op->Asl.FinalAmlLength = 0;
579
580 /* Always check for DEFAULT_ARG and other "Noop" nodes */
581 /* TBD: this may not be the best place for this check */
582
583 if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) ||
584 (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) ||
585 (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) ||
586 (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END))
587 {
588 return;
589 }
590
591 /* Always check for DEFAULT_ARG and other "Noop" nodes */
592 /* TBD: this may not be the best place for this check */
593
594 if ((Op->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) ||
595 (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) ||
596 (Op->Asl.ParseOpcode == PARSEOP_INCLUDE) ||
597 (Op->Asl.ParseOpcode == PARSEOP_INCLUDE_END))
598 {
599 return;
600 }
601
602 Op->Asl.FinalAmlLength = 0;
603
591 switch (Op->Asl.AmlOpcode)
592 {
593 case AML_RAW_DATA_BYTE:
594 case AML_RAW_DATA_WORD:
595 case AML_RAW_DATA_DWORD:
596 case AML_RAW_DATA_QWORD:
597
598 CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);

--- 50 unchanged lines hidden ---
604 switch (Op->Asl.AmlOpcode)
605 {
606 case AML_RAW_DATA_BYTE:
607 case AML_RAW_DATA_WORD:
608 case AML_RAW_DATA_DWORD:
609 case AML_RAW_DATA_QWORD:
610
611 CgLocalWriteAmlData (Op, &Op->Asl.Value.Integer, Op->Asl.AmlLength);

--- 50 unchanged lines hidden ---