1 2/****************************************************************************** 3 * 4 * Module Name: aslresource - Resource templates and descriptors |
5 * $Revision: 1.43 $ |
6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * |
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. --- 349 unchanged lines hidden (view full) --- 371RsDoOneResourceDescriptor ( 372 ACPI_PARSE_OBJECT *DescriptorTypeOp, 373 UINT32 CurrentByteOffset, 374 UINT8 *State) 375{ 376 ASL_RESOURCE_NODE *Rnode = NULL; 377 378 |
379 /* Construct the resource */ |
380 381 switch (DescriptorTypeOp->Asl.ParseOpcode) 382 { 383 case PARSEOP_DMA: 384 Rnode = RsDoDmaDescriptor (DescriptorTypeOp, 385 CurrentByteOffset); 386 break; 387 --- 30 unchanged lines hidden (view full) --- 418 break; 419 } 420 421 *State = ACPI_RSTATE_NORMAL; 422 Rnode = RsDoEndDependentDescriptor (DescriptorTypeOp, 423 CurrentByteOffset); 424 break; 425 |
426 case PARSEOP_ENDTAG: 427 Rnode = RsDoEndTagDescriptor (DescriptorTypeOp, 428 CurrentByteOffset); 429 break; 430 |
431 case PARSEOP_EXTENDEDIO: 432 Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp, 433 CurrentByteOffset); 434 break; 435 436 case PARSEOP_EXTENDEDMEMORY: 437 Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp, 438 CurrentByteOffset); --- 141 unchanged lines hidden (view full) --- 580 581 /* 582 * Mark original node as unused, but head of a resource descriptor. 583 * This allows the resource to be installed in the namespace so that 584 * references to the descriptor can be resolved. 585 */ 586 DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; 587 DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC; |
588 DescriptorTypeOp->Asl.Value.Integer = CurrentByteOffset; |
589 |
590 if (Rnode) 591 { 592 DescriptorTypeOp->Asl.FinalAmlLength = Rnode->BufferLength; 593 } 594 |
595 return (Rnode); 596} 597 598 599/******************************************************************************* 600 * 601 * FUNCTION: RsLinkDescriptorChain 602 * --- 61 unchanged lines hidden (view full) --- 664void 665RsDoResourceTemplate ( 666 ACPI_PARSE_OBJECT *Op) 667{ 668 ACPI_PARSE_OBJECT *BufferLengthOp; 669 ACPI_PARSE_OBJECT *BufferOp; 670 ACPI_PARSE_OBJECT *DescriptorTypeOp; 671 ACPI_PARSE_OBJECT *LastOp = NULL; |
672 UINT32 CurrentByteOffset = 0; 673 ASL_RESOURCE_NODE HeadRnode; 674 ASL_RESOURCE_NODE *PreviousRnode; 675 ASL_RESOURCE_NODE *Rnode; 676 UINT8 State; 677 678 |
679 /* Mark parent as containing a resource template */ 680 681 if (Op->Asl.Parent) 682 { 683 Op->Asl.Parent->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC; 684 } 685 |
686 /* ResourceTemplate Opcode is first (Op) */ 687 /* Buffer Length node is first child */ 688 689 BufferLengthOp = ASL_GET_CHILD_NODE (Op); 690 691 /* Buffer Op is first peer */ 692 693 BufferOp = ASL_GET_PEER_NODE (BufferLengthOp); 694 695 /* First Descriptor type is next */ 696 697 DescriptorTypeOp = ASL_GET_PEER_NODE (BufferOp); 698 |
699 /* 700 * Process all resource descriptors in the list 701 * Note: It is assumed that the EndTag node has been automatically 702 * inserted at the end of the template by the parser. 703 */ |
704 State = ACPI_RSTATE_NORMAL; 705 PreviousRnode = &HeadRnode; 706 while (DescriptorTypeOp) 707 { |
708 DescriptorTypeOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DESC; |
709 Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset, 710 &State); 711 712 /* 713 * Update current byte offset to indicate the number of bytes from the 714 * start of the buffer. Buffer can include multiple descriptors, we 715 * must keep track of the offset of not only each descriptor, but each 716 * element (field) within each descriptor as well. --- 11 unchanged lines hidden (view full) --- 728 if (LastOp) 729 { 730 LastOp = LastOp->Asl.Parent; 731 } 732 AslError (ASL_ERROR, ASL_MSG_MISSING_ENDDEPENDENT, LastOp, NULL); 733 } 734 735 /* |
736 * Transform the nodes into the following 737 * 738 * Op -> AML_BUFFER_OP 739 * First Child -> BufferLength 740 * Second Child -> Descriptor Buffer (raw byte data) 741 */ 742 Op->Asl.ParseOpcode = PARSEOP_BUFFER; 743 Op->Asl.AmlOpcode = AML_BUFFER_OP; |
744 Op->Asl.CompileFlags = NODE_AML_PACKAGE | NODE_IS_RESOURCE_DESC; |
745 746 BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER; 747 BufferLengthOp->Asl.Value.Integer = CurrentByteOffset; |
748 (void) OpcSetOptimalIntegerSize (BufferLengthOp); 749 750 BufferOp->Asl.ParseOpcode = PARSEOP_RAW_DATA; 751 BufferOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN; 752 BufferOp->Asl.AmlOpcodeLength = 0; 753 BufferOp->Asl.AmlLength = CurrentByteOffset; 754 BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next; |
755 BufferOp->Asl.CompileFlags |= NODE_IS_RESOURCE_DATA; |
756 757 return; 758} 759 760 |