Refactor part 5; Implement debugging ports
This commit is contained in:
@@ -52,27 +52,6 @@ BlConsoleEnableCursor()
|
||||
EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* This routine initializes the EFI console.
|
||||
*
|
||||
* @return This routine returns status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BlConsoleInitialize()
|
||||
{
|
||||
/* Clear console buffers */
|
||||
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
|
||||
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
|
||||
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
|
||||
|
||||
/* Clear screen and enable cursor */
|
||||
BlConsoleClearScreen();
|
||||
BlConsoleEnableCursor();
|
||||
}
|
||||
|
||||
/**
|
||||
* This routine formats the input string and prints it out to the stdout and serial console.
|
||||
*
|
||||
@@ -99,10 +78,42 @@ BlConsolePrint(IN PUINT16 Format,
|
||||
/* Format and print the string to the stdout */
|
||||
BlpStringPrint(BlpConsolePrintChar, Format, Arguments);
|
||||
|
||||
/* Print to serial console only if not running under OVMF */
|
||||
if(RtlWideStringCompare(EfiSystemTable->FirmwareVendor, L"EDK II", 6) != 0)
|
||||
{
|
||||
/* Check if debugging enabled and if EFI serial port is fully initialized */
|
||||
if(DEBUG && (BlpSerialPort.Flags & COMPORT_FLAG_INIT))
|
||||
{
|
||||
/* Format and print the string to the serial console */
|
||||
BlpStringPrint(BlpDebugPutChar, Format, Arguments);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clean up the va_list */
|
||||
VA_END(Arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* This routine initializes the EFI console.
|
||||
*
|
||||
* @return This routine returns status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BlpConsoleInitialize()
|
||||
{
|
||||
/* Clear console buffers */
|
||||
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
|
||||
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
|
||||
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
|
||||
|
||||
/* Clear screen and enable cursor */
|
||||
BlConsoleClearScreen();
|
||||
BlConsoleEnableCursor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a character to the default EFI console.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user