Refactor part 1
This commit is contained in:
parent
55bd9e326f
commit
fce8a50321
@ -36,5 +36,5 @@ set_install_target(xtldr efi/boot)
|
||||
|
||||
# Set loader entrypoint and subsystem
|
||||
set_imagebase(xtldr ${BASEADDRESS_XTLDR})
|
||||
set_entrypoint(xtldr "BmStartXtLoader")
|
||||
set_entrypoint(xtldr "BlStartXtLoader")
|
||||
set_subsystem(xtldr efi_application)
|
||||
|
@ -2,16 +2,23 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/config.c
|
||||
* DESCRIPTION: XT Boot Manager Configuration
|
||||
* DESCRIPTION: XT Boot Loader Configuration
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
#include <xtbm.h>
|
||||
|
||||
|
||||
/**
|
||||
* Parses command line arguments and updates global configuration.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpParseCommandLineOptions(VOID)
|
||||
BlpConfigParseCommandLine(VOID)
|
||||
{
|
||||
EFI_GUID LIPGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
||||
PEFI_LOADED_IMAGE_PROTOCOL LoadedImage;
|
||||
@ -25,14 +32,24 @@ BmpParseCommandLineOptions(VOID)
|
||||
if(LoadedImage && LoadedImage->LoadOptions)
|
||||
{
|
||||
/* Update global boot loader configuration */
|
||||
BmpUpdateGlobalConfiguration(LoadedImage->LoadOptions);
|
||||
BlpConfigUpdateGlobalConfiguration(LoadedImage->LoadOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates XTLDR configuration based on provided options.
|
||||
*
|
||||
* @param Options
|
||||
* Supplies a formatted list of options to be processed and stored in global configuration.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
{
|
||||
PWCHAR Argument, LastArg;
|
||||
SIZE_T Length;
|
||||
@ -51,9 +68,9 @@ BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
Length = RtlWideStringLength(Argument, 0);
|
||||
|
||||
/* Save default OS parameter in global configuration */
|
||||
BmAllocateEfiPool(Length, (PVOID *)&BmpConfiguration.Default);
|
||||
RtlCopyMemory(BmpConfiguration.Default, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BmpConfiguration.Default[Length] = '\0';
|
||||
BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Default);
|
||||
RtlCopyMemory(BlpConfiguration.Default, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BlpConfiguration.Default[Length] = '\0';
|
||||
}
|
||||
else if(RtlWideStringCompare(Argument, L"DEBUG=", 6) == 0)
|
||||
{
|
||||
@ -62,14 +79,14 @@ BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
Length = RtlWideStringLength(Argument, 0);
|
||||
|
||||
/* Save debug port in global configuration */
|
||||
BmAllocateEfiPool(Length, (PVOID *)&BmpConfiguration.Debug);
|
||||
RtlCopyMemory(BmpConfiguration.Debug, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BmpConfiguration.Debug[Length] = '\0';
|
||||
BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Debug);
|
||||
RtlCopyMemory(BlpConfiguration.Debug, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BlpConfiguration.Debug[Length] = '\0';
|
||||
}
|
||||
else if(RtlWideStringCompare(Argument, L"SHELL", 5) == 0)
|
||||
{
|
||||
/* Force shell mode */
|
||||
BmpConfiguration.Shell = TRUE;
|
||||
BlpConfiguration.Shell = TRUE;
|
||||
}
|
||||
else if(RtlWideStringCompare(Argument, L"THEME=", 6) == 0)
|
||||
{
|
||||
@ -78,9 +95,9 @@ BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
Length = RtlWideStringLength(Argument, 0);
|
||||
|
||||
/* Save theme in global configuration */
|
||||
BmAllocateEfiPool(Length, (PVOID *)&BmpConfiguration.Theme);
|
||||
RtlCopyMemory(BmpConfiguration.Theme, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BmpConfiguration.Theme[Length] = '\0';
|
||||
BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Theme);
|
||||
RtlCopyMemory(BlpConfiguration.Theme, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BlpConfiguration.Theme[Length] = '\0';
|
||||
}
|
||||
else if(RtlWideStringCompare(Argument, L"TIMEOUT=", 8) == 0)
|
||||
{
|
||||
@ -88,13 +105,13 @@ BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
Argument += 8;
|
||||
|
||||
/* Zero the timeout */
|
||||
BmpConfiguration.Timeout = 0;
|
||||
BlpConfiguration.Timeout = 0;
|
||||
|
||||
/* Read the timeout value and store it in global configuration */
|
||||
while(*Argument >= '0' && *Argument <= '9')
|
||||
{
|
||||
BmpConfiguration.Timeout *= 10;
|
||||
BmpConfiguration.Timeout += *Argument - '0';
|
||||
BlpConfiguration.Timeout *= 10;
|
||||
BlpConfiguration.Timeout += *Argument - '0';
|
||||
Argument++;
|
||||
}
|
||||
}
|
||||
@ -105,9 +122,9 @@ BmpUpdateGlobalConfiguration(IN PWCHAR Options)
|
||||
Length = RtlWideStringLength(Argument, 0);
|
||||
|
||||
/* Save theme in global configuration */
|
||||
BmAllocateEfiPool(Length, (PVOID *)&BmpConfiguration.Tune);
|
||||
RtlCopyMemory(BmpConfiguration.Tune, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BmpConfiguration.Tune[Length] = '\0';
|
||||
BlMemoryAllocatePool(Length, (PVOID *)&BlpConfiguration.Tune);
|
||||
RtlCopyMemory(BlpConfiguration.Tune, Argument, (Length * sizeof(WCHAR)) - 1);
|
||||
BlpConfiguration.Tune[Length] = '\0';
|
||||
}
|
||||
|
||||
/* Take next argument */
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmClearScreen()
|
||||
BlConsoleClearScreen()
|
||||
{
|
||||
/* Clear screen */
|
||||
EfiSystemTable->ConOut->ClearScreen(EfiSystemTable->ConOut);
|
||||
@ -33,7 +33,7 @@ BmClearScreen()
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmDisableCursor()
|
||||
BlConsoleDisableCursor()
|
||||
{
|
||||
EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, FALSE);
|
||||
}
|
||||
@ -47,7 +47,7 @@ BmDisableCursor()
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmEnableCursor()
|
||||
BlConsoleEnableCursor()
|
||||
{
|
||||
EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE);
|
||||
}
|
||||
@ -61,7 +61,7 @@ BmEnableCursor()
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmInitializeConsole()
|
||||
BlConsoleInitialize()
|
||||
{
|
||||
/* Clear console buffers */
|
||||
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
|
||||
@ -69,8 +69,8 @@ BmInitializeConsole()
|
||||
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
|
||||
|
||||
/* Clear screen and enable cursor */
|
||||
BmClearScreen();
|
||||
BmEnableCursor();
|
||||
BlConsoleClearScreen();
|
||||
BlConsoleEnableCursor();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,7 +88,7 @@ BmInitializeConsole()
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrint(IN PUINT16 Format,
|
||||
BlConsolePrint(IN PUINT16 Format,
|
||||
IN ...)
|
||||
{
|
||||
VA_LIST Arguments;
|
||||
@ -97,7 +97,7 @@ BmPrint(IN PUINT16 Format,
|
||||
VA_START(Arguments, Format);
|
||||
|
||||
/* Format and print the string to the stdout */
|
||||
BmPrintString(BmPrintChar, Format, Arguments);
|
||||
BlpStringPrint(BlpConsolePrintChar, Format, Arguments);
|
||||
|
||||
/* Clean up the va_list */
|
||||
VA_END(Arguments);
|
||||
@ -115,7 +115,7 @@ BmPrint(IN PUINT16 Format,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrintChar(IN USHORT Character)
|
||||
BlpConsolePrintChar(IN USHORT Character)
|
||||
{
|
||||
USHORT Buffer[2];
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/globals.c
|
||||
* DESCRIPTION: XT Boot Manager global variables
|
||||
* DESCRIPTION: XT Boot Loader global variables
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
|
||||
|
||||
/* XT Boot Loader configuration data */
|
||||
XTBM_CONFIGURATION BmpConfiguration = {0};
|
||||
XTBM_CONFIGURATION BlpConfiguration = {0};
|
||||
|
||||
/* XT Boot Loader hex table */
|
||||
STATIC PUINT16 BmpHexTable = L"0123456789ABCDEF";
|
||||
STATIC PUINT16 BlpHexTable = L"0123456789ABCDEF";
|
||||
|
||||
/* Serial port configuration */
|
||||
CPPORT BmpSerialPort;
|
||||
CPPORT BlpSerialPort;
|
||||
|
||||
/* EFI Image Handle */
|
||||
EFI_HANDLE EfiImageHandle;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/hardware.c
|
||||
* DESCRIPTION: XT Boot Manager EFI hardware support
|
||||
* DESCRIPTION: EFI hardware support for XT Boot Loader
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmActivateSerialIOController()
|
||||
BlpHwActivateSerialIOController()
|
||||
{
|
||||
EFI_GUID PciGuid = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
|
||||
PEFI_PCI_ROOT_BRIDGE_IO_PROTOCOL PciDev;
|
||||
@ -31,7 +31,7 @@ BmActivateSerialIOController()
|
||||
|
||||
/* Allocate memory for single EFI_HANDLE, what should be enough in most cases */
|
||||
PciHandleSize = sizeof(EFI_HANDLE);
|
||||
Status = BmAllocateEfiPool(PciHandleSize, (PVOID*)&PciHandle);
|
||||
Status = BlMemoryAllocatePool(PciHandleSize, (PVOID*)&PciHandle);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Memory allocation failure */
|
||||
@ -43,8 +43,8 @@ BmActivateSerialIOController()
|
||||
if(Status == STATUS_EFI_BUFFER_TOO_SMALL)
|
||||
{
|
||||
/* Reallocate more memory as requested by UEFI */
|
||||
BmFreeEfiPool(PciHandle);
|
||||
Status = BmAllocateEfiPool(PciHandleSize, (PVOID*)&PciHandle);
|
||||
BlMemoryFreePool(PciHandle);
|
||||
Status = BlMemoryAllocatePool(PciHandleSize, (PVOID*)&PciHandle);
|
||||
if(Status != STATUS_EFI_SUCCESS)
|
||||
{
|
||||
/* Memory reallocation failure */
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/includes/xtbm.h
|
||||
* DESCRIPTION: XTLDR Boot Manager related structures and routines forward references
|
||||
* DESCRIPTION: XTLDR Boot Loader related structures and routines forward references
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
@ -17,53 +17,53 @@ typedef VOID (BMPRINTCHAR)(IN USHORT Character);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmAllocateEfiPages(IN UINT64 Pages,
|
||||
BlMemoryAllocatePages(IN UINT64 Pages,
|
||||
OUT PEFI_PHYSICAL_ADDRESS Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmAllocateEfiPool(IN UINT_PTR Size,
|
||||
BlMemoryAllocatePool(IN UINT_PTR Size,
|
||||
OUT PVOID *Memory);
|
||||
|
||||
/* XTLDR routines forward references */
|
||||
XTCDECL
|
||||
VOID
|
||||
BmClearScreen();
|
||||
BlConsoleClearScreen();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmDisableCursor();
|
||||
BlConsoleDisableCursor();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmEnableCursor();
|
||||
BlConsoleEnableCursor();
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmFreeEfiPages(IN UINT64 Pages,
|
||||
BlMemoreFreePages(IN UINT64 Pages,
|
||||
IN EFI_PHYSICAL_ADDRESS Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmFreeEfiPool(IN PVOID Memory);
|
||||
BlMemoryFreePool(IN PVOID Memory);
|
||||
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmInitializeConsole();
|
||||
BlConsoleInitialize();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrint(IN PUINT16 Format,
|
||||
BlConsolePrint(IN PUINT16 Format,
|
||||
IN ...);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrintChar(IN USHORT Character);
|
||||
BlpConsolePrintChar(IN USHORT Character);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrint(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN VA_LIST Arguments);
|
||||
|
||||
@ -75,46 +75,46 @@ BmStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringFormat(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN ...);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpParseCommandLineOptions(VOID);
|
||||
BlpConfigParseCommandLine(VOID);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT Number,
|
||||
IN UINT Base);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT_PTR Number,
|
||||
IN UINT_PTR Base);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT Number,
|
||||
IN UINT Base,
|
||||
IN UINT Padding);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT_PTR Number,
|
||||
IN UINT_PTR Base,
|
||||
IN UINT_PTR Padding);
|
||||
|
||||
XTCDECL
|
||||
UINT64
|
||||
BmpReadStringPadding(IN PUINT16 *Format);
|
||||
BlpStringReadPadding(IN PUINT16 *Format);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpUpdateGlobalConfiguration(IN PWCHAR Options);
|
||||
BlpConfigUpdateGlobalConfiguration(IN PWCHAR Options);
|
||||
|
||||
#endif /* __XTLDR_BOOTMAN_H */
|
||||
|
@ -13,13 +13,13 @@
|
||||
|
||||
|
||||
/* XT Boot Loader configuration data */
|
||||
EXTERN XTBM_CONFIGURATION BmpConfiguration;
|
||||
EXTERN XTBM_CONFIGURATION BlpConfiguration;
|
||||
|
||||
/* XT Boot Loader hex table */
|
||||
EXTERN PUINT16 BmpHexTable;
|
||||
EXTERN PUINT16 BlpHexTable;
|
||||
|
||||
/* Serial port configuration */
|
||||
EXTERN CPPORT BmpSerialPort;
|
||||
EXTERN CPPORT BlpSerialPort;
|
||||
|
||||
/* EFI Image Handle */
|
||||
EXTERN EFI_HANDLE EfiImageHandle;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/memory.c
|
||||
* DESCRIPTION: XT Boot Manager EFI memory management
|
||||
* DESCRIPTION: XT Boot Loader memory management
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmAllocateEfiPages(IN UINT64 Pages,
|
||||
BlMemoryAllocatePages(IN UINT64 Pages,
|
||||
OUT PEFI_PHYSICAL_ADDRESS Memory)
|
||||
{
|
||||
return EfiSystemTable->BootServices->AllocatePages(AllocateAnyPages, EfiLoaderData, Pages, Memory);
|
||||
@ -45,7 +45,7 @@ BmAllocateEfiPages(IN UINT64 Pages,
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmAllocateEfiPool(IN UINT_PTR Size,
|
||||
BlMemoryAllocatePool(IN UINT_PTR Size,
|
||||
OUT PVOID *Memory)
|
||||
{
|
||||
/* Allocate pool */
|
||||
@ -67,7 +67,7 @@ BmAllocateEfiPool(IN UINT_PTR Size,
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmFreeEfiPages(IN UINT64 Pages,
|
||||
BlMemoreFreePages(IN UINT64 Pages,
|
||||
IN EFI_PHYSICAL_ADDRESS Memory)
|
||||
{
|
||||
return EfiSystemTable->BootServices->FreePages(Memory, Pages);
|
||||
@ -85,7 +85,7 @@ BmFreeEfiPages(IN UINT64 Pages,
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmFreeEfiPool(IN PVOID Memory)
|
||||
BlMemoryFreePool(IN PVOID Memory)
|
||||
{
|
||||
/* Free pool */
|
||||
return EfiSystemTable->BootServices->FreePool(Memory);
|
||||
|
@ -27,7 +27,7 @@
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrint(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN VA_LIST Arguments)
|
||||
{
|
||||
@ -46,7 +46,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'b':
|
||||
/* Boolean */
|
||||
BmpFormatString(PrintCharRoutine, L"%s", VA_ARG(Arguments, INT32) ? "TRUE" : "FALSE");
|
||||
BlpStringFormat(PrintCharRoutine, L"%s", VA_ARG(Arguments, INT32) ? "TRUE" : "FALSE");
|
||||
break;
|
||||
case L'c':
|
||||
/* Character */
|
||||
@ -54,12 +54,12 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'd':
|
||||
/* Signed 32-bit integer */
|
||||
BmpPrintSigned32String(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
BlpStringPrintSigned32(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
break;
|
||||
case L'g':
|
||||
/* EFI GUID */
|
||||
Guid = VA_ARG(Arguments, PEFI_GUID);
|
||||
BmpFormatString(PrintCharRoutine, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Guid->Data1,
|
||||
BlpStringFormat(PrintCharRoutine, L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", Guid->Data1,
|
||||
Guid->Data2, Guid->Data3, Guid->Data4[0], Guid->Data4[1], Guid->Data4[2],
|
||||
Guid->Data4[3], Guid->Data4[4], Guid->Data4[5], Guid->Data4[6], Guid->Data4[7]);
|
||||
break;
|
||||
@ -69,15 +69,15 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'd':
|
||||
/* Signed 64-bit integer */
|
||||
BmpPrintSigned64String(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
BlpStringPrintSigned64(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
break;
|
||||
case L'u':
|
||||
/* Unsigned 64-bit integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, 0);
|
||||
break;
|
||||
case L'x':
|
||||
/* Unsigned 64-bit hexadecimal integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@ -87,7 +87,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'p':
|
||||
/* Pointer address */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, 0);
|
||||
break;
|
||||
case L's':
|
||||
/* String of characters */
|
||||
@ -106,21 +106,21 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'u':
|
||||
/* Unsigned 32-bit integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, 0);
|
||||
break;
|
||||
case L'x':
|
||||
/* Unsigned 32-bit hexadecimal integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, 0);
|
||||
break;
|
||||
case L'0':
|
||||
/* Zero padded numbers */
|
||||
++Format;
|
||||
PaddingCount = BmpReadStringPadding(&Format);
|
||||
PaddingCount = BlpStringReadPadding(&Format);
|
||||
switch(*Format)
|
||||
{
|
||||
case L'd':
|
||||
/* Zero-padded, signed 32-bit integer */
|
||||
BmpPrintSigned32String(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
BlpStringPrintSigned32(PrintCharRoutine, VA_ARG(Arguments, INT32), 10);
|
||||
break;
|
||||
case L'l':
|
||||
/* 64-bit numbers */
|
||||
@ -128,15 +128,15 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
{
|
||||
case L'd':
|
||||
/* Zero-padded, signed 64-bit integer */
|
||||
BmpPrintSigned64String(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
BlpStringPrintSigned64(PrintCharRoutine, VA_ARG(Arguments, INT_PTR), 10);
|
||||
break;
|
||||
case L'u':
|
||||
/* Zero-padded, unsigned 64-bit integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, PaddingCount);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 10, PaddingCount);
|
||||
break;
|
||||
case L'x':
|
||||
/* Zero-padded, unsigned 64-bit hexadecimal integer */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, PaddingCount);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, VA_ARG(Arguments, UINT_PTR), 16, PaddingCount);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@ -146,11 +146,11 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
break;
|
||||
case L'u':
|
||||
/* Zero-padded, unsigned 32-bit integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, PaddingCount);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 10, PaddingCount);
|
||||
break;
|
||||
case L'x':
|
||||
/* Zero-padded, unsigned 32-bit hexadecimal integer */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, PaddingCount);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, VA_ARG(Arguments, UINT32), 16, PaddingCount);
|
||||
break;
|
||||
default:
|
||||
/* Unknown by default */
|
||||
@ -202,7 +202,7 @@ BmPrintString(IN IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringFormat(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN PUINT16 Format,
|
||||
IN ...)
|
||||
{
|
||||
@ -212,7 +212,7 @@ BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
VA_START(Arguments, Format);
|
||||
|
||||
/* Format and print the string to the desired output */
|
||||
BmPrintString(PrintCharRoutine, Format, Arguments);
|
||||
BlpStringPrint(PrintCharRoutine, Format, Arguments);
|
||||
|
||||
/* Clean up the va_list */
|
||||
VA_END(Arguments);
|
||||
@ -236,7 +236,7 @@ BmpFormatString(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT Number,
|
||||
IN UINT Base)
|
||||
{
|
||||
@ -248,7 +248,7 @@ BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
}
|
||||
|
||||
/* Print the integer value */
|
||||
BmpPrintUnsigned32String(PrintCharRoutine, Number, Base, 0);
|
||||
BlpStringPrintUnsigned32(PrintCharRoutine, Number, Base, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -269,7 +269,7 @@ BmpPrintSigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintSigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN INT_PTR Number,
|
||||
IN UINT_PTR Base)
|
||||
{
|
||||
@ -281,7 +281,7 @@ BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
}
|
||||
|
||||
/* Print the integer value */
|
||||
BmpPrintUnsigned64String(PrintCharRoutine, Number, Base, 0);
|
||||
BlpStringPrintUnsigned64(PrintCharRoutine, Number, Base, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -305,7 +305,7 @@ BmpPrintSigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned32(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT Number,
|
||||
IN UINT Base,
|
||||
IN UINT Padding)
|
||||
@ -321,7 +321,7 @@ BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*--Pointer = 0;
|
||||
do
|
||||
{
|
||||
*--Pointer = BmpHexTable[Number % Base];
|
||||
*--Pointer = BlpHexTable[Number % Base];
|
||||
} while(Pointer >= Buffer && (Number /= Base));
|
||||
|
||||
/* Calculate number length */
|
||||
@ -366,7 +366,7 @@ BmpPrintUnsigned32String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
VOID
|
||||
BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
BlpStringPrintUnsigned64(IN BMPRINTCHAR PrintCharRoutine,
|
||||
IN UINT_PTR Number,
|
||||
IN UINT_PTR Base,
|
||||
IN UINT_PTR Padding)
|
||||
@ -382,7 +382,7 @@ BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*--Pointer = 0;
|
||||
do
|
||||
{
|
||||
*--Pointer = BmpHexTable[Number % Base];
|
||||
*--Pointer = BlpHexTable[Number % Base];
|
||||
} while(Pointer >= Buffer && (Number /= Base));
|
||||
|
||||
/* Calculate number length */
|
||||
@ -418,7 +418,7 @@ BmpPrintUnsigned64String(IN BMPRINTCHAR PrintCharRoutine,
|
||||
*/
|
||||
XTCDECL
|
||||
UINT64
|
||||
BmpReadStringPadding(IN PUINT16 *Format)
|
||||
BlpStringReadPadding(IN PUINT16 *Format)
|
||||
{
|
||||
ULONG Count = 0;
|
||||
PUINT16 Fmt = *Format;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PROJECT: ExectOS
|
||||
* COPYRIGHT: See COPYING.md in the top level directory
|
||||
* FILE: xtldr/xtldr.c
|
||||
* DESCRIPTION: XTOS UEFI Boot Manager
|
||||
* DESCRIPTION: XTOS UEFI Boot Loader
|
||||
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
|
||||
*/
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* This routine is the entry point of the XT EFI boot manager.
|
||||
* This routine is the entry point of the XT EFI boot loader.
|
||||
*
|
||||
* @param ImageHandle
|
||||
* Firmware-allocated handle that identifies the image.
|
||||
@ -24,7 +24,7 @@
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
BlStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
IN PEFI_SYSTEM_TABLE SystemTable)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
Loading…
Reference in New Issue
Block a user