/* Copy bytes from SrcBuffer to DstBuffer and convert to upper case. Don't copy more than MaxDstBufferSize bytes. */
EFI_STATUS EFIAPI AmlUpperCaseMemCpyS(OUT CHAR8 *DstBuffer, IN UINT32 MaxDstBufferSize, IN CONST CHAR8 *SrcBuffer, IN UINT32 Count)
/* Copy bytes from SrcBuffer to DstBuffer and convert to upper case. Don't copy more than MaxDstBufferSize bytes. */
EFI_STATUS EFIAPI AmlUpperCaseMemCpyS(OUT CHAR8 *DstBuffer, IN UINT32 MaxDstBufferSize, IN CONST CHAR8 *SrcBuffer, IN UINT32 Count)
{
  UINT32  Index;
  if ((DstBuffer == NULL) ||
      (SrcBuffer == NULL))
  {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  if (Count == 0) {
    return EFI_SUCCESS;
  }
  if (Count > MaxDstBufferSize) {
    Count = MaxDstBufferSize;
  }
  for (Index = 0; Index < Count; Index++) {
    if ((SrcBuffer[Index] >= 'a') && (SrcBuffer[Index] <= 'z')) {
      DstBuffer[Index] = (CHAR8)((UINT8)SrcBuffer[Index] - ('a' - 'A'));
    } else {
      DstBuffer[Index] = SrcBuffer[Index];
    }
  }
  return EFI_SUCCESS;
}