XTLDR console/debug print refactor
This commit is contained in:
parent
5de4d7a7f5
commit
8ddd6137da
|
@ -102,7 +102,7 @@ BlConsolePrint(IN PUSHORT Format,
|
|||
VA_LIST Arguments;
|
||||
|
||||
/* Initialise the print contexts */
|
||||
ConsolePrintContext.WriteWideCharacter = BlpConsolePrintChar;
|
||||
ConsolePrintContext.WriteWideCharacter = BlpConsolePutChar;
|
||||
SerialPrintContext.WriteWideCharacter = BlpDebugPutChar;
|
||||
|
||||
/* Initialise the va_list */
|
||||
|
@ -292,7 +292,7 @@ BlSetCursorPosition(IN ULONGLONG PosX,
|
|||
*/
|
||||
XTCDECL
|
||||
XTSTATUS
|
||||
BlpConsolePrintChar(IN USHORT Character)
|
||||
BlpConsolePutChar(IN USHORT Character)
|
||||
{
|
||||
USHORT Buffer[2];
|
||||
|
||||
|
@ -300,7 +300,7 @@ BlpConsolePrintChar(IN USHORT Character)
|
|||
if(Character == L'\n')
|
||||
{
|
||||
/* Print carriage return ('\r') as well */
|
||||
BlpConsolePrintChar(L'\r');
|
||||
BlpConsolePutChar(L'\r');
|
||||
}
|
||||
|
||||
/* Write character to the screen console */
|
||||
|
|
|
@ -34,7 +34,7 @@ BlDebugPrint(IN PUSHORT Format,
|
|||
if(DEBUG)
|
||||
{
|
||||
/* Initialize the print contexts */
|
||||
ConsolePrintContext.WriteWideCharacter = BlpConsolePrintChar;
|
||||
ConsolePrintContext.WriteWideCharacter = BlpConsolePutChar;
|
||||
SerialPrintContext.WriteWideCharacter = BlpDebugPutChar;
|
||||
|
||||
/* Initialise the va_list */
|
||||
|
@ -59,6 +59,31 @@ BlDebugPrint(IN PUSHORT Format,
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a character to the serial console.
|
||||
*
|
||||
* @param Character
|
||||
* The integer promotion of the character to be written.
|
||||
*
|
||||
* @return This routine returns a status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
XTSTATUS
|
||||
BlpDebugPutChar(IN USHORT Character)
|
||||
{
|
||||
USHORT Buffer[2];
|
||||
|
||||
/* Write character to the serial console */
|
||||
Buffer[0] = Character;
|
||||
Buffer[1] = 0;
|
||||
HlComPortPutByte(&BlpStatus.SerialPort, Buffer[0]);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This routine initializes the XTLDR debug console.
|
||||
*
|
||||
|
@ -243,28 +268,3 @@ BlpInitializeSerialPort(IN ULONG PortNumber,
|
|||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a character to the serial console.
|
||||
*
|
||||
* @param Character
|
||||
* The integer promotion of the character to be written.
|
||||
*
|
||||
* @return This routine returns a status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
XTSTATUS
|
||||
BlpDebugPutChar(IN USHORT Character)
|
||||
{
|
||||
USHORT Buffer[2];
|
||||
|
||||
/* Write character to the serial console */
|
||||
Buffer[0] = Character;
|
||||
Buffer[1] = 0;
|
||||
HlComPortPutByte(&BlpStatus.SerialPort, Buffer[0]);
|
||||
|
||||
/* Return success */
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -357,7 +357,7 @@ BlpActivateSerialIOController();
|
|||
|
||||
XTCDECL
|
||||
XTSTATUS
|
||||
BlpConsolePrintChar(IN USHORT Character);
|
||||
BlpConsolePutChar(IN USHORT Character);
|
||||
|
||||
XTCDECL
|
||||
XTSTATUS
|
||||
|
|
Loading…
Reference in New Issue