/* This function is called by APs to accept memory. */
STATIC EFI_STATUS EFIAPI ApAcceptMemoryResourceRange(UINT32 CpuIndex, EFI_PHYSICAL_ADDRESS PhysicalStart, EFI_PHYSICAL_ADDRESS PhysicalEnd)
/* This function is called by APs to accept memory. */
STATIC EFI_STATUS EFIAPI ApAcceptMemoryResourceRange(UINT32 CpuIndex, EFI_PHYSICAL_ADDRESS PhysicalStart, EFI_PHYSICAL_ADDRESS PhysicalEnd)
{
  UINT64          Status;
  TD_RETURN_DATA  TdReturnData;
  Status = TdCall (TDCALL_TDINFO, 0, 0, 0, &TdReturnData);
  if (Status != TDX_EXIT_REASON_SUCCESS) {
    ASSERT (FALSE);
    return EFI_ABORTED;
  }
  if ((CpuIndex == 0) || (CpuIndex >= TdReturnData.TdInfo.NumVcpus)) {
    ASSERT (FALSE);
    return EFI_ABORTED;
  }
  return BspApAcceptMemoryResourceRange (CpuIndex, TdReturnData.TdInfo.NumVcpus, PhysicalStart, PhysicalEnd);
}