/* Generate a RES0 device node to reserve PNP motherboard resources for a given PCI node. */
STATIC EFI_STATUS EFIAPI GenerateMotherboardDevice(IN AML_OBJECT_NODE_HANDLE PciNode, OUT AML_OBJECT_NODE_HANDLE *CrsNode)
/* Generate a RES0 device node to reserve PNP motherboard resources for a given PCI node. */
STATIC EFI_STATUS EFIAPI GenerateMotherboardDevice(IN AML_OBJECT_NODE_HANDLE PciNode, OUT AML_OBJECT_NODE_HANDLE *CrsNode)
{
  EFI_STATUS              Status;
  UINT32                  EisaId;
  AML_OBJECT_NODE_HANDLE  ResNode;
  if (CrsNode == NULL) {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  Status = AmlCodeGenDevice ("RES0", PciNode, &ResNode);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  Status = AmlGetEisaIdFromString ("PNP0C02", &EisaId);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  Status = AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  Status = AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode);
  if (EFI_ERROR (Status)) {
    ASSERT (0);
    return Status;
  }
  return Status;
}