summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-23 16:20:43 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-23 16:20:43 +0000
commit48557c6550adecf39e1e8e140b1736275d070dfb (patch)
tree115213a1ad58d23aac000e3fa0a4c10469770b6e /MdeModulePkg
parenta387653db209935677f95ef01608a533bc51633f (diff)
downloadedk2-platforms-48557c6550adecf39e1e8e140b1736275d070dfb.tar.xz
Code scrub DxeIpl, Runtime, DevicePath, FvbServicesLib, DiskIo, Partition, English, EBC.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7105 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.h43
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf12
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c102
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c8
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c10
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c37
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c15
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h5
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c8
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c19
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c6
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c9
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h16
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c1
-rw-r--r--MdeModulePkg/Core/RuntimeDxe/Crc32.c11
-rw-r--r--MdeModulePkg/Core/RuntimeDxe/Runtime.c32
-rw-r--r--MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf5
-rw-r--r--MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf6
-rw-r--r--MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c15
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePath.c4
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePath.h10
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf14
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c4
-rw-r--r--MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c144
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c1
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h4
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf11
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c4
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c4
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h2
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf24
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf9
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c12
-rw-r--r--MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h19
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcDxe.inf8
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcExecute.c44
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcExecute.h4
-rw-r--r--MdeModulePkg/Universal/EbcDxe/EbcInt.h6
38 files changed, 313 insertions, 375 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
index ae3c451a88..149592857d 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
@@ -1,6 +1,6 @@
/** @file
Master header file for DxeIpl PEIM. All source files in this module should
- include this file for common defininitions.
+ include this file for common definitions.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -50,17 +50,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
-// This macro aligns the ActualSize with a given alignment and is used to
-// calculate the size an image occupies.
-//
-#define GET_OCCUPIED_SIZE(ActualSize, Alignment) ((ActualSize + (Alignment - 1)) & ~(Alignment - 1))
-
-//
-// Indicate whether DxeIpl has been shadowed to memory.
-//
-extern BOOLEAN gInMemory;
-
-//
// This PPI is installed to indicate the end of the PEI usage of memory
//
extern CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi;
@@ -103,18 +92,24 @@ DxeIplFindDxeCore (
/**
- This function simply retrieves the function pointer of ImageRead in
- ImageContext structure.
-
- @param ImageContext A pointer to the structure of
- PE_COFF_LOADER_IMAGE_CONTEXT
-
- @retval EFI_SUCCESS This function always return EFI_SUCCESS.
+ Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
+
+ @param FileHandle The handle to the PE/COFF file
+ @param FileOffset The offset, in bytes, into the file to read
+ @param ReadSize The number of bytes to read from the file starting at
+ FileOffset
+ @param Buffer A pointer to the buffer to read the data into.
+
+ @retval EFI_SUCCESS ReadSize bytes of data were read into Buffer from the
+ PE/COFF file starting at FileOffset
**/
EFI_STATUS
-GetImageReadFunction (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+PeiImageRead (
+ IN VOID *FileHandle,
+ IN UINTN FileOffset,
+ IN OUT UINTN *ReadSize,
+ OUT VOID *Buffer
);
@@ -144,9 +139,9 @@ DxeLoadCore (
This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList.
- It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+ It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
- @param DxeCoreEntryPoint The entrypoint of DxeCore.
+ @param DxeCoreEntryPoint The entry point of DxeCore.
@param HobList The start of HobList passed to DxeCore.
**/
@@ -241,7 +236,7 @@ CustomGuidedSectionExtract (
/**
Decompresses a section to the output buffer.
- This function lookes up the compression type field in the input section and
+ This function looks up the compression type field in the input section and
applies the appropriate compression algorithm to compress the section to a
callee allocated buffer.
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index ab5d1846b1..d3b57e84c9 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -1,8 +1,10 @@
#/** @file
+# Last PEIM executed in PEI phase to load DXE Core from a Firmware Volume.
#
-# The responsibility of this module is to load the DXE Core from a Firmware Volume.
-# This implementation is used to load a 32-bit DXE Core.
-#
+# This module produces a special PPI named the DXE Initial Program Load (IPL)
+# PPI to discover and dispatch the DXE Foundation and components that are
+# needed to run the DXE Foundation.
+#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -79,8 +81,8 @@
[Ppis]
gEfiEndOfPeiSignalPpiGuid # PPI SOMETIMES_PRODUCED
gEfiDxeIplPpiGuid # PPI SOMETIMES_PRODUCED
- gEfiPeiDecompressPpiGuid
- gEfiPeiReadOnlyVariable2PpiGuid
+ gEfiPeiDecompressPpiGuid # PPI SOMETIMES_PRODUCED
+ gEfiPeiReadOnlyVariable2PpiGuid # PPI SOMETIMES_CONSUMED
[Guids]
gEfiMemoryTypeInformationGuid
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index d2f7521bcd..f5a384f602 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -15,14 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h"
-//
-// This global variable indicates whether this module has been shadowed
-// to memory.
-//
-BOOLEAN gInMemory = FALSE;
//
-// Module Globals used in the DXE to PEI handoff
+// Module Globals used in the DXE to PEI hand off
// These must be module globals, so the stack can be switched
//
CONST EFI_DXE_IPL_PPI mDxeIplPpi = {
@@ -37,7 +32,7 @@ CONST EFI_PEI_DECOMPRESS_PPI mDecompressPpi = {
Decompress
};
-CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
+CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
{
EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiDxeIplPpiGuid,
@@ -50,19 +45,24 @@ CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
}
};
-CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi = {
+CONST EFI_PEI_PPI_DESCRIPTOR gEndOfPeiSignalPpi = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
NULL
};
/**
- Initializes the Dxe Ipl PPI
+ Entry point of DXE IPL PEIM.
+
+ This function installs DXE IPL PPI and Decompress PPI. It also reloads
+ itself to memory on non-S3 resume boot path.
@param FileHandle Handle of the file being invoked.
@param PeiServices Describes the list of possible PEI Services.
- @return EFI_SUCESS
+ @retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.
+ @retval Others Some error occurs during the execution of this function.
+
**/
EFI_STATUS
EFIAPI
@@ -83,33 +83,36 @@ PeimInitializeDxeIpl (
Status = PeiServicesRegisterForShadow (FileHandle);
if (Status == EFI_SUCCESS) {
//
- // EFI_SUCESS means the first time call register for shadow
+ // EFI_SUCESS means it is the first time to call register for shadow.
//
return Status;
- } else if (Status == EFI_ALREADY_STARTED) {
+ }
+
+ //
+ // Ensure that DXE IPL is shadowed to permanent memory.
+ //
+ ASSERT (Status == EFI_ALREADY_STARTED);
- //
- // Get custom extract guided section method guid list
- //
- ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);
-
- //
- // Install custom extraction guid ppi
- //
- if (ExtractHandlerNumber > 0) {
- GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));
- ASSERT (GuidPpi != NULL);
- while (ExtractHandlerNumber-- > 0) {
- GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
- GuidPpi->Ppi = (VOID *) &mCustomGuidedSectionExtractionPpi;
- GuidPpi->Guid = &(ExtractHandlerGuidTable [ExtractHandlerNumber]);
- Status = PeiServicesInstallPpi (GuidPpi++);
- ASSERT_EFI_ERROR(Status);
- }
+ //
+ // Get custom extract guided section method guid list
+ //
+ ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);
+
+ //
+ // Install custom extraction guid PPI
+ //
+ if (ExtractHandlerNumber > 0) {
+ GuidPpi = (EFI_PEI_PPI_DESCRIPTOR *) AllocatePool (ExtractHandlerNumber * sizeof (EFI_PEI_PPI_DESCRIPTOR));
+ ASSERT (GuidPpi != NULL);
+ while (ExtractHandlerNumber-- > 0) {
+ GuidPpi->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+ GuidPpi->Ppi = (VOID *) &mCustomGuidedSectionExtractionPpi;
+ GuidPpi->Guid = &ExtractHandlerGuidTable[ExtractHandlerNumber];
+ Status = PeiServicesInstallPpi (GuidPpi++);
+ ASSERT_EFI_ERROR(Status);
}
- } else {
- ASSERT (FALSE);
}
+
}
//
@@ -123,6 +126,9 @@ PeimInitializeDxeIpl (
/**
Main entry point to last PEIM.
+
+ This function finds DXE Core in the firmware volume and transfer the control to
+ DXE core.
@param This Entry point for DXE IPL PPI.
@param PeiServices General purpose services available to every PEIM.
@@ -167,7 +173,7 @@ DxeLoadCore (
}
//
- // Now should have a HOB with the DXE core w/ the old HOB destroyed
+ // Now should have a HOB with the DXE core
//
}
@@ -205,7 +211,7 @@ DxeLoadCore (
FileHandle = DxeIplFindDxeCore ();
//
- // Load the DXE Core from a Firmware Volume, may use LoadFile ppi to do this for save code size.
+ // Load the DXE Core from a Firmware Volume, may use LoadFile PPI to do this to save code size.
//
Status = PeiLoadFile (
FileHandle,
@@ -227,28 +233,25 @@ DxeLoadCore (
BuildModuleHob (
&DxeCoreFileInfo.FileName,
DxeCoreAddress,
- EFI_SIZE_TO_PAGES ((UINTN) DxeCoreSize) * EFI_PAGE_SIZE,
+ ALIGN_VALUE (DxeCoreSize, EFI_PAGE_SIZE),
DxeCoreEntryPoint
);
//
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
//
- REPORT_STATUS_CODE (
- EFI_PROGRESS_CODE,
- PcdGet32(PcdStatusCodeValuePeiHandoffToDxe)
- );
+ REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdStatusCodeValuePeiHandoffToDxe));
DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Loading DXE CORE at 0x%11p EntryPoint=0x%11p\n", (VOID *)(UINTN)DxeCoreAddress, FUNCTION_ENTRY_POINT (DxeCoreEntryPoint)));
//
// Transfer control to the DXE Core
- // The handoff state is simply a pointer to the HOB list
+ // The hand off state is simply a pointer to the HOB list
//
HandOffToDxeCore (DxeCoreEntryPoint, HobList);
//
// If we get here, then the DXE Core returned. This is an error
- // Dxe Core should not return.
+ // DxeCore should not return.
//
ASSERT (FALSE);
CpuDeadLoop ();
@@ -348,9 +351,8 @@ PeiLoadFile (
ZeroMem (&ImageContext, sizeof (ImageContext));
ImageContext.Handle = Pe32Data;
- Status = GetImageReadFunction (&ImageContext);
+ ImageContext.ImageRead = PeiImageRead;
- ASSERT_EFI_ERROR (Status);
Status = PeCoffLoaderGetImageInfo (&ImageContext);
if (EFI_ERROR (Status)) {
@@ -383,9 +385,9 @@ PeiLoadFile (
}
//
- // Flush the instruction cache so the image data is written before we execute it
+ // Flush the instruction cache so the image data are written before we execute it
//
- InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);
+ InvalidateInstructionCacheRange ((VOID *)(UINTN) ImageContext.ImageAddress, (UINTN) ImageContext.ImageSize);
*ImageAddress = ImageContext.ImageAddress;
*ImageSize = ImageContext.ImageSize;
@@ -504,7 +506,7 @@ CustomGuidedSectionExtract (
if (*OutputBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- DEBUG ((DEBUG_INFO, "Customed Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
+ DEBUG ((DEBUG_INFO, "Customized Guided section Memory Size required is 0x%x and address is 0x%p\n", OutputBufferSize, *OutputBuffer));
//
// *OutputBuffer still is one section. Adjust *OutputBuffer offset,
// skip EFI section header to make section data at page alignment.
@@ -517,7 +519,7 @@ CustomGuidedSectionExtract (
OutputBuffer,
ScratchBuffer,
AuthenticationStatus
- );
+ );
if (EFI_ERROR (Status)) {
//
// Decode failed
@@ -536,7 +538,7 @@ CustomGuidedSectionExtract (
/**
Decompresses a section to the output buffer.
- This function lookes up the compression type field in the input section and
+ This function looks up the compression type field in the input section and
applies the appropriate compression algorithm to compress the section to a
callee allocated buffer.
@@ -585,7 +587,7 @@ Decompress (
case EFI_STANDARD_COMPRESSION:
//
// Load EFI standard compression.
- // For compressed data, decompress them to dstbuffer.
+ // For compressed data, decompress them to destination buffer.
//
Status = UefiDecompressGetInfo (
(UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
@@ -671,8 +673,6 @@ Decompress (
}
-
-
/**
Updates the Stack HOB passed to DXE phase.
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c
index 51055e157a..afc64664d1 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ebc/DxeLoadFunc.c
@@ -1,5 +1,5 @@
/** @file
- x64-specifc functionality for DxeLoad.
+ EBC-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -21,9 +21,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList.
- It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+ It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
- @param DxeCoreEntryPoint The entrypoint of DxeCore.
+ @param DxeCoreEntryPoint The entry point of DxeCore.
@param HobList The start of HobList passed to DxeCore.
**/
@@ -51,7 +51,7 @@ HandOffToDxeCore (
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
//
- // End of PEI phase singal
+ // End of PEI phase signal
//
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
index 65c7ceac17..22fb1fea2c 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
@@ -1,5 +1,5 @@
/** @file
- Ia32-specifc functionality for DxeLoad.
+ Ia32-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -49,9 +49,9 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR gLidtDescriptor = {
This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList.
- It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+ It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
- @param DxeCoreEntryPoint The entrypoint of DxeCore.
+ @param DxeCoreEntryPoint The entry point of DxeCore.
@param HobList The start of HobList passed to DxeCore.
**/
@@ -102,7 +102,7 @@ HandOffToDxeCore (
PageTables = CreateIdentityMappingPageTables ();
//
- // End of PEI phase singal
+ // End of PEI phase signal
//
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status);
@@ -165,7 +165,7 @@ HandOffToDxeCore (
TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
//
- // End of PEI phase singal
+ // End of PEI phase signal
//
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
index 747026364e..78abff094c 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/ImageRead.c
@@ -54,40 +54,3 @@ PeiImageRead (
return EFI_SUCCESS;
}
-
-
-/**
- This function simply retrieves the function pointer of ImageRead in
- ImageContext structure.
-
- @param ImageContext A pointer to the structure of
- PE_COFF_LOADER_IMAGE_CONTEXT
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-GetImageReadFunction (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- VOID *MemoryBuffer;
-
- if (gInMemory) {
- ImageContext->ImageRead = PeiImageRead;
- return EFI_SUCCESS;
- }
-
- //
- // BugBug; This code assumes PeiImageRead() is less than a page in size!
- // Allocate a page so we can shaddow the read function from FLASH into
- // memory to increase performance.
- //
-
- MemoryBuffer = AllocateCopyPool (0x400, (VOID *)(UINTN) PeiImageRead);
- ASSERT (MemoryBuffer != NULL);
-
- ImageContext->ImageRead = (PE_COFF_LOADER_READ_FILE) (UINTN) MemoryBuffer;
-
- return EFI_SUCCESS;
-}
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c
index 25fb37ea8e..e940feb1c4 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.c
@@ -4,16 +4,16 @@
enter Long Mode (x64 64-bit mode).
While we make a 1:1 mapping (identity mapping) for all physical pages
- we still need to use the MTRR's to ensure that the cachability attirbutes
+ we still need to use the MTRR's to ensure that the cachability attributes
for all memory regions is correct.
The basic idea is to use 2MB page table entries where ever possible. If
more granularity of cachability is required then 4K page tables are used.
References:
- 1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel
- 2) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
- 3) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
+ 1) IA-32 Intel(R) Architecture Software Developer's Manual Volume 1:Basic Architecture, Intel
+ 2) IA-32 Intel(R) Architecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
+ 3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -29,11 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h"
#include "VirtualMemory.h"
-
-
-
-
-
/**
Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping.
@@ -43,7 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
table entries to the physical
address space.
- @return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created
+ @return The address of 4 level page map.
**/
UINTN
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h b/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h
index be9a7391b6..6ada7102e9 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h
+++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/VirtualMemory.h
@@ -110,7 +110,7 @@ typedef union {
table entries to the physical
address space.
- @return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created
+ @return The address of 4 level page map.
**/
UINTN
@@ -119,9 +119,6 @@ CreateIdentityMappingPageTables (
);
-
-
-
/**
Fix up the vector number in the vector code.
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
index 5c9611e5c2..b0092294f0 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ipf/DxeLoadFunc.c
@@ -1,5 +1,5 @@
/** @file
- Ipf-specifc functionality for DxeLoad.
+ Ipf-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
@@ -21,9 +21,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList.
- It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+ It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
- @param DxeCoreEntryPoint The entrypoint of DxeCore.
+ @param DxeCoreEntryPoint The entry point of DxeCore.
@param HobList The start of HobList passed to DxeCore.
**/
@@ -62,7 +62,7 @@ HandOffToDxeCore (
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
//
- // End of PEI phase singal
+ // End of PEI phase signal
//
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c b/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
index c7367609f2..eeb6bc8a86 100644
--- a/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
+++ b/MdeModulePkg/Core/DxeIplPeim/Ipf/ImageRead.c
@@ -49,22 +49,3 @@ PeiImageRead (
return EFI_SUCCESS;
}
-
-/**
- This function simply retrieves the function pointer of ImageRead in
- ImageContext structure.
-
- @param ImageContext A pointer to the structure of
- PE_COFF_LOADER_IMAGE_CONTEXT
-
- @retval EFI_SUCCESS This function always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-GetImageReadFunction (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- ImageContext->ImageRead = PeiImageRead;
- return EFI_SUCCESS;
-}
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
index 05c5203d82..6fca4e496a 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c
@@ -22,9 +22,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList.
- It also intalls EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+ It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
- @param DxeCoreEntryPoint The entrypoint of DxeCore.
+ @param DxeCoreEntryPoint The entry point of DxeCore.
@param HobList The start of HobList passed to DxeCore.
**/
@@ -58,7 +58,7 @@ HandOffToDxeCore (
PageTables = CreateIdentityMappingPageTables ();
//
- // End of PEI phase singal
+ // End of PEI phase signal
//
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status);
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
index 35e92c641a..e58351c2ee 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
@@ -29,11 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h"
#include "VirtualMemory.h"
-
-
-
-
-
/**
Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping.
@@ -43,7 +38,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
table entries to the physical
address space.
- @return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created
+ @return The address of 4 level page map.
**/
UINTN
@@ -73,7 +68,7 @@ CreateIdentityMappingPageTables (
Hob = GetFirstHob (EFI_HOB_TYPE_CPU);
if (Hob != NULL) {
- PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace;
+ PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace;
}
//
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h
index be9a7391b6..83d0e9bddb 100644
--- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h
+++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.h
@@ -2,9 +2,9 @@
x64 Long Mode Virtual Memory Management Definitions
References:
- 1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel
- 2) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
- 3) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
+ 1) IA-32 Intel(R) Architecture Software Developer's Manual Volume 1:Basic Architecture, Intel
+ 2) IA-32 Intel(R) Architecture Software Developer's Manual Volume 2:Instruction Set Reference, Intel
+ 3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
4) AMD64 Architecture Programmer's Manual Volume 2: System Programming
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
@@ -100,7 +100,6 @@ typedef union {
#pragma pack()
-
/**
Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping.
@@ -110,7 +109,7 @@ typedef union {
table entries to the physical
address space.
- @return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created
+ @return The address of 4 level page map.
**/
UINTN
@@ -119,15 +118,11 @@ CreateIdentityMappingPageTables (
);
-
-
-
/**
Fix up the vector number in the vector code.
@param VectorBase Base address of the vector handler.
-
@param VectorNum Index of vector.
**/
@@ -139,9 +134,6 @@ AsmVectorFixup (
);
-
-
-
/**
Get the information of vector template.
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 91f627dd4e..e6e3a11b16 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -474,6 +474,7 @@ PeiDispatcher (
// But if new stack is smaller than the size of old stack, we also reserve
// the size of old stack at bottom of permenent memory.
//
+ DEBUG ((EFI_D_ERROR, "Old Stack Size%d, New stack size%d\n", (INT32) Private->StackSize, (INT32) OldPeiStackSize));
ASSERT (Private->StackSize >= OldPeiStackSize);
StackGap = Private->StackSize - OldPeiStackSize;
diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
index aef2d65e81..e2f3bc591f 100644
--- a/MdeModulePkg/Core/RuntimeDxe/Crc32.c
+++ b/MdeModulePkg/Core/RuntimeDxe/Crc32.c
@@ -1,12 +1,13 @@
/** @file
- CalculateCrc32 Boot Services as defined in DXE CIS.
+ This file implements CalculateCrc32 Boot Services as defined in
+ Platform Initialization specification 1.0 VOLUME 2 DXE Core Interface.
This Boot Services is in the Runtime Driver because this service is
also required by SetVirtualAddressMap() when the EFI System Table and
EFI Runtime Services Table are converted from physical address to
- virtual addresses. This requires that the 32-bit CRC be recomputed.
+ virtual addresses. This requires that the 32-bit CRC be recomputed.
-Copyright (c) 2006, Intel Corporation. <BR>
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>
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
@@ -61,8 +62,7 @@ RuntimeDriverCalculateCrc32 (
/**
- Reverse bits for 32bit data.
- This is a internal function.
+ This internal function reverses bits for 32bit data.
@param Value The data to be reversed.
@@ -89,6 +89,7 @@ ReverseBits (
/**
Initialize CRC32 table.
+
**/
VOID
RuntimeDriverInitializeCrc32Table (
diff --git a/MdeModulePkg/Core/RuntimeDxe/Runtime.c b/MdeModulePkg/Core/RuntimeDxe/Runtime.c
index 8fdc6fad9d..66c02b2f5b 100644
--- a/MdeModulePkg/Core/RuntimeDxe/Runtime.c
+++ b/MdeModulePkg/Core/RuntimeDxe/Runtime.c
@@ -1,5 +1,6 @@
/** @file
- Runtime Architectural Protocol as defined in the DXE CIS.
+ This file implements Runtime Architectural Protocol as defined in the
+ Platform Initialization specification 1.0 VOLUME 2 DXE Core Interface.
This code is used to produce the EFI runtime virtual switch over
@@ -14,7 +15,7 @@
So here is the concept. The code in this module will never ever be called in
virtual mode. This is the code that collects the information needed to convert
to virtual mode (DXE core registers runtime stuff with this code). Since this
- code is used to fixup all runtime images, it CAN NOT fix it's self up. So some
+ code is used to fix up all runtime images, it CAN NOT fix it's self up. So some
code has to stay behind and that is us.
Also you need to be careful about when you allocate memory, as once we are in
@@ -34,7 +35,7 @@ Revision History:
Table now contains an item named CalculateCrc32.
-Copyright (c) 2006, Intel Corporation. <BR>
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>
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
@@ -86,7 +87,7 @@ EFI_RUNTIME_ARCH_PROTOCOL mRuntime = {
//
/**
- Calcualte the 32-bit CRC in a EFI table using the Runtime Drivers
+ Calculate the 32-bit CRC in a EFI table using the Runtime Drivers
internal function. The EFI Boot Services Table can not be used because
the EFI Boot Services Table was destroyed at ExitBootServices().
This is a internal function.
@@ -158,10 +159,10 @@ RuntimeDriverConvertPointer (
return EFI_INVALID_PARAMETER;
}
- VirtEntry = mVirtualMap;
+ VirtEntry = mVirtualMap;
for (Index = 0; Index < mVirtualMapMaxIndex; Index++) {
//
- // To prevent the inclusion of 64-bit math functions a UINTN was placed in
+ // To prevent the inclusion of 64-bit math functions a UINTN was placed in
// front of VirtEntry->NumberOfPages to cast it to a 32-bit thing on IA-32
// platforms. If you get this ASSERT remove the UINTN and do a 64-bit
// multiply.
@@ -315,7 +316,7 @@ RuntimeDriverSetVirtualAddressMap (
RuntimeImage->RelocationData
);
- InvalidateInstructionCacheRange (RuntimeImage->ImageBase, (UINTN)RuntimeImage->ImageSize);
+ InvalidateInstructionCacheRange (RuntimeImage->ImageBase, (UINTN) RuntimeImage->ImageSize);
}
}
@@ -362,17 +363,16 @@ RuntimeDriverSetVirtualAddressMap (
}
/**
- Install Runtime AP. This code includes the EfiDriverLib, but it functions at
- RT in physical mode. The only Lib services are gBS, gRT, and the DEBUG and
- ASSERT macros (they do ReportStatusCode).
+ Entry Point for Runtime driver.
+ This function installs Runtime Architectural Protocol and registers CalculateCrc32 boot services table,
+ SetVirtualAddressMap & ConvertPointer runtime services table.
@param ImageHandle Image handle of this driver.
- @param SystemTable Pointer to the EFI System Table.
+ @param SystemTable a Pointer to the EFI System Table.
- @retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed
- @return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check
- gBS->InstallMultipleProtocolInterfaces for details.
+ @retval EFI_SUCEESS Runtime Driver Architectural Protocol is successfully installed
+ @return Others Some error occurs when installing Runtime Driver Architectural Protocol.
**/
EFI_STATUS
@@ -386,7 +386,7 @@ RuntimeDriverInitialize (
EFI_LOADED_IMAGE_PROTOCOL *MyLoadedImage;
//
- // This image needs to be exclued from relocation for virtual mode, so cache
+ // This image needs to be excluded from relocation for virtual mode, so cache
// a copy of the Loaded Image protocol to test later.
//
Status = gBS->HandleProtocol (
@@ -420,5 +420,5 @@ RuntimeDriverInitialize (
);
ASSERT_EFI_ERROR (Status);
- return EFI_SUCCESS;
+ return Status;
}
diff --git a/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf b/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
index 717dbe0e09..89cbd0e693 100644
--- a/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
+++ b/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
@@ -1,6 +1,9 @@
#/** @file
+# Module that produces EFI runtime virtual switch over services.
#
-# This module is used to produce the EFI runtime virtual switch over services.
+# This runtime module installs Runtime Architectural Protocol and registers
+# CalculateCrc32 boot services table, SetVirtualAddressMap & ConvertPointer
+# runtime services table.
#
# Copyright (c) 2006 - 2008, Intel Corporation
#
diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
index 6c3edff842..a23d947b9b 100644
--- a/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
+++ b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf
@@ -1,5 +1,5 @@
#/** @file
-# FvbService Library for UEFI drivers
+# FvbService Library for DXE phase drivers
#
# This library instance provide sevice functions to access Firmware Volume Block protocol.
#
@@ -21,13 +21,13 @@
FILE_GUID = bd4d540e-04b0-4b10-8fd5-4a7bb533cf67
MODULE_TYPE = DXE_RUNTIME_DRIVER
VERSION_STRING = 1.0
- LIBRARY_CLASS = FvbServiceLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER
+ LIBRARY_CLASS = FvbServiceLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
CONSTRUCTOR = FvbLibInitialize
#
# The following information is for reference only and not required by the build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+# VALID_ARCHITECTURES = IA32 X64 EBC
#
# VIRTUAL_ADDRESS_MAP_CALLBACK = FvbVirtualAddressChangeNotifyEvent
#
diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c b/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c
index 6080b1c0c6..f1fe99d932 100644
--- a/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c
+++ b/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.c
@@ -1,12 +1,11 @@
/**@file
-
Firmware Volume Block Protocol Runtime Interface Abstraction
And FVB Extension protocol Runtime Interface Abstraction
mFvbEntry is an array of Handle Fvb pairs. The Fvb Lib Instance matches the
index in the mFvbEntry array. This should be the same sequence as the FVB's
were described in the HOB. We have to remember the handle so we can tell if
- the protocol has been reinstalled and it needs updateing.
+ the protocol has been reinstalled and it needs updating.
Copyright (c) 2006 - 2008, Intel Corporation
@@ -267,11 +266,11 @@ FvbVirtualAddressChangeNotifyEvent (
/**
Library constructor function entry.
- @param ImageHandle The handle of image who call this libary.
+ @param ImageHandle The handle of image who call this library.
@param SystemTable The point of System Table.
- @retval EFI_SUCESS Sucess construct this library.
- @retval Others Fail to contruct this libary.
+ @retval EFI_SUCESS Success construct this library.
+ @retval Others Fail to construct this library.
**/
EFI_STATUS
EFIAPI
@@ -413,9 +412,9 @@ EfiFvbReadBlock (
If NumBytes is NULL, then ASSERT().
- @param Instance The FV instance to be written to
- @param Lba The starting logical block index to write to
- @param Offset The offset relative to the block, at which to begin writting.
+ @param Instance The FV instance to be written to.
+ @param Lba The starting logical block index to write.
+ @param Offset The offset relative to the block to write.
@param NumBytes Pointer to a UINTN. On input, *NumBytes contains
the total size of the buffer. On output, it contains
the actual number of bytes written.
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
index 660b595de5..ca39b03658 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
@@ -46,8 +46,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingSASGuid
/**
The user Entry Point for DevicePath module.
- This is the entrhy point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
- optionall the Device Path to Text and Device Path from Text protocols based on feature flags.
+ This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
+ optionally the Device Path to Text and Device Path from Text protocols based on feature flags.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.h b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
index b1f398ddad..7baa48bca7 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePath.h
@@ -31,14 +31,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DevicePathLib.h>
#include <Library/PcdLib.h>
-extern const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid;
-extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
#define MAX_CHAR 480
-#define MIN_ALIGNMENT_SIZE sizeof(UINTN)
-#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)
-
#define IS_COMMA(a) ((a) == L',')
#define IS_HYPHEN(a) ((a) == L'-')
#define IS_DOT(a) ((a) == L'.')
@@ -47,11 +42,8 @@ extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
#define IS_SLASH(a) ((a) == L'/')
#define IS_NULL(a) ((a) == L'\0')
-#define DEVICE_NODE_END 1
-#define DEVICE_PATH_INSTANCE_END 2
-#define DEVICE_PATH_END 3
-#define SET_DEVICE_PATH_INSTANCE_END_NODE(a) { \
+#define SET_DEVICE_PATH_INSTANCE_END_NODE(a) { \
(a)->Type = END_DEVICE_PATH_TYPE; \
(a)->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; \
(a)->Length[0] = sizeof (EFI_DEVICE_PATH_PROTOCOL); \
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf b/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
index 42ca228a98..4ccbb7b82c 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
@@ -1,9 +1,10 @@
#/** @file
+# Device path driver that produces three UEFI device path protocols.
#
-# Component description file for Device Path Driver.
-#
-# This driver implement these three UEFI deveice path protocols (
-# DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them.
+# This driver produces Device Path Utilities protocol and optionally
+# DevicePahtToText and DevicePathFromText protocols based on feature flags
+# PcdDevicePathSupportDevicePathToText & PcdDevicePathSupportDevicePathFromText
+# respectively.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -57,7 +58,9 @@
gEfiVT100Guid # ALWAYS_CONSUMED
gEfiVT100PlusGuid # ALWAYS_CONSUMED
gEfiPcAnsiGuid # ALWAYS_CONSUMED
-
+ gEfiUartDevicePathGuid # ALWAYS_CONSUMED
+ gEfiSasDevicePathGuid # ALWAYS_CONSUMED
+
[Protocols]
gEfiDevicePathToTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiDevicePathFromTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
@@ -70,4 +73,3 @@
[Depex]
TRUE
-
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
index dbd371ce70..e0f1fcea48 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathFromText.c
@@ -1504,7 +1504,7 @@ DevPathFromTextUartFlowCtrl (
sizeof (UART_FLOW_CONTROL_DEVICE_PATH)
);
- CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid);
+ CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid);
if (StrCmp (ValueStr, L"XonXoff") == 0) {
UartFlowControl->FlowControlMap = 2;
} else if (StrCmp (ValueStr, L"Hardware") == 0) {
@@ -1555,7 +1555,7 @@ DevPathFromTextSAS (
sizeof (SAS_DEVICE_PATH)
);
- CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid);
+ CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid);
Strtoi64 (AddressStr, &Sas->SasAddress);
Strtoi64 (LunStr, &Sas->Lun);
Sas->RelativeTargetPort = (UINT16) Strtoi (RTPStr);
diff --git a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
index 5de21b1f9d..2e4a976adc 100644
--- a/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
+++ b/MdeModulePkg/Universal/DevicePathDxe/DevicePathToText.c
@@ -55,10 +55,10 @@ CatPrint (
Size = StrSize (AppendStr) - sizeof (UINT16);
Size = Size + StrSize (Str->Str);
Str->Str = ReallocatePool (
- StrSize (Str->Str),
- Size,
- Str->Str
- );
+ StrSize (Str->Str),
+ Size,
+ Str->Str
+ );
ASSERT (Str->Str != NULL);
}
@@ -73,9 +73,9 @@ CatPrint (
}
/**
- Converts a PCI device path structure to its string representive.
+ Converts a PCI device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -100,9 +100,9 @@ DevPathToTextPci (
}
/**
- Converts a PC Card device path structure to its string representive.
+ Converts a PC Card device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -127,9 +127,9 @@ DevPathToTextPccard (
}
/**
- Converts a Memory Map device path structure to its string representive.
+ Converts a Memory Map device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -160,9 +160,9 @@ DevPathToTextMemMap (
}
/**
- Converts a Vendor device path structure to its string representive.
+ Converts a Vendor device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -208,7 +208,7 @@ DevPathToTextVendor (
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
CatPrint (Str, L"VenUft8()");
return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {
+ } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
switch (FlowControlMap & 0x00000003) {
case 0:
@@ -228,7 +228,7 @@ DevPathToTextVendor (
}
return ;
- } else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {
+ } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
CatPrint (
Str,
L"SAS(0x%lx,0x%lx,0x%x,",
@@ -287,9 +287,9 @@ DevPathToTextVendor (
}
/**
- Converts a Controller device path structure to its string representive.
+ Converts a Controller device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -318,9 +318,9 @@ DevPathToTextController (
}
/**
- Converts a ACPI device path structure to its string representive.
+ Converts a ACPI device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -404,9 +404,9 @@ EisaIdToText (
}
/**
- Converts a ACPI extended HID device path structure to its string representive.
+ Converts a ACPI extended HID device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -488,9 +488,9 @@ DevPathToTextAcpiEx (
}
/**
- Converts a ACPI address device path structure to its string representive.
+ Converts a ACPI address device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -525,9 +525,9 @@ DevPathToTextAcpiAdr (
}
/**
- Converts a ATAPI device path structure to its string representive.
+ Converts a ATAPI device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -563,9 +563,9 @@ DevPathToTextAtapi (
}
/**
- Converts a SCSI device path structure to its string representive.
+ Converts a SCSI device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -590,9 +590,9 @@ DevPathToTextScsi (
}
/**
- Converts a Fibre device path structure to its string representive.
+ Converts a Fibre device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -617,9 +617,9 @@ DevPathToTextFibre (
}
/**
- Converts a 1394 device path structure to its string representive.
+ Converts a 1394 device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -647,9 +647,9 @@ DevPathToText1394 (
}
/**
- Converts a USB device path structure to its string representive.
+ Converts a USB device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -674,9 +674,9 @@ DevPathToTextUsb (
}
/**
- Converts a USB WWID device path structure to its string representive.
+ Converts a USB WWID device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -723,9 +723,9 @@ DevPathToTextUsbWWID (
}
/**
- Converts a Logic Unit device path structure to its string representive.
+ Converts a Logic Unit device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -750,9 +750,9 @@ DevPathToTextLogicalUnit (
}
/**
- Converts a USB class device path structure to its string representive.
+ Converts a USB class device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -886,9 +886,9 @@ DevPathToTextUsbClass (
}
/**
- Converts a SATA device path structure to its string representive.
+ Converts a SATA device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -919,9 +919,9 @@ DevPathToTextSata (
}
/**
- Converts a I20 device path structure to its string representive.
+ Converts a I20 device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -946,9 +946,9 @@ DevPathToTextI2O (
}
/**
- Converts a MAC address device path structure to its string representive.
+ Converts a MAC address device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -987,9 +987,9 @@ DevPathToTextMacAddr (
}
/**
- Converts a IPv4 device path structure to its string representive.
+ Converts a IPv4 device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1039,9 +1039,9 @@ DevPathToTextIPv4 (
}
/**
- Converts a IPv6 device path structure to its string representive.
+ Converts a IPv6 device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1127,9 +1127,9 @@ DevPathToTextIPv6 (
}
/**
- Converts an Infini Band device path structure to its string representive.
+ Converts an Infini Band device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1162,9 +1162,9 @@ DevPathToTextInfiniBand (
}
/**
- Converts a UART device path structure to its string representive.
+ Converts a UART device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1254,9 +1254,9 @@ DevPathToTextUart (
}
/**
- Converts an iSCSI device path structure to its string representive.
+ Converts an iSCSI device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1302,9 +1302,9 @@ DevPathToTextiSCSI (
}
/**
- Converts a Hard drive device path structure to its string representive.
+ Converts a Hard drive device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1360,9 +1360,9 @@ DevPathToTextHardDrive (
}
/**
- Converts a CDROM device path structure to its string representive.
+ Converts a CDROM device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1392,9 +1392,9 @@ DevPathToTextCDROM (
}
/**
- Converts a File device path structure to its string representive.
+ Converts a File device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1419,9 +1419,9 @@ DevPathToTextFilePath (
}
/**
- Converts a Media protocol device path structure to its string representive.
+ Converts a Media protocol device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1446,9 +1446,9 @@ DevPathToTextMediaProtocol (
}
/**
- Converts a Firmware Volume device path structure to its string representive.
+ Converts a Firmware Volume device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1473,9 +1473,9 @@ DevPathToTextFv (
}
/**
- Converts a Firmware Volume File device path structure to its string representive.
+ Converts a Firmware Volume File device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1500,9 +1500,9 @@ DevPathToTextFvFile (
}
/**
- Converts a BIOS Boot Specification device path structure to its string representive.
+ Converts a BIOS Boot Specification device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1569,9 +1569,9 @@ DevPathToTextBBS (
}
/**
- Converts an End-of-Device-Path structure to its string representive.
+ Converts an End-of-Device-Path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1593,9 +1593,9 @@ DevPathToTextEndInstance (
}
/**
- Converts an unknown device path structure to its string representive.
+ Converts an unknown device path structure to its string representative.
- @param Str The string representive of input device.
+ @param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index ec1d68f631..b0d92c78b2 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -231,7 +231,6 @@ DiskIoDriverBindingStop (
&Private->DiskIo
);
if (!EFI_ERROR (Status)) {
-
Status = gBS->CloseProtocol (
ControllerHandle,
&gEfiBlockIoProtocolGuid,
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
index 4bc6d28603..7d4533a2a7 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.h
@@ -29,9 +29,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
-#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
+#define DATA_BUFFER_BLOCK_NUM 64
-#define DATA_BUFFER_BLOCK_NUM (64)
+#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
typedef struct {
UINTN Signature;
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
index c27650e886..757b4030df 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
@@ -1,7 +1,12 @@
#/** @file
-#
-# This module lays DiskIo protocol on every blockIo protocol
-# to provide byte-oriented access to block media.
+# Module that lays Disk I/O protocol on every Block I/O protocol.
+#
+# This module produces Disk I/O protocol to abstract the block accesses
+# of the Block I/O protocol to a more general offset-length protocol
+# to provide byte-oriented access to block media. It adds this protocol
+# to any Block I/O interface that appears in the system that does not
+# already have a Disk I/O protocol. File systems and other disk access
+# code utilize the Disk I/O protocol.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index 21d1163ab7..5d544e8b77 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -6,7 +6,7 @@
code that is not run on an EFI system. The legacy code reads the
first sector of the active partition into memory and
- BPB - Boot(?) Parameter Block is in the first sector of a FAT file system.
+ BPB - BIOS Parameter Block is in the first sector of a FAT file system.
The BPB contains information about the FAT file system. The BPB is
always on the first sector of a media. The first sector also contains
the legacy boot strap code.
@@ -212,7 +212,7 @@ PartitionInstallMbrChildHandles (
HdDev.PartitionNumber = PartitionNumber ++;
HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA);
HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA);
- CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (UINT32));
+ CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (Mbr->UniqueMbrSignature));
Status = PartitionInstallChildHandle (
This,
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 15061bec30..5d06444784 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -31,7 +31,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
};
//
-// Priortized function list to detect partition table.
+// Prioritized function list to detect partition table.
//
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
PartitionInstallGptChildHandles,
@@ -278,7 +278,7 @@ PartitionDriverBindingStart (
/**
- Stop this driver on ControllerHandle. Support stoping any child handles
+ Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
index a9bbcc6586..d0d0d52a25 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
@@ -143,7 +143,7 @@ PartitionDriverBindingStart (
);
/**
- Stop this driver on ControllerHandle. Support stoping any child handles
+ Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf b/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
index d187a91185..b7fa67b5ea 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
@@ -1,11 +1,11 @@
#/** @file
-#
-# Component description file for Partition module.
-#
-# Partition driver produces the logical BlockIo device
-# that represents the bytes Start to End of the Parent Block IO
-# device (one partition of physical BlockIo device,
-# which can be one of GPT, MBR, ElTorito partition).
+# Modules that produces the logic Block I/O protocol for every partition
+# it discovers via the physical Block I/O.
+#
+# This module produces the logical Block I/O device that represents
+# the bytes from Start to End of the Parent Block I/O device.
+# The partition of physical BlockIo device supported is one of legacy MBR, GPT,
+# and "El Torito" partitions.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -31,9 +31,9 @@
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
-# DRIVER_BINDING = gPartitionDriverBinding
-# COMPONENT_NAME = gPartitionComponentName
-# COMPONENT_NAME2 = gPartitionComponentName2
+# DRIVER_BINDING = gPartitionDriverBinding
+# COMPONENT_NAME = gPartitionComponentName
+# COMPONENT_NAME2 = gPartitionComponentName2
#
[Sources.common]
@@ -68,7 +68,7 @@
[Protocols]
gEfiBlockIoProtocolGuid # PROTOCOL BY_START
gEfiDevicePathProtocolGuid # PROTOCOL BY_START
+ gEfiDiskIoProtocolGuid # PROTOCOL BY_START
+ gEfiBlockIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiDiskIoProtocolGuid # PROTOCOL TO_START
- gEfiBlockIoProtocolGuid # PROTOCOL TO_START
-
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
index 66eb083f9c..5592c5c574 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
@@ -1,8 +1,11 @@
#/** @file
+# English module that provides Unicode Collation supports.
#
-# Component description file for English module for unicode collation.
-#
-# This driver installs UEFI EFI_UNICODE_COLLATION_PROTOCOL protocol to provide Unicode strings function.
+# This driver installs Unicode ISO 639-2 Collation and
+# RFC 4646 Unicode Collation 2 protocols based on feature flags
+# PcdUnicodeCollationSupport & PcdUnicodeCollation2Support respectively.
+# It allows code running in the boot services environment to perform lexical
+# comparison functions on Unicode strings for English languages.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
index e8c5bd953c..f5f87707d3 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.c
@@ -15,9 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UnicodeCollationEng.h"
-CHAR8 mEngUpperMap[0x100];
-CHAR8 mEngLowerMap[0x100];
-CHAR8 mEngInfoMap[0x100];
+CHAR8 mEngUpperMap[MAP_TABLE_SIZE];
+CHAR8 mEngLowerMap[MAP_TABLE_SIZE];
+CHAR8 mEngInfoMap[MAP_TABLE_SIZE];
CHAR8 mOtherChars[] = {
'0',
@@ -106,7 +106,7 @@ InitializeUnicodeCollationEng (
//
// Initialize mapping tables for the supported languages
//
- for (Index = 0; Index < 0x100; Index++) {
+ for (Index = 0; Index < MAP_TABLE_SIZE; Index++) {
mEngUpperMap[Index] = (CHAR8) Index;
mEngLowerMap[Index] = (CHAR8) Index;
mEngInfoMap[Index] = 0;
@@ -453,9 +453,9 @@ EngStrToFat (
if (*String != '.' && *String != ' ') {
//
// If this is a valid fat char, move it.
- // Otherwise, move a '_' and flag the fact that the name needs an Lfn
+ // Otherwise, move a '_' and flag the fact that the name needs a long file name.
//
- if (*String < 0x100 && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
+ if (*String < MAP_TABLE_SIZE && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
*Fat = mEngUpperMap[*String];
} else {
*Fat = '_';
diff --git a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
index 85dc593789..76695dd109 100644
--- a/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
+++ b/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/UnicodeCollationEng.h
@@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Uefi.h>
-
#include <Protocol/UnicodeCollation.h>
#include <Library/DebugLib.h>
@@ -28,12 +27,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
//
-// Defines
+// Bit mask to indicate the validity of character in FAT file name.
//
#define CHAR_FAT_VALID 0x01
-#define TO_UPPER(a) (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)
-#define TO_LOWER(a) (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)
+//
+// Maximum FAT table size.
+//
+#define MAP_TABLE_SIZE 0x100
+
+//
+// Macro to map character a to upper case.
+//
+#define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
+
+//
+// Macro to map character a to lower case.
+//
+#define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
//
// Prototypes
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf b/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
index c230de9184..acb113832e 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
+++ b/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
@@ -1,8 +1,10 @@
#/** @file
+# Module that produces EBC Interprete and EBC Debug Support protocols.
#
-# This module for the EBC virtual machine implementation produces
-# EBC and EBC debug support protocols.
-#
+# This module implements EFI Byte Code (EBC) Virtual Machine that can provide
+# platformand processor-independent mechanisms for loading and executing EFI
+# device drivers.
+#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
index 334073c954..a6d0486632 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
+++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.c
@@ -108,7 +108,7 @@ VmReadIndex64 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 8-bit value from the memory adress.
+ @return The 8-bit value from the memory address.
**/
UINT8
@@ -123,7 +123,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 16-bit value from the memory adress.
+ @return The 16-bit value from the memory address.
**/
UINT16
@@ -138,7 +138,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 32-bit value from the memory adress.
+ @return The 32-bit value from the memory address.
**/
UINT32
@@ -153,7 +153,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 64-bit value from the memory adress.
+ @return The 64-bit value from the memory address.
**/
UINT64
@@ -193,7 +193,7 @@ VmReadMemN (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -223,7 +223,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -253,7 +253,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -268,7 +268,7 @@ VmWriteMem32 (
);
/**
- Reads 16-bit unsinged data from the code stream.
+ Reads 16-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -286,7 +286,7 @@ VmReadCode16 (
);
/**
- Reads 32-bit unsinged data from the code stream.
+ Reads 32-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -304,7 +304,7 @@ VmReadCode32 (
);
/**
- Reads 64-bit unsinged data from the code stream.
+ Reads 64-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -4599,7 +4599,7 @@ VmReadIndex64 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4637,7 +4637,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4700,7 +4700,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4763,7 +4763,7 @@ VmWriteMem32 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4828,7 +4828,7 @@ VmWriteMem64 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -5019,7 +5019,7 @@ VmReadImmed64 (
/**
- Reads 16-bit unsinged data from the code stream.
+ Reads 16-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5059,7 +5059,7 @@ VmReadCode16 (
/**
- Reads 32-bit unsinged data from the code stream.
+ Reads 32-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5093,7 +5093,7 @@ VmReadCode32 (
/**
- Reads 64-bit unsinged data from the code stream.
+ Reads 64-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5139,7 +5139,7 @@ VmReadCode64 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 8-bit value from the memory adress.
+ @return The 8-bit value from the memory address.
**/
UINT8
@@ -5164,7 +5164,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 16-bit value from the memory adress.
+ @return The 16-bit value from the memory address.
**/
UINT16
@@ -5195,7 +5195,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 32-bit value from the memory adress.
+ @return The 32-bit value from the memory address.
**/
UINT32
@@ -5230,7 +5230,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
- @return The 64-bit value from the memory adress.
+ @return The 64-bit value from the memory address.
**/
UINT64
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
index 88bf9d5843..5fc741d105 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
+++ b/MdeModulePkg/Universal/EbcDxe/EbcExecute.h
@@ -270,7 +270,7 @@ GetVmVersion (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -300,7 +300,7 @@ VmWriteMemN (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
- @param Addr Adddress to write to.
+ @param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
diff --git a/MdeModulePkg/Universal/EbcDxe/EbcInt.h b/MdeModulePkg/Universal/EbcDxe/EbcInt.h
index 66339d1a85..8512d6743d 100644
--- a/MdeModulePkg/Universal/EbcDxe/EbcInt.h
+++ b/MdeModulePkg/Universal/EbcDxe/EbcInt.h
@@ -36,7 +36,7 @@ typedef UINT32 EXCEPTION_FLAGS;
typedef struct {
VM_REGISTER R[8]; // General purpose registers.
UINT64 Flags; // Flags register:
- // 0 Set to 1 if the result of the last compare was true
+ // 0 Set to 1 if the result of the last compare was true
// 1 Set to 1 if stepping
// 2..63 Reserved.
VMIP Ip; // Instruction pointer.
@@ -106,7 +106,7 @@ EbcCreateThunks (
/**
Add a thunk to our list of thunks for a given image handle.
- Also flush the instruction cache since we've written thunk code
+ Also flush the instruction cache since we have written thunk code
to memory that will be executed eventually.
@param ImageHandle The image handle to which the thunk is tied.
@@ -249,7 +249,7 @@ EbcLLGetReturnValue (
);
/**
- Returns the stack index and buffer assosicated with the Handle parameter.
+ Returns the stack index and buffer associated with the Handle parameter.
@param Handle The EFI handle as the index to the EBC stack.
@param StackBuffer A pointer to hold the returned stack buffer.