/* The number of bytes actually written to the SBI console is returned. If the return value is less than NumberOfBytes, then the write operation failed. */
UINTN SbiLegacyPutchar(IN UINT8 *Buffer, IN UINTN NumberOfBytes)
/* The number of bytes actually written to the SBI console is returned. If the return value is less than NumberOfBytes, then the write operation failed. */
UINTN SbiLegacyPutchar(IN UINT8 *Buffer, IN UINTN NumberOfBytes)
{
  SBI_RET  Ret;
  UINTN    Index;
  for (Index = 0; Index < NumberOfBytes; Index++) {
    Ret =  SbiCall (SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, 1, Buffer[Index]);
    if ((INT64)Ret.Error < 0) {
      break;
    }
  }
  return Index;
}