X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=DuetPkg%2FEfiLdr%2FEfiLoader.c;h=609e5474832b4bf4ab0033519eb0fb64925b39c4;hb=685f8c760077cb2fb11b74c5758a6d54aebf539f;hp=d55dfdb791b161c8c52f7a6b5d13cf2d93d30bd3;hpb=c51b1cb6a427bb232b335864bf3141c2cee04374;p=mirror_edk2.git diff --git a/DuetPkg/EfiLdr/EfiLoader.c b/DuetPkg/EfiLdr/EfiLoader.c index d55dfdb791..609e547483 100644 --- a/DuetPkg/EfiLdr/EfiLoader.c +++ b/DuetPkg/EfiLdr/EfiLoader.c @@ -1,7 +1,7 @@ /*++ -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -22,9 +22,8 @@ Revision History: #include "Support.h" #include "Debug.h" #include "PeLoader.h" -#include "TianoDecompress.h" +#include "LzmaDecompress.h" -STATIC VOID SystemHang( VOID @@ -41,7 +40,6 @@ EfiLoader ( ) { BIOS_MEMORY_MAP *BiosMemoryMap; - EFILDR_HEADER *EFILDRHeader; EFILDR_IMAGE *EFILDRImage; EFI_MEMORY_DESCRIPTOR EfiMemoryDescriptor[EFI_MAX_MEMORY_DESCRIPTORS]; EFI_STATUS Status; @@ -52,13 +50,13 @@ EfiLoader ( UINTN BfvBase; EFI_MAIN_ENTRYPOINT EfiMainEntrypoint; CHAR8 PrintBuffer[256]; - static EFILDRHANDOFF Handoff; + STATIC EFILDRHANDOFF Handoff; ClearScreen(); PrintHeader ('A'); - - AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader ...\n", BiosMemoryMapBaseAddress); + + AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader...\n"); PrintString (PrintBuffer); AsciiSPrint (PrintBuffer, 256, "BiosMemoryMapBaseAddress = 0x%x\n", BiosMemoryMapBaseAddress); @@ -79,7 +77,7 @@ EfiLoader ( // Get information on where the image is in memory // - EFILDRHeader = (EFILDR_HEADER *)(UINTN)(EFILDR_HEADER_ADDRESS); + //EFILDRHeader = (EFILDR_HEADER *)(UINTN)(EFILDR_HEADER_ADDRESS); EFILDRImage = (EFILDR_IMAGE *)(UINTN)(EFILDR_HEADER_ADDRESS + sizeof(EFILDR_HEADER)); @@ -93,12 +91,11 @@ EfiLoader ( // Decompress the image // - AsciiSPrint (PrintBuffer, 256, "Decompress BFV image, Image Address=0x%x! Offset=0x%x\n", + AsciiSPrint (PrintBuffer, 256, "Decompress BFV image, Image Address=0x%x Offset=0x%x\n", (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Offset); PrintString (PrintBuffer); - - Status = TianoGetInfo ( + Status = LzmaUefiDecompressGetInfo ( (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Length, &DestinationSize, @@ -110,15 +107,17 @@ EfiLoader ( PrintString (PrintBuffer); SystemHang(); } - - Status = TianoDecompress ( - (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), - EFILDRImage->Length, - (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, - DestinationSize, - (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000), - ScratchSize - ); + + AsciiSPrint (PrintBuffer, 256, "BFV decompress: DestinationSize=0x%X, ScratchSize=0x%X!\n", + DestinationSize, ScratchSize); + PrintString (PrintBuffer); + Status = LzmaUefiDecompress ( + (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), + EFILDRImage->Length, + (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, + (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000) + ); + if (EFI_ERROR (Status)) { AsciiSPrint (PrintBuffer, 256, "Fail to decompress BFV!\n"); @@ -145,12 +144,12 @@ EfiLoader ( // // Decompress the image // - AsciiSPrint (PrintBuffer, 256, "Decompress DxeIpl image, Image Address=0x%x! Offset=0x%x\n", + AsciiSPrint (PrintBuffer, 256, "Decompress DxeIpl image, Image Address=0x%x Offset=0x%x\n", (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Offset); PrintString (PrintBuffer); - Status = TianoGetInfo ( + Status = LzmaUefiDecompressGetInfo ( (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Length, &DestinationSize, @@ -162,13 +161,11 @@ EfiLoader ( SystemHang(); } - Status = TianoDecompress ( + Status = LzmaUefiDecompress ( (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Length, (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, - DestinationSize, - (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000), - ScratchSize + (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000) ); if (EFI_ERROR (Status)) { AsciiSPrint (PrintBuffer, 256, "Fail to decompress DxeIpl image\n"); @@ -217,7 +214,7 @@ PrintHeader ('C'); EFILDRImage->Offset); PrintString (PrintBuffer); - Status = TianoGetInfo ( + Status = LzmaUefiDecompressGetInfo ( (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Length, &DestinationSize, @@ -229,13 +226,11 @@ PrintHeader ('C'); SystemHang(); } - Status = TianoDecompress ( + Status = LzmaUefiDecompress ( (VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), - EFILDRImage->Length, + EFILDRImage->Length, (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, - DestinationSize, - (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000), - ScratchSize + (VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000) ); if (EFI_ERROR (Status)) { SystemHang();