Skip to content

Commit

Permalink
EfiLdr: Consumed UefiImageLib.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikhailKrichanov committed Oct 23, 2023
1 parent c94f21e commit ee72ccd
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 583 deletions.
11 changes: 10 additions & 1 deletion Legacy/BootPlatform/EfiLdr/EfiLdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Revision History:
#include "EfiLdrHandoff.h"

#include <Protocol/LoadedImage.h>
#include <IndustryStandard/PeImage.h>
#include <IndustryStandard/PeImage2.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PrintLib.h>
Expand Down Expand Up @@ -86,4 +86,13 @@ VOID
IN EFILDRHANDOFF *Handoff
);

EFI_STATUS
EfiLdrLoadImage (
IN VOID *FHand,
IN UINT32 BufferSize,
IN EFILDR_LOADED_IMAGE *Image,
IN UINTN *NumberOfMemoryMapEntries,
IN EFI_MEMORY_DESCRIPTOR *EfiMemoryDescriptor
);

#endif //_DUET_EFI_LOADER_H_
2 changes: 1 addition & 1 deletion Legacy/BootPlatform/EfiLdr/EfiLdr.inf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
PrintLib
LzmaDecompressLib
SerialPortLib
UefiImageOnlyFvLib

[Sources]
PeLoader.h
Support.h
EfiLdrHandoff.h
EfiLdr.h
Expand Down
7 changes: 4 additions & 3 deletions Legacy/BootPlatform/EfiLdr/EfiLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Revision History:

#include "EfiLdr.h"
#include "Support.h"
#include "PeLoader.h"
#include "LzmaDecompress.h"

#include <Library/SerialPortLib.h>
Expand Down Expand Up @@ -142,8 +141,9 @@ EfiLoader (
//
// Load and relocate the EFI PE/COFF Firmware Image
//
Status = EfiLdrPeCoffLoadPeImage (
Status = EfiLdrLoadImage (
(VOID *)(UINTN)(EFI_DECOMPRESSED_BUFFER_ADDRESS),
DestinationSize,
&DxeIplImage,
&NumberOfMemoryMapEntries,
EfiMemoryDescriptor
Expand Down Expand Up @@ -184,8 +184,9 @@ EfiLoader (
//
// Load and relocate the EFI PE/COFF Firmware Image
//
Status = EfiLdrPeCoffLoadPeImage (
Status = EfiLdrLoadImage (
(VOID *)(UINTN)(EFI_DECOMPRESSED_BUFFER_ADDRESS),
DestinationSize,
&DxeCoreImage,
&NumberOfMemoryMapEntries,
EfiMemoryDescriptor
Expand Down
Loading

0 comments on commit ee72ccd

Please sign in to comment.