From f4ff0aba2f419e006bccc14eb0008aad913dd1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 9 Mar 2024 11:27:00 +0100 Subject: [PATCH] [FREELDR] Minor code cleanup in arch/uefi files --- boot/freeldr/freeldr/arch/uefi/stubs.c | 2 -- boot/freeldr/freeldr/arch/uefi/uefidisk.c | 4 ++-- boot/freeldr/freeldr/arch/uefi/uefisetup.c | 2 +- boot/freeldr/freeldr/arch/uefi/uefivid.c | 2 +- boot/freeldr/freeldr/include/arch/uefi/machuefi.h | 13 +------------ 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/boot/freeldr/freeldr/arch/uefi/stubs.c b/boot/freeldr/freeldr/arch/uefi/stubs.c index e9263d60ba3..f63bd4d2105 100644 --- a/boot/freeldr/freeldr/arch/uefi/stubs.c +++ b/boot/freeldr/freeldr/arch/uefi/stubs.c @@ -7,8 +7,6 @@ #include -#include - #ifndef _M_ARM /* TODO: Handle this with custom Disk / partition setup */ UCHAR diff --git a/boot/freeldr/freeldr/arch/uefi/uefidisk.c b/boot/freeldr/freeldr/arch/uefi/uefidisk.c index 4905e2b867f..2d5458d4707 100644 --- a/boot/freeldr/freeldr/arch/uefi/uefidisk.c +++ b/boot/freeldr/freeldr/arch/uefi/uefidisk.c @@ -98,7 +98,7 @@ UefiGetBootPartitionEntry( { TRACE("Boot PartitionNumber is 0\n"); /* The OffsetToBoot is equal to the RootIdentifier */ - PartitionNum = 1; + PartitionNum = FIRST_PARTITION; } *BootPartition = PartitionNum; @@ -395,7 +395,7 @@ UefiSetupBlockDevices(VOID) PcBiosDiskCount = 0; UefiBootRootIdentifier = 0; - /* 1) Setup a list of boothandles by using the LocateHandle protocol */ + /* 1) Setup a list of boot handles by using the LocateHandle protocol */ Status = GlobalSystemTable->BootServices->LocateHandle(ByProtocol, &bioGuid, NULL, &handle_size, handles); handles = MmAllocateMemoryWithType(handle_size, LoaderFirmwareTemporary); Status = GlobalSystemTable->BootServices->LocateHandle(ByProtocol, &bioGuid, NULL, &handle_size, handles); diff --git a/boot/freeldr/freeldr/arch/uefi/uefisetup.c b/boot/freeldr/freeldr/arch/uefi/uefisetup.c index ec3b0d405a6..a7950c67621 100644 --- a/boot/freeldr/freeldr/arch/uefi/uefisetup.c +++ b/boot/freeldr/freeldr/arch/uefi/uefisetup.c @@ -52,7 +52,7 @@ MachInit(const char *CmdLine) MachVtbl.HwIdle = UefiHwIdle; /* Setup GOP */ - if (UefiInitalizeVideo() != EFI_SUCCESS) + if (UefiInitializeVideo() != EFI_SUCCESS) { ERR("Failed to setup GOP\n"); } diff --git a/boot/freeldr/freeldr/arch/uefi/uefivid.c b/boot/freeldr/freeldr/arch/uefi/uefivid.c index 341798c4d85..2afd69aee18 100644 --- a/boot/freeldr/freeldr/arch/uefi/uefivid.c +++ b/boot/freeldr/freeldr/arch/uefi/uefivid.c @@ -28,7 +28,7 @@ EFI_GUID EfiGraphicsOutputProtocol = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; /* FUNCTIONS ******************************************************************/ EFI_STATUS -UefiInitalizeVideo(VOID) +UefiInitializeVideo(VOID) { EFI_STATUS Status; EFI_GRAPHICS_OUTPUT_PROTOCOL* gop = NULL; diff --git a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h index 6df376b1494..dbae085dbd2 100644 --- a/boot/freeldr/freeldr/include/arch/uefi/machuefi.h +++ b/boot/freeldr/freeldr/include/arch/uefi/machuefi.h @@ -7,24 +7,17 @@ #include -EFI_STATUS -UefiMachInit(_In_ EFI_HANDLE ImageHandle, - _In_ EFI_SYSTEM_TABLE *SystemTable); - VOID UefiConsPutChar(int Ch); BOOLEAN UefiConsKbHit(VOID); -VOID -UefiConsSetCursor(UINT32 Col, UINT32 Row); - int UefiConsGetCh(void); EFI_STATUS -UefiInitalizeVideo(VOID); +UefiInitializeVideo(VOID); VOID UefiVideoClearScreen(UCHAR Attr); @@ -47,10 +40,6 @@ UefiVideoSetTextCursorPosition(UCHAR X, UCHAR Y); VOID UefiVideoHideShowTextCursor(BOOLEAN Show); -VOID -UefiVideoOutputChar(UCHAR Char, unsigned X, - unsigned Y, ULONG FgColor, ULONG BgColor); - VOID UefiVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y);