/* In AML, a ResourceTemplate is implemented as a Buffer storing resource data elements. An EndTag resource data descriptor must be at the end of the list of resource data elements. This function generates a Buffer node with an EndTag resource data descriptor. It can be seen as an empty list of resource data elements. */
STATIC EFI_STATUS EFIAPI AmlCodeGenResourceTemplate(OUT AML_OBJECT_NODE **NewObjectNode)
/* In AML, a ResourceTemplate is implemented as a Buffer storing resource data elements. An EndTag resource data descriptor must be at the end of the list of resource data elements. This function generates a Buffer node with an EndTag resource data descriptor. It can be seen as an empty list of resource data elements. */
STATIC EFI_STATUS EFIAPI AmlCodeGenResourceTemplate(OUT AML_OBJECT_NODE **NewObjectNode)
{
  EFI_STATUS       Status;
  AML_OBJECT_NODE  *BufferNode;
  if (NewObjectNode == NULL) {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  Status = AmlCodeGenBuffer (NULL, 0, &BufferNode);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  Status = AmlCodeGenEndTag (0, BufferNode, NULL);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    AmlDeleteTree ((AML_NODE_HEADER *)BufferNode);
    return Status;
  }
  *NewObjectNode = BufferNode;
  return Status;
}