XTLDR console/debug print refactor

This commit is contained in:
2024-02-16 15:09:18 +01:00
parent 5de4d7a7f5
commit 8ddd6137da
3 changed files with 30 additions and 30 deletions

View File

@@ -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;
}