From 0c7b33ac052d86ffa26dba00fca0a2cd7ade2da7 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sat, 30 May 2020 00:10:28 +0300 Subject: [PATCH] BiosVideo: Minor cleanup --- Legacy/BootPlatform/BiosVideo/BiosVideo.c | 58 ------------------- Legacy/BootPlatform/BiosVideo/BiosVideo.h | 53 +++++++++++++++++ Legacy/BootPlatform/BiosVideo/BiosVideo.inf | 4 -- .../BootPlatform/BiosVideo/LegacyBiosThunk.c | 6 -- OpenDuetPkg.dsc | 3 + 5 files changed, 56 insertions(+), 68 deletions(-) diff --git a/Legacy/BootPlatform/BiosVideo/BiosVideo.c b/Legacy/BootPlatform/BiosVideo/BiosVideo.c index 0d406130..64c1b157 100644 --- a/Legacy/BootPlatform/BiosVideo/BiosVideo.c +++ b/Legacy/BootPlatform/BiosVideo/BiosVideo.c @@ -61,64 +61,6 @@ EFI_GRAPHICS_OUTPUT_BLT_PIXEL mVgaColorToGraphicsOutputColor[] = { {0xff, 0xff, 0xff, 0x00} // WHITE }; -/** - Install child handle for a detect BiosVideo device and install related protocol - into this handle, such as EFI_GRAPHIC_OUTPUT_PROTOCOL. - - @param This Instance pointer of EFI_DRIVER_BINDING_PROTOCOL - @param ParentHandle Parent's controller handle - @param ParentPciIo Parent's EFI_PCI_IO_PROTOCOL instance pointer - @param ParentLegacy8259 Parent's EFI_LEGACY_8259_PROTOCOL instance pointer - @param ParentDevicePath Parent's BIOS Video controller device path - @param RemainingDevicePath Remaining device path node instance for children. - - @return whether success to create children handle for a VGA device and install - related protocol into new children handle. - -**/ -EFI_STATUS -BiosVideoChildHandleInstall ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ParentHandle, - IN EFI_PCI_IO_PROTOCOL *ParentPciIo, - IN EFI_LEGACY_8259_PROTOCOL *ParentLegacy8259, - IN THUNK_CONTEXT *ThunkContext, - IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -; - -/** - Deregister an video child handle and free resources - - @param This Protocol instance pointer. - @param Controller Video controller handle - @param Handle Video child handle - - @return EFI_STATUS - -**/ - -EFI_STATUS -BiosVideoChildHandleUninstall ( - EFI_DRIVER_BINDING_PROTOCOL *This, - EFI_HANDLE Controller, - EFI_HANDLE Handle - ) -; - -/** - Collect the resource from destroyed bios video device. - - @param BiosVideoPrivate Video child device private data structure -**/ - -VOID -BiosVideoDeviceReleaseResource ( - BIOS_VIDEO_DEV *BiosVideoPrivate - ) -; - /** Driver Entry Point. diff --git a/Legacy/BootPlatform/BiosVideo/BiosVideo.h b/Legacy/BootPlatform/BiosVideo/BiosVideo.h index f2fa0153..3caf16f8 100644 --- a/Legacy/BootPlatform/BiosVideo/BiosVideo.h +++ b/Legacy/BootPlatform/BiosVideo/BiosVideo.h @@ -225,6 +225,59 @@ BiosVideoDriverBindingStop ( IN EFI_HANDLE *ChildHandleBuffer ); +/** + Install child handle for a detect BiosVideo device and install related protocol + into this handle, such as EFI_GRAPHIC_OUTPUT_PROTOCOL. + + @param This Instance pointer of EFI_DRIVER_BINDING_PROTOCOL + @param ParentHandle Parent's controller handle + @param ParentPciIo Parent's EFI_PCI_IO_PROTOCOL instance pointer + @param ParentLegacy8259 Parent's EFI_LEGACY_8259_PROTOCOL instance pointer + @param ParentDevicePath Parent's BIOS Video controller device path + @param RemainingDevicePath Remaining device path node instance for children. + + @return whether success to create children handle for a VGA device and install + related protocol into new children handle. + +**/ +EFI_STATUS +BiosVideoChildHandleInstall ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ParentHandle, + IN EFI_PCI_IO_PROTOCOL *ParentPciIo, + IN EFI_LEGACY_8259_PROTOCOL *ParentLegacy8259, + IN THUNK_CONTEXT *ThunkContext, + IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); + +/** + Deregister an video child handle and free resources + + @param This Protocol instance pointer. + @param Controller Video controller handle + @param Handle Video child handle + + @return EFI_STATUS + +**/ +EFI_STATUS +BiosVideoChildHandleUninstall ( + EFI_DRIVER_BINDING_PROTOCOL *This, + EFI_HANDLE Controller, + EFI_HANDLE Handle + ); + +/** + Collect the resource from destroyed bios video device. + + @param BiosVideoPrivate Video child device private data structure +**/ +VOID +BiosVideoDeviceReleaseResource ( + BIOS_VIDEO_DEV *BiosVideoPrivate + ); + // // Private worker functions // diff --git a/Legacy/BootPlatform/BiosVideo/BiosVideo.inf b/Legacy/BootPlatform/BiosVideo/BiosVideo.inf index 403eb3e8..f6f95e12 100644 --- a/Legacy/BootPlatform/BiosVideo/BiosVideo.inf +++ b/Legacy/BootPlatform/BiosVideo/BiosVideo.inf @@ -50,7 +50,3 @@ gEfiLegacy8259ProtocolGuid gEfiEdidDiscoveredProtocolGuid gEfiEdidActiveProtocolGuid - - [Guids] - gEfiGlobalVariableGuid - diff --git a/Legacy/BootPlatform/BiosVideo/LegacyBiosThunk.c b/Legacy/BootPlatform/BiosVideo/LegacyBiosThunk.c index fa134f88..752824cf 100644 --- a/Legacy/BootPlatform/BiosVideo/LegacyBiosThunk.c +++ b/Legacy/BootPlatform/BiosVideo/LegacyBiosThunk.c @@ -14,8 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "BiosVideo.h" -#define EFI_CPU_EFLAGS_IF 0x200 - /** Initialize legacy environment for BIOS INI caller. @@ -116,8 +114,6 @@ InitializeInterruptRedirection ( for (Index = 0; Index < 8; Index++) { IdtArray[ProtectedModeBaseVector + Index] = ((EFI_SEGMENT (LegacyRegionBase + Index * 4)) << 16) | (EFI_OFFSET (LegacyRegionBase + Index * 4)); } - - return ; } /** @@ -218,5 +214,3 @@ LegacyBiosInt86 ( return Ret; } - - diff --git a/OpenDuetPkg.dsc b/OpenDuetPkg.dsc index e24d8503..0c0191d4 100644 --- a/OpenDuetPkg.dsc +++ b/OpenDuetPkg.dsc @@ -82,6 +82,7 @@ # # Platform # + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf DuetBdsLib|OpenCorePkg/Library/DuetBdsLib/DuetBdsLib.inf TimerLib|OpenCorePkg/Library/DuetTimerLib/DuetTimerLib.inf # @@ -89,8 +90,10 @@ # PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf + FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf