/* Reads the general registers into an output buffer and sends it as a packet  */
VOID EFIAPI ReadGeneralRegisters(IN EFI_SYSTEM_CONTEXT SystemContext)
/* Reads the general registers into an output buffer and sends it as a packet  */
VOID EFIAPI ReadGeneralRegisters(IN EFI_SYSTEM_CONTEXT SystemContext)
{
  UINTN  Index;
  CHAR8  *OutBuffer;
  CHAR8  *OutBufPtr;
  UINTN  RegisterCount = MaxRegisterCount ();
  OutBuffer = AllocatePool ((RegisterCount * 8) + 1);
  OutBufPtr = OutBuffer;
  for (Index = 0; Index < RegisterCount; Index++) {
    OutBufPtr = BasicReadRegister (SystemContext, Index, OutBufPtr);
  }
  *OutBufPtr = '\0';
  SendPacket (OutBuffer);
  FreePool (OutBuffer);
}