/* Return an allocated copy pool of the NOR flash information structure. */
EFI_STATUS EFIAPI NorFlashGetInfo(IN UINT8 *Id, IN OUT NOR_FLASH_INFO **FlashInfo, IN BOOLEAN AllocateForRuntime)
/* Return an allocated copy pool of the NOR flash information structure. */
EFI_STATUS EFIAPI NorFlashGetInfo(IN UINT8 *Id, IN OUT NOR_FLASH_INFO **FlashInfo, IN BOOLEAN AllocateForRuntime)
{
  CONST NOR_FLASH_INFO  *TmpInfo;
  TmpInfo = NorFlashIds;
  for ( ; TmpInfo->Name != NULL; TmpInfo++) {
    if (CompareMem (TmpInfo->Id, Id, TmpInfo->IdLen) == 0) {
      break;
    }
  }
  if (TmpInfo->Name == NULL) {
    return EFI_NOT_FOUND;
  }
  if (AllocateForRuntime) {
    *FlashInfo = AllocateRuntimeCopyPool (sizeof (NOR_FLASH_INFO), TmpInfo);
  } else {
    *FlashInfo = AllocateCopyPool (sizeof (NOR_FLASH_INFO), TmpInfo);
  }
  if (FlashInfo == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  return EFI_SUCCESS;
}