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
This commit is contained in:
qhuang8
2008-12-23 16:20:43 +00:00
parent a387653db2
commit 48557c6550
38 changed files with 315 additions and 377 deletions

View File

@ -1,6 +1,6 @@
/** @file /** @file
Master header file for DxeIpl PEIM. All source files in this module should 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> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -49,17 +49,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define BSP_STORE_SIZE 0x4000 #define BSP_STORE_SIZE 0x4000
//
// 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 // This PPI is installed to indicate the end of the PEI usage of memory
// //
@ -103,18 +92,24 @@ DxeIplFindDxeCore (
/** /**
This function simply retrieves the function pointer of ImageRead in Support routine for the PE/COFF Loader that reads a buffer from a PE/COFF file
ImageContext structure.
@param FileHandle The handle to the PE/COFF file
@param ImageContext A pointer to the structure of @param FileOffset The offset, in bytes, into the file to read
PE_COFF_LOADER_IMAGE_CONTEXT @param ReadSize The number of bytes to read from the file starting at
FileOffset
@retval EFI_SUCCESS This function always return EFI_SUCCESS. @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 EFI_STATUS
GetImageReadFunction ( PeiImageRead (
IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext 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 This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList. 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. @param HobList The start of HobList passed to DxeCore.
**/ **/
@ -241,7 +236,7 @@ CustomGuidedSectionExtract (
/** /**
Decompresses a section to the output buffer. 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 applies the appropriate compression algorithm to compress the section to a
callee allocated buffer. callee allocated buffer.

View File

@ -1,8 +1,10 @@
#/** @file #/** @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 module produces a special PPI named the DXE Initial Program Load (IPL)
# This implementation is used to load a 32-bit DXE Core. # 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> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -79,8 +81,8 @@
[Ppis] [Ppis]
gEfiEndOfPeiSignalPpiGuid # PPI SOMETIMES_PRODUCED gEfiEndOfPeiSignalPpiGuid # PPI SOMETIMES_PRODUCED
gEfiDxeIplPpiGuid # PPI SOMETIMES_PRODUCED gEfiDxeIplPpiGuid # PPI SOMETIMES_PRODUCED
gEfiPeiDecompressPpiGuid gEfiPeiDecompressPpiGuid # PPI SOMETIMES_PRODUCED
gEfiPeiReadOnlyVariable2PpiGuid gEfiPeiReadOnlyVariable2PpiGuid # PPI SOMETIMES_CONSUMED
[Guids] [Guids]
gEfiMemoryTypeInformationGuid gEfiMemoryTypeInformationGuid

View File

@ -15,14 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h" #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 // These must be module globals, so the stack can be switched
// //
CONST EFI_DXE_IPL_PPI mDxeIplPpi = { CONST EFI_DXE_IPL_PPI mDxeIplPpi = {
@ -37,7 +32,7 @@ CONST EFI_PEI_DECOMPRESS_PPI mDecompressPpi = {
Decompress Decompress
}; };
CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = { CONST EFI_PEI_PPI_DESCRIPTOR mPpiList[] = {
{ {
EFI_PEI_PPI_DESCRIPTOR_PPI, EFI_PEI_PPI_DESCRIPTOR_PPI,
&gEfiDxeIplPpiGuid, &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), (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid, &gEfiEndOfPeiSignalPpiGuid,
NULL 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 FileHandle Handle of the file being invoked.
@param PeiServices Describes the list of possible PEI Services. @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 EFI_STATUS
EFIAPI EFIAPI
@ -83,33 +83,36 @@ PeimInitializeDxeIpl (
Status = PeiServicesRegisterForShadow (FileHandle); Status = PeiServicesRegisterForShadow (FileHandle);
if (Status == EFI_SUCCESS) { 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; return Status;
} else if (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);
}
}
} else {
ASSERT (FALSE);
} }
//
// 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);
}
}
} }
// //
@ -123,6 +126,9 @@ PeimInitializeDxeIpl (
/** /**
Main entry point to last PEIM. 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 This Entry point for DXE IPL PPI.
@param PeiServices General purpose services available to every PEIM. @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 (); 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 ( Status = PeiLoadFile (
FileHandle, FileHandle,
@ -227,28 +233,25 @@ DxeLoadCore (
BuildModuleHob ( BuildModuleHob (
&DxeCoreFileInfo.FileName, &DxeCoreFileInfo.FileName,
DxeCoreAddress, DxeCoreAddress,
EFI_SIZE_TO_PAGES ((UINTN) DxeCoreSize) * EFI_PAGE_SIZE, ALIGN_VALUE (DxeCoreSize, EFI_PAGE_SIZE),
DxeCoreEntryPoint DxeCoreEntryPoint
); );
// //
// Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT // Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
// //
REPORT_STATUS_CODE ( REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdStatusCodeValuePeiHandoffToDxe));
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))); 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 // 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); HandOffToDxeCore (DxeCoreEntryPoint, HobList);
// //
// If we get here, then the DXE Core returned. This is an error // If we get here, then the DXE Core returned. This is an error
// Dxe Core should not return. // DxeCore should not return.
// //
ASSERT (FALSE); ASSERT (FALSE);
CpuDeadLoop (); CpuDeadLoop ();
@ -348,9 +351,8 @@ PeiLoadFile (
ZeroMem (&ImageContext, sizeof (ImageContext)); ZeroMem (&ImageContext, sizeof (ImageContext));
ImageContext.Handle = Pe32Data; ImageContext.Handle = Pe32Data;
Status = GetImageReadFunction (&ImageContext); ImageContext.ImageRead = PeiImageRead;
ASSERT_EFI_ERROR (Status);
Status = PeCoffLoaderGetImageInfo (&ImageContext); Status = PeCoffLoaderGetImageInfo (&ImageContext);
if (EFI_ERROR (Status)) { 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; *ImageAddress = ImageContext.ImageAddress;
*ImageSize = ImageContext.ImageSize; *ImageSize = ImageContext.ImageSize;
@ -504,7 +506,7 @@ CustomGuidedSectionExtract (
if (*OutputBuffer == NULL) { if (*OutputBuffer == NULL) {
return EFI_OUT_OF_RESOURCES; 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, // *OutputBuffer still is one section. Adjust *OutputBuffer offset,
// skip EFI section header to make section data at page alignment. // skip EFI section header to make section data at page alignment.
@ -517,7 +519,7 @@ CustomGuidedSectionExtract (
OutputBuffer, OutputBuffer,
ScratchBuffer, ScratchBuffer,
AuthenticationStatus AuthenticationStatus
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
// //
// Decode failed // Decode failed
@ -536,7 +538,7 @@ CustomGuidedSectionExtract (
/** /**
Decompresses a section to the output buffer. 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 applies the appropriate compression algorithm to compress the section to a
callee allocated buffer. callee allocated buffer.
@ -585,7 +587,7 @@ Decompress (
case EFI_STANDARD_COMPRESSION: case EFI_STANDARD_COMPRESSION:
// //
// Load EFI standard compression. // Load EFI standard compression.
// For compressed data, decompress them to dstbuffer. // For compressed data, decompress them to destination buffer.
// //
Status = UefiDecompressGetInfo ( Status = UefiDecompressGetInfo (
(UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1), (UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
@ -671,8 +673,6 @@ Decompress (
} }
/** /**
Updates the Stack HOB passed to DXE phase. Updates the Stack HOB passed to DXE phase.

View File

@ -1,5 +1,5 @@
/** @file /** @file
x64-specifc functionality for DxeLoad. EBC-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials 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 This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList. 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. @param HobList The start of HobList passed to DxeCore.
**/ **/
@ -51,7 +51,7 @@ HandOffToDxeCore (
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
// //
// End of PEI phase singal // End of PEI phase signal
// //
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -1,5 +1,5 @@
/** @file /** @file
Ia32-specifc functionality for DxeLoad. Ia32-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials 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 This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList. 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. @param HobList The start of HobList passed to DxeCore.
**/ **/
@ -102,7 +102,7 @@ HandOffToDxeCore (
PageTables = CreateIdentityMappingPageTables (); PageTables = CreateIdentityMappingPageTables ();
// //
// End of PEI phase singal // End of PEI phase signal
// //
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
@ -165,7 +165,7 @@ HandOffToDxeCore (
TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); TopOfStack = (EFI_PHYSICAL_ADDRESS) (UINTN) ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
// //
// End of PEI phase singal // End of PEI phase signal
// //
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -54,40 +54,3 @@ PeiImageRead (
return EFI_SUCCESS; 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;
}

View File

@ -4,16 +4,16 @@
enter Long Mode (x64 64-bit mode). enter Long Mode (x64 64-bit mode).
While we make a 1:1 mapping (identity mapping) for all physical pages 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. for all memory regions is correct.
The basic idea is to use 2MB page table entries where ever possible. If 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. more granularity of cachability is required then 4K page tables are used.
References: References:
1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel 1) IA-32 Intel(R) Architecture 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 2) IA-32 Intel(R) Architecture 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 3) IA-32 Intel(R) Architecture Software Developer's Manual Volume 3:System Programmer's Guide, Intel
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials 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 "DxeIpl.h"
#include "VirtualMemory.h" #include "VirtualMemory.h"
/** /**
Allocates and fills in the Page Directory and Page Table Entries to Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping. 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 table entries to the physical
address space. address space.
@return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created @return The address of 4 level page map.
**/ **/
UINTN UINTN

View File

@ -110,7 +110,7 @@ typedef union {
table entries to the physical table entries to the physical
address space. address space.
@return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created @return The address of 4 level page map.
**/ **/
UINTN UINTN
@ -119,9 +119,6 @@ CreateIdentityMappingPageTables (
); );
/** /**
Fix up the vector number in the vector code. Fix up the vector number in the vector code.

View File

@ -1,5 +1,5 @@
/** @file /** @file
Ipf-specifc functionality for DxeLoad. Ipf-specific functionality for DxeLoad.
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials 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 This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList. 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. @param HobList The start of HobList passed to DxeCore.
**/ **/
@ -62,7 +62,7 @@ HandOffToDxeCore (
TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); TopOfStack = ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT);
// //
// End of PEI phase singal // End of PEI phase signal
// //
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -49,22 +49,3 @@ PeiImageRead (
return EFI_SUCCESS; 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;
}

View File

@ -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 This function performs a CPU architecture specific operations to execute
the entry point of DxeCore with the parameters of HobList. 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. @param HobList The start of HobList passed to DxeCore.
**/ **/
@ -58,7 +58,7 @@ HandOffToDxeCore (
PageTables = CreateIdentityMappingPageTables (); PageTables = CreateIdentityMappingPageTables ();
// //
// End of PEI phase singal // End of PEI phase signal
// //
Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi); Status = PeiServicesInstallPpi (&gEndOfPeiSignalPpi);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);

View File

@ -29,11 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h" #include "DxeIpl.h"
#include "VirtualMemory.h" #include "VirtualMemory.h"
/** /**
Allocates and fills in the Page Directory and Page Table Entries to Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping. 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 table entries to the physical
address space. address space.
@return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created @return The address of 4 level page map.
**/ **/
UINTN UINTN
@ -73,7 +68,7 @@ CreateIdentityMappingPageTables (
Hob = GetFirstHob (EFI_HOB_TYPE_CPU); Hob = GetFirstHob (EFI_HOB_TYPE_CPU);
if (Hob != NULL) { if (Hob != NULL) {
PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace; PhysicalAddressBits = ((EFI_HOB_CPU *) Hob)->SizeOfMemorySpace;
} }
// //

View File

@ -2,9 +2,9 @@
x64 Long Mode Virtual Memory Management Definitions x64 Long Mode Virtual Memory Management Definitions
References: References:
1) IA-32 Intel(R) Atchitecture Software Developer's Manual Volume 1:Basic Architecture, Intel 1) IA-32 Intel(R) Architecture 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 2) IA-32 Intel(R) Architecture 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 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 4) AMD64 Architecture Programmer's Manual Volume 2: System Programming
Copyright (c) 2006 - 2008, Intel Corporation. <BR> Copyright (c) 2006 - 2008, Intel Corporation. <BR>
@ -100,7 +100,6 @@ typedef union {
#pragma pack() #pragma pack()
/** /**
Allocates and fills in the Page Directory and Page Table Entries to Allocates and fills in the Page Directory and Page Table Entries to
establish a 1:1 Virtual to Physical mapping. establish a 1:1 Virtual to Physical mapping.
@ -110,7 +109,7 @@ typedef union {
table entries to the physical table entries to the physical
address space. address space.
@return EFI_SUCCESS The 1:1 Virtual to Physical identity mapping was created @return The address of 4 level page map.
**/ **/
UINTN UINTN
@ -119,15 +118,11 @@ CreateIdentityMappingPageTables (
); );
/** /**
Fix up the vector number in the vector code. Fix up the vector number in the vector code.
@param VectorBase Base address of the vector handler. @param VectorBase Base address of the vector handler.
@param VectorNum Index of vector. @param VectorNum Index of vector.
**/ **/
@ -139,9 +134,6 @@ AsmVectorFixup (
); );
/** /**
Get the information of vector template. Get the information of vector template.

View File

@ -474,6 +474,7 @@ PeiDispatcher (
// But if new stack is smaller than the size of old stack, we also reserve // 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. // 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); ASSERT (Private->StackSize >= OldPeiStackSize);
StackGap = Private->StackSize - OldPeiStackSize; StackGap = Private->StackSize - OldPeiStackSize;

View File

@ -1,12 +1,13 @@
/** @file /** @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 This Boot Services is in the Runtime Driver because this service is
also required by SetVirtualAddressMap() when the EFI System Table and also required by SetVirtualAddressMap() when the EFI System Table and
EFI Runtime Services Table are converted from physical address to 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 All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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 internal function reverses bits for 32bit data.
This is a internal function.
@param Value The data to be reversed. @param Value The data to be reversed.
@ -89,6 +89,7 @@ ReverseBits (
/** /**
Initialize CRC32 table. Initialize CRC32 table.
**/ **/
VOID VOID
RuntimeDriverInitializeCrc32Table ( RuntimeDriverInitializeCrc32Table (

View File

@ -1,5 +1,6 @@
/** @file /** @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 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 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 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 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. 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 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. 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 All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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 internal function. The EFI Boot Services Table can not be used because
the EFI Boot Services Table was destroyed at ExitBootServices(). the EFI Boot Services Table was destroyed at ExitBootServices().
This is a internal function. This is a internal function.
@ -158,10 +159,10 @@ RuntimeDriverConvertPointer (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
VirtEntry = mVirtualMap; VirtEntry = mVirtualMap;
for (Index = 0; Index < mVirtualMapMaxIndex; Index++) { 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 // 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 // platforms. If you get this ASSERT remove the UINTN and do a 64-bit
// multiply. // multiply.
@ -315,7 +316,7 @@ RuntimeDriverSetVirtualAddressMap (
RuntimeImage->RelocationData 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 Entry Point for Runtime driver.
RT in physical mode. The only Lib services are gBS, gRT, and the DEBUG and
ASSERT macros (they do ReportStatusCode).
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 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 @retval EFI_SUCEESS Runtime Driver Architectural Protocol is successfully installed
@return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check @return Others Some error occurs when installing Runtime Driver Architectural Protocol.
gBS->InstallMultipleProtocolInterfaces for details.
**/ **/
EFI_STATUS EFI_STATUS
@ -386,7 +386,7 @@ RuntimeDriverInitialize (
EFI_LOADED_IMAGE_PROTOCOL *MyLoadedImage; 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. // a copy of the Loaded Image protocol to test later.
// //
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
@ -420,5 +420,5 @@ RuntimeDriverInitialize (
); );
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
return EFI_SUCCESS; return Status;
} }

View File

@ -1,6 +1,9 @@
#/** @file #/** @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 # Copyright (c) 2006 - 2008, Intel Corporation
# #

View File

@ -1,5 +1,5 @@
#/** @file #/** @file
# FvbService Library for UEFI drivers # FvbService Library for DXE phase drivers
# #
# This library instance provide sevice functions to access Firmware Volume Block protocol. # This library instance provide sevice functions to access Firmware Volume Block protocol.
# #
@ -21,13 +21,13 @@
FILE_GUID = bd4d540e-04b0-4b10-8fd5-4a7bb533cf67 FILE_GUID = bd4d540e-04b0-4b10-8fd5-4a7bb533cf67
MODULE_TYPE = DXE_RUNTIME_DRIVER MODULE_TYPE = DXE_RUNTIME_DRIVER
VERSION_STRING = 1.0 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 CONSTRUCTOR = FvbLibInitialize
# #
# The following information is for reference only and not required by the build tools. # 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 # VIRTUAL_ADDRESS_MAP_CALLBACK = FvbVirtualAddressChangeNotifyEvent
# #

View File

@ -1,12 +1,11 @@
/**@file /**@file
Firmware Volume Block Protocol Runtime Interface Abstraction Firmware Volume Block Protocol Runtime Interface Abstraction
And FVB Extension 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 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 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 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 Copyright (c) 2006 - 2008, Intel Corporation
@ -267,11 +266,11 @@ FvbVirtualAddressChangeNotifyEvent (
/** /**
Library constructor function entry. 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. @param SystemTable The point of System Table.
@retval EFI_SUCESS Sucess construct this library. @retval EFI_SUCESS Success construct this library.
@retval Others Fail to contruct this libary. @retval Others Fail to construct this library.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -413,9 +412,9 @@ EfiFvbReadBlock (
If NumBytes is NULL, then ASSERT(). If NumBytes is NULL, then ASSERT().
@param Instance The FV instance to be written to @param Instance The FV instance to be written to.
@param Lba The starting logical block index to write to @param Lba The starting logical block index to write.
@param Offset The offset relative to the block, at which to begin writting. @param Offset The offset relative to the block to write.
@param NumBytes Pointer to a UINTN. On input, *NumBytes contains @param NumBytes Pointer to a UINTN. On input, *NumBytes contains
the total size of the buffer. On output, it contains the total size of the buffer. On output, it contains
the actual number of bytes written. the actual number of bytes written.

View File

@ -46,8 +46,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingSASGuid
/** /**
The user Entry Point for DevicePath module. The user Entry Point for DevicePath module.
This is the entrhy point for DevicePath module. It installs the UEFI Device Path Utility Protocol and This is the entry 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. 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] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table. @param[in] SystemTable A pointer to the EFI System Table.

View File

@ -31,14 +31,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DevicePathLib.h> #include <Library/DevicePathLib.h>
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
extern const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid;
extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
#define MAX_CHAR 480 #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_COMMA(a) ((a) == L',')
#define IS_HYPHEN(a) ((a) == L'-') #define IS_HYPHEN(a) ((a) == L'-')
#define IS_DOT(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_SLASH(a) ((a) == L'/')
#define IS_NULL(a) ((a) == L'\0') #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)->Type = END_DEVICE_PATH_TYPE; \
(a)->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; \ (a)->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; \
(a)->Length[0] = sizeof (EFI_DEVICE_PATH_PROTOCOL); \ (a)->Length[0] = sizeof (EFI_DEVICE_PATH_PROTOCOL); \

View File

@ -1,9 +1,10 @@
#/** @file #/** @file
# Device path driver that produces three UEFI device path protocols.
# #
# Component description file for Device Path Driver. # This driver produces Device Path Utilities protocol and optionally
# # DevicePahtToText and DevicePathFromText protocols based on feature flags
# This driver implement these three UEFI deveice path protocols ( # PcdDevicePathSupportDevicePathToText & PcdDevicePathSupportDevicePathFromText
# DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them. # respectively.
# #
# Copyright (c) 2006 - 2008, Intel Corporation. <BR> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
@ -57,7 +58,9 @@
gEfiVT100Guid # ALWAYS_CONSUMED gEfiVT100Guid # ALWAYS_CONSUMED
gEfiVT100PlusGuid # ALWAYS_CONSUMED gEfiVT100PlusGuid # ALWAYS_CONSUMED
gEfiPcAnsiGuid # ALWAYS_CONSUMED gEfiPcAnsiGuid # ALWAYS_CONSUMED
gEfiUartDevicePathGuid # ALWAYS_CONSUMED
gEfiSasDevicePathGuid # ALWAYS_CONSUMED
[Protocols] [Protocols]
gEfiDevicePathToTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED gEfiDevicePathToTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiDevicePathFromTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED gEfiDevicePathFromTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
@ -70,4 +73,3 @@
[Depex] [Depex]
TRUE TRUE

View File

@ -1504,7 +1504,7 @@ DevPathFromTextUartFlowCtrl (
sizeof (UART_FLOW_CONTROL_DEVICE_PATH) sizeof (UART_FLOW_CONTROL_DEVICE_PATH)
); );
CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid); CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid);
if (StrCmp (ValueStr, L"XonXoff") == 0) { if (StrCmp (ValueStr, L"XonXoff") == 0) {
UartFlowControl->FlowControlMap = 2; UartFlowControl->FlowControlMap = 2;
} else if (StrCmp (ValueStr, L"Hardware") == 0) { } else if (StrCmp (ValueStr, L"Hardware") == 0) {
@ -1555,7 +1555,7 @@ DevPathFromTextSAS (
sizeof (SAS_DEVICE_PATH) sizeof (SAS_DEVICE_PATH)
); );
CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid); CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid);
Strtoi64 (AddressStr, &Sas->SasAddress); Strtoi64 (AddressStr, &Sas->SasAddress);
Strtoi64 (LunStr, &Sas->Lun); Strtoi64 (LunStr, &Sas->Lun);
Sas->RelativeTargetPort = (UINT16) Strtoi (RTPStr); Sas->RelativeTargetPort = (UINT16) Strtoi (RTPStr);

View File

@ -55,10 +55,10 @@ CatPrint (
Size = StrSize (AppendStr) - sizeof (UINT16); Size = StrSize (AppendStr) - sizeof (UINT16);
Size = Size + StrSize (Str->Str); Size = Size + StrSize (Str->Str);
Str->Str = ReallocatePool ( Str->Str = ReallocatePool (
StrSize (Str->Str), StrSize (Str->Str),
Size, Size,
Str->Str Str->Str
); );
ASSERT (Str->Str != NULL); 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly of the display node is used, where applicable. If DisplayOnly
@ -208,7 +208,7 @@ DevPathToTextVendor (
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) { } else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
CatPrint (Str, L"VenUft8()"); CatPrint (Str, L"VenUft8()");
return ; return ;
} else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) { } else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap); FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
switch (FlowControlMap & 0x00000003) { switch (FlowControlMap & 0x00000003) {
case 0: case 0:
@ -228,7 +228,7 @@ DevPathToTextVendor (
} }
return ; return ;
} else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) { } else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
CatPrint ( CatPrint (
Str, Str,
L"SAS(0x%lx,0x%lx,0x%x,", 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly 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 DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly of the display node is used, where applicable. If DisplayOnly

View File

@ -231,7 +231,6 @@ DiskIoDriverBindingStop (
&Private->DiskIo &Private->DiskIo
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = gBS->CloseProtocol ( Status = gBS->CloseProtocol (
ControllerHandle, ControllerHandle,
&gEfiBlockIoProtocolGuid, &gEfiBlockIoProtocolGuid,

View File

@ -29,9 +29,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h> #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 { typedef struct {
UINTN Signature; UINTN Signature;

View File

@ -1,7 +1,12 @@
#/** @file #/** @file
# # Module that lays Disk I/O protocol on every Block I/O protocol.
# This module lays DiskIo protocol on every blockIo protocol #
# to provide byte-oriented access to block media. # 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> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials

View File

@ -6,7 +6,7 @@
code that is not run on an EFI system. The legacy code reads the code that is not run on an EFI system. The legacy code reads the
first sector of the active partition into memory and 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 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 always on the first sector of a media. The first sector also contains
the legacy boot strap code. the legacy boot strap code.
@ -212,7 +212,7 @@ PartitionInstallMbrChildHandles (
HdDev.PartitionNumber = PartitionNumber ++; HdDev.PartitionNumber = PartitionNumber ++;
HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA); HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA);
HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA); 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 ( Status = PartitionInstallChildHandle (
This, This,

View File

@ -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[] = { PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
PartitionInstallGptChildHandles, 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. created by this driver.
@param This Protocol instance pointer. @param This Protocol instance pointer.

View File

@ -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. created by this driver.
@param This Protocol instance pointer. @param This Protocol instance pointer.

View File

@ -1,11 +1,11 @@
#/** @file #/** @file
# # Modules that produces the logic Block I/O protocol for every partition
# Component description file for Partition module. # it discovers via the physical Block I/O.
# #
# Partition driver produces the logical BlockIo device # This module produces the logical Block I/O device that represents
# that represents the bytes Start to End of the Parent Block IO # the bytes from Start to End of the Parent Block I/O device.
# device (one partition of physical BlockIo device, # The partition of physical BlockIo device supported is one of legacy MBR, GPT,
# which can be one of GPT, MBR, ElTorito partition). # and "El Torito" partitions.
# #
# Copyright (c) 2006 - 2008, Intel Corporation. <BR> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
@ -31,9 +31,9 @@
# #
# VALID_ARCHITECTURES = IA32 X64 IPF EBC # VALID_ARCHITECTURES = IA32 X64 IPF EBC
# #
# DRIVER_BINDING = gPartitionDriverBinding # DRIVER_BINDING = gPartitionDriverBinding
# COMPONENT_NAME = gPartitionComponentName # COMPONENT_NAME = gPartitionComponentName
# COMPONENT_NAME2 = gPartitionComponentName2 # COMPONENT_NAME2 = gPartitionComponentName2
# #
[Sources.common] [Sources.common]
@ -68,7 +68,7 @@
[Protocols] [Protocols]
gEfiBlockIoProtocolGuid # PROTOCOL BY_START gEfiBlockIoProtocolGuid # PROTOCOL BY_START
gEfiDevicePathProtocolGuid # PROTOCOL BY_START gEfiDevicePathProtocolGuid # PROTOCOL BY_START
gEfiDiskIoProtocolGuid # PROTOCOL BY_START
gEfiBlockIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiDiskIoProtocolGuid # PROTOCOL TO_START gEfiDiskIoProtocolGuid # PROTOCOL TO_START
gEfiBlockIoProtocolGuid # PROTOCOL TO_START

View File

@ -1,8 +1,11 @@
#/** @file #/** @file
# English module that provides Unicode Collation supports.
# #
# Component description file for English module for unicode collation. # This driver installs Unicode ISO 639-2 Collation and
# # RFC 4646 Unicode Collation 2 protocols based on feature flags
# This driver installs UEFI EFI_UNICODE_COLLATION_PROTOCOL protocol to provide Unicode strings function. # 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> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials

View File

@ -15,9 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UnicodeCollationEng.h" #include "UnicodeCollationEng.h"
CHAR8 mEngUpperMap[0x100]; CHAR8 mEngUpperMap[MAP_TABLE_SIZE];
CHAR8 mEngLowerMap[0x100]; CHAR8 mEngLowerMap[MAP_TABLE_SIZE];
CHAR8 mEngInfoMap[0x100]; CHAR8 mEngInfoMap[MAP_TABLE_SIZE];
CHAR8 mOtherChars[] = { CHAR8 mOtherChars[] = {
'0', '0',
@ -106,7 +106,7 @@ InitializeUnicodeCollationEng (
// //
// Initialize mapping tables for the supported languages // 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; mEngUpperMap[Index] = (CHAR8) Index;
mEngLowerMap[Index] = (CHAR8) Index; mEngLowerMap[Index] = (CHAR8) Index;
mEngInfoMap[Index] = 0; mEngInfoMap[Index] = 0;
@ -453,9 +453,9 @@ EngStrToFat (
if (*String != '.' && *String != ' ') { if (*String != '.' && *String != ' ') {
// //
// If this is a valid fat char, move it. // 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]; *Fat = mEngUpperMap[*String];
} else { } else {
*Fat = '_'; *Fat = '_';

View File

@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Uefi.h> #include <Uefi.h>
#include <Protocol/UnicodeCollation.h> #include <Protocol/UnicodeCollation.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
@ -28,12 +27,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
// //
// Defines // Bit mask to indicate the validity of character in FAT file name.
// //
#define CHAR_FAT_VALID 0x01 #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 // Prototypes

View File

@ -1,8 +1,10 @@
#/** @file #/** @file
# Module that produces EBC Interprete and EBC Debug Support protocols.
# #
# This module for the EBC virtual machine implementation produces # This module implements EFI Byte Code (EBC) Virtual Machine that can provide
# EBC and EBC debug support protocols. # platformand processor-independent mechanisms for loading and executing EFI
# # device drivers.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR> # Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@ -108,7 +108,7 @@ VmReadIndex64 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 8-bit value from the memory adress. @return The 8-bit value from the memory address.
**/ **/
UINT8 UINT8
@ -123,7 +123,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 16-bit value from the memory adress. @return The 16-bit value from the memory address.
**/ **/
UINT16 UINT16
@ -138,7 +138,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 32-bit value from the memory adress. @return The 32-bit value from the memory address.
**/ **/
UINT32 UINT32
@ -153,7 +153,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 64-bit value from the memory adress. @return The 64-bit value from the memory address.
**/ **/
UINT64 UINT64
@ -193,7 +193,7 @@ VmReadMemN (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -223,7 +223,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -253,7 +253,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @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 This routine provides the ability to read raw unsigned data from the code
stream. 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 This routine provides the ability to read raw unsigned data from the code
stream. 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 This routine provides the ability to read raw unsigned data from the code
stream. stream.
@ -4599,7 +4599,7 @@ VmReadIndex64 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -4637,7 +4637,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -4700,7 +4700,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -4763,7 +4763,7 @@ VmWriteMem32 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -4828,7 +4828,7 @@ VmWriteMem64 (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @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 This routine provides the ability to read raw unsigned data from the code
stream. 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 This routine provides the ability to read raw unsigned data from the code
stream. 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 This routine provides the ability to read raw unsigned data from the code
stream. stream.
@ -5139,7 +5139,7 @@ VmReadCode64 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 8-bit value from the memory adress. @return The 8-bit value from the memory address.
**/ **/
UINT8 UINT8
@ -5164,7 +5164,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 16-bit value from the memory adress. @return The 16-bit value from the memory address.
**/ **/
UINT16 UINT16
@ -5195,7 +5195,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 32-bit value from the memory adress. @return The 32-bit value from the memory address.
**/ **/
UINT32 UINT32
@ -5230,7 +5230,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context. @param VmPtr A pointer to VM context.
@param Addr The memory address. @param Addr The memory address.
@return The 64-bit value from the memory adress. @return The 64-bit value from the memory address.
**/ **/
UINT64 UINT64

View File

@ -270,7 +270,7 @@ GetVmVersion (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.
@ -300,7 +300,7 @@ VmWriteMemN (
VM stack) to point into the EBC entry point arguments. VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context. @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. @param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully. @retval EFI_SUCCESS The instruction is executed successfully.

View File

@ -36,7 +36,7 @@ typedef UINT32 EXCEPTION_FLAGS;
typedef struct { typedef struct {
VM_REGISTER R[8]; // General purpose registers. VM_REGISTER R[8]; // General purpose registers.
UINT64 Flags; // Flags register: 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 // 1 Set to 1 if stepping
// 2..63 Reserved. // 2..63 Reserved.
VMIP Ip; // Instruction pointer. VMIP Ip; // Instruction pointer.
@ -106,7 +106,7 @@ EbcCreateThunks (
/** /**
Add a thunk to our list of thunks for a given image handle. 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. to memory that will be executed eventually.
@param ImageHandle The image handle to which the thunk is tied. @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 Handle The EFI handle as the index to the EBC stack.
@param StackBuffer A pointer to hold the returned stack buffer. @param StackBuffer A pointer to hold the returned stack buffer.