Implement BlGetSecureBootStatus() and do some refactoring
Some checks failed
Builds / ExectOS (amd64) (push) Failing after 17s
Builds / ExectOS (i686) (push) Failing after 14s

This commit is contained in:
2023-12-12 18:35:35 +01:00
parent ced6909d82
commit ff7ff90499
8 changed files with 66 additions and 42 deletions

View File

@@ -36,14 +36,14 @@ BlDebugPrint(IN PUINT16 Format,
VA_START(Arguments, Format);
/* Check if serial debug port is enabled */
if((BlpDebugPort & XTBL_DEBUGPORT_SERIAL) && (BlpSerialPort.Flags & COMPORT_FLAG_INIT))
if((BlpStatus.DebugPort & XTBL_DEBUGPORT_SERIAL) && (BlpStatus.SerialPort.Flags & COMPORT_FLAG_INIT))
{
/* Format and print the string to the serial console */
BlpStringPrint(BlpDebugPutChar, Format, Arguments);
}
/* Check if screen debug port is enabled and Boot Services are still available */
if((BlpDebugPort & XTBL_DEBUGPORT_SCREEN) && (BlpStatus.BootServices == TRUE))
if((BlpStatus.DebugPort & XTBL_DEBUGPORT_SCREEN) && (BlpStatus.BootServices == TRUE))
{
/* Format and print the string to the screen */
BlpStringPrint(BlpConsolePrintChar, Format, Arguments);
@@ -78,7 +78,7 @@ BlpInitializeDebugConsole()
DebugConfiguration = BlGetConfigValue(L"DEBUG");
/* Make sure any debug options are provided and debug console is not initialized yet */
if(DebugConfiguration && BlpDebugPort == 0)
if(DebugConfiguration && BlpStatus.DebugPort == 0)
{
/* Find all debug ports */
DebugPort = RtlTokenizeWideString(DebugConfiguration, L";", &LastPort);
@@ -141,12 +141,12 @@ BlpInitializeDebugConsole()
}
/* Enable debug port */
BlpDebugPort |= XTBL_DEBUGPORT_SERIAL;
BlpStatus.DebugPort |= XTBL_DEBUGPORT_SERIAL;
}
else if(RtlCompareWideStringInsensitive(DebugPort, L"SCREEN", 5) == 0)
{
/* Enable debug port */
BlpDebugPort |= XTBL_DEBUGPORT_SCREEN;
BlpStatus.DebugPort |= XTBL_DEBUGPORT_SCREEN;
}
else
{
@@ -158,18 +158,18 @@ BlpInitializeDebugConsole()
/* Take next debug port */
DebugPort = RtlTokenizeWideString(NULL, L";", &LastPort);
}
}
/* Check if serial debug port is enabled */
if(BlpDebugPort & XTBL_DEBUGPORT_SERIAL)
{
/* Try to initialize COM port */
Status = BlpInitializeSerialPort(PortNumber, PortAddress, BaudRate);
if(Status != STATUS_EFI_SUCCESS)
/* Check if serial debug port is enabled */
if(BlpStatus.DebugPort & XTBL_DEBUGPORT_SERIAL)
{
/* Remove serial debug port, as COM port initialization failed and return */
BlpDebugPort &= ~XTBL_DEBUGPORT_SERIAL;
return Status;
/* Try to initialize COM port */
Status = BlpInitializeSerialPort(PortNumber, PortAddress, BaudRate);
if(Status != STATUS_EFI_SUCCESS)
{
/* Remove serial debug port, as COM port initialization failed and return */
BlpStatus.DebugPort &= ~XTBL_DEBUGPORT_SERIAL;
return Status;
}
}
}
@@ -213,7 +213,7 @@ BlpInitializeSerialPort(IN ULONG PortNumber,
}
/* Initialize COM port */
Status = HlInitializeComPort(&BlpSerialPort, PortNumber, UlongToPtr(PortAddress), BaudRate);
Status = HlInitializeComPort(&BlpStatus.SerialPort, PortNumber, UlongToPtr(PortAddress), BaudRate);
/* Port not found under supplied address */
if(Status == STATUS_NOT_FOUND && PortAddress)
@@ -224,7 +224,7 @@ BlpInitializeSerialPort(IN ULONG PortNumber,
{
/* Try to reinitialize COM port */
BlConsolePrint(L"Enabled I/O space access for all PCI(E) serial controllers found\n");
Status = HlInitializeComPort(&BlpSerialPort, PortNumber, UlongToPtr(PortAddress), BaudRate);
Status = HlInitializeComPort(&BlpStatus.SerialPort, PortNumber, UlongToPtr(PortAddress), BaudRate);
}
}
@@ -259,5 +259,5 @@ BlpDebugPutChar(IN USHORT Character)
Buffer[0] = Character;
Buffer[1] = 0;
HlComPortPutByte(&BlpSerialPort, Buffer[0]);
HlComPortPutByte(&BlpStatus.SerialPort, Buffer[0]);
}