Deleted Added
sdiff udiff text old ( 151937 ) new ( 167802 )
full compact
1
2/******************************************************************************
3 *
4 * Module Name: aslresource - Resource templates and descriptors
5 * $Revision: 1.38 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2005, 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 /* Determine type of 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_EXTENDEDIO:
427 Rnode = RsDoExtendedIoDescriptor (DescriptorTypeOp,
428 CurrentByteOffset);
429 break;
430
431 case PARSEOP_EXTENDEDMEMORY:
432 Rnode = RsDoExtendedMemoryDescriptor (DescriptorTypeOp,
433 CurrentByteOffset);

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

575
576 /*
577 * Mark original node as unused, but head of a resource descriptor.
578 * This allows the resource to be installed in the namespace so that
579 * references to the descriptor can be resolved.
580 */
581 DescriptorTypeOp->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
582 DescriptorTypeOp->Asl.CompileFlags = NODE_IS_RESOURCE_DESC;
583
584 return (Rnode);
585}
586
587
588/*******************************************************************************
589 *
590 * FUNCTION: RsLinkDescriptorChain
591 *

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

653void
654RsDoResourceTemplate (
655 ACPI_PARSE_OBJECT *Op)
656{
657 ACPI_PARSE_OBJECT *BufferLengthOp;
658 ACPI_PARSE_OBJECT *BufferOp;
659 ACPI_PARSE_OBJECT *DescriptorTypeOp;
660 ACPI_PARSE_OBJECT *LastOp = NULL;
661 AML_RESOURCE *Descriptor;
662 UINT32 CurrentByteOffset = 0;
663 ASL_RESOURCE_NODE HeadRnode;
664 ASL_RESOURCE_NODE *PreviousRnode;
665 ASL_RESOURCE_NODE *Rnode;
666 UINT8 State;
667
668
669 /* ResourceTemplate Opcode is first (Op) */
670 /* Buffer Length node is first child */
671
672 BufferLengthOp = ASL_GET_CHILD_NODE (Op);
673
674 /* Buffer Op is first peer */
675
676 BufferOp = ASL_GET_PEER_NODE (BufferLengthOp);
677
678 /* First Descriptor type is next */
679
680 DescriptorTypeOp = ASL_GET_PEER_NODE (BufferOp);
681
682 /* Process all resource descriptors in the list */
683
684 State = ACPI_RSTATE_NORMAL;
685 PreviousRnode = &HeadRnode;
686 while (DescriptorTypeOp)
687 {
688 Rnode = RsDoOneResourceDescriptor (DescriptorTypeOp, CurrentByteOffset,
689 &State);
690
691 /*
692 * Update current byte offset to indicate the number of bytes from the
693 * start of the buffer. Buffer can include multiple descriptors, we
694 * must keep track of the offset of not only each descriptor, but each
695 * element (field) within each descriptor as well.

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

707 if (LastOp)
708 {
709 LastOp = LastOp->Asl.Parent;
710 }
711 AslError (ASL_ERROR, ASL_MSG_MISSING_ENDDEPENDENT, LastOp, NULL);
712 }
713
714 /*
715 * Insert the EndTag descriptor after all other descriptors have
716 * been processed
717 */
718 Rnode = RsAllocateResourceNode (sizeof (AML_RESOURCE_END_TAG));
719
720 Descriptor = Rnode->Buffer;
721 Descriptor->EndTag.DescriptorType = ACPI_RESOURCE_NAME_END_TAG |
722 ASL_RDESC_END_TAG_SIZE;
723 Descriptor->EndTag.Checksum = 0;
724
725 CurrentByteOffset += RsLinkDescriptorChain (&PreviousRnode, Rnode);
726
727 /*
728 * Transform the nodes into the following
729 *
730 * Op -> AML_BUFFER_OP
731 * First Child -> BufferLength
732 * Second Child -> Descriptor Buffer (raw byte data)
733 */
734 Op->Asl.ParseOpcode = PARSEOP_BUFFER;
735 Op->Asl.AmlOpcode = AML_BUFFER_OP;
736 Op->Asl.CompileFlags = NODE_AML_PACKAGE;
737
738 BufferLengthOp->Asl.ParseOpcode = PARSEOP_INTEGER;
739 BufferLengthOp->Asl.Value.Integer = CurrentByteOffset;
740
741 (void) OpcSetOptimalIntegerSize (BufferLengthOp);
742
743 BufferOp->Asl.ParseOpcode = PARSEOP_RAW_DATA;
744 BufferOp->Asl.AmlOpcode = AML_RAW_DATA_CHAIN;
745 BufferOp->Asl.AmlOpcodeLength = 0;
746 BufferOp->Asl.AmlLength = CurrentByteOffset;
747 BufferOp->Asl.Value.Buffer = (UINT8 *) HeadRnode.Next;
748
749 return;
750}
751
752