summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/EsrtDxe
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/EsrtDxe')
-rw-r--r--MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c23
-rw-r--r--MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf5
-rw-r--r--MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c8
-rw-r--r--MdeModulePkg/Universal/EsrtDxe/EsrtImpl.h10
4 files changed, 31 insertions, 15 deletions
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c
index 742abde4a6..16b18e0a54 100644
--- a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c
+++ b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.c
@@ -33,7 +33,7 @@ ESRT_MANAGEMENT_PROTOCOL mEsrtManagementProtocolTemplate = {
Get ESRT entry from ESRT Cache by FwClass Guid
@param[in] FwClass FwClass of Esrt entry to get
- @param[in out] Entry Esrt entry returned
+ @param[in, out] Entry Esrt entry returned
@retval EFI_SUCCESS The variable saving this Esrt Entry exists.
@retval EF_NOT_FOUND No correct variable found.
@@ -217,7 +217,7 @@ EsrtDxeRegisterEsrtEntry(
/**
This function syn up Cached ESRT with data from FMP instances
Function should be called after Connect All in order to locate all FMP protocols
- installed
+ installed.
@retval EFI_SUCCESS Successfully sync cache repository from FMP instances
@retval EFI_NOT_FOUND No FMP Instance are found
@@ -587,8 +587,13 @@ EsrtReadyToBootEventNotify (
EsrtTable->FwResourceCount = (UINT32)((NonFmpRepositorySize + FmpRepositorySize) / sizeof(EFI_SYSTEM_RESOURCE_ENTRY));
EsrtTable->FwResourceCountMax = PcdGet32(PcdMaxNonFmpEsrtCacheNum) + PcdGet32(PcdMaxFmpEsrtCacheNum);
- CopyMem(EsrtTable + 1, NonFmpEsrtRepository, NonFmpRepositorySize);
- CopyMem((UINT8 *)(EsrtTable + 1) + NonFmpRepositorySize, FmpEsrtRepository, FmpRepositorySize);
+ if (NonFmpRepositorySize != 0 && NonFmpEsrtRepository != NULL) {
+ CopyMem(EsrtTable + 1, NonFmpEsrtRepository, NonFmpRepositorySize);
+ }
+
+ if (FmpRepositorySize != 0 && FmpEsrtRepository != NULL) {
+ CopyMem((UINT8 *)(EsrtTable + 1) + NonFmpRepositorySize, FmpEsrtRepository, FmpRepositorySize);
+ }
//
// Publish Esrt to system config table
@@ -611,7 +616,17 @@ EXIT:
}
}
+/**
+ The module Entry Point of the Esrt DXE driver that manages cached ESRT repository
+ & publishes ESRT table
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.
+ @param[in] SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The entry point is executed successfully.
+ @retval Other Some error occurs when executing this entry point.
+
+**/
EFI_STATUS
EFIAPI
EsrtDxeEntryPoint (
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
index 573f8cd32b..88440c8588 100644
--- a/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
+++ b/MdeModulePkg/Universal/EsrtDxe/EsrtDxe.inf
@@ -30,6 +30,7 @@
#
[Sources]
+ EsrtImpl.h
EsrtImpl.c
EsrtDxe.c
@@ -50,8 +51,8 @@
PrintLib
[Guids]
- gEfiSystemResourceTableGuid ## PRODUCES
- gEfiEventReadyToBootGuid ## CONSUMES
+ gEfiSystemResourceTableGuid ## PRODUCES ## SystemTable
+ gEfiEventReadyToBootGuid ## CONSUMES ## Event
[Protocols]
gEfiFirmwareManagementProtocolGuid ## SOMETIMES_CONSUMES
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
index 09255bd632..f6d1e97451 100644
--- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
+++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c
@@ -174,7 +174,7 @@ InsertEsrtEntry(
goto EXIT;
}
- if (RepositorySize != 0) {
+ if (RepositorySize != 0 && EsrtRepository != NULL) {
CopyMem(EsrtRepositoryNew, EsrtRepository, RepositorySize);
}
CopyMem((UINT8 *)EsrtRepositoryNew + RepositorySize, Entry, sizeof(EFI_SYSTEM_RESOURCE_ENTRY));
@@ -393,9 +393,9 @@ EXIT:
/**
Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .
- @param[in] EsrtEntry Esrt entry to be Init
- @param[in] FmpImageInfo FMP image info descriptor
- @param[in] DescriptorVersion FMP Image info descriptor version
+ @param[in, out] EsrtEntry Esrt entry to be Init
+ @param[in] FmpImageInfo FMP image info descriptor
+ @param[in] DescriptorVersion FMP Image info descriptor version
**/
VOID
diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.h b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.h
index b26cbd2590..a238dfb8f7 100644
--- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.h
+++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.h
@@ -137,9 +137,9 @@ UpdateEsrtEntry(
/**
Init one ESRT entry according to input FmpImageInfo (V1, V2, V3) .
- @param[in] EsrtEntry Esrt entry to be Init
- @param[in] FmpImageInfo FMP image info descriptor
- @param[in] DescriptorVersion FMP Image info descriptor version
+ @param[in, out] EsrtEntry Esrt entry to be Init
+ @param[in] FmpImageInfo FMP image info descriptor
+ @param[in] DescriptorVersion FMP Image info descriptor version
**/
VOID
@@ -153,7 +153,7 @@ SetEsrtEntryFromFmpInfo (
Get ESRT entry from ESRT Cache by FwClass Guid
@param[in] FwClass FwClass of Esrt entry to get
- @param[in out] Entry Esrt entry returned
+ @param[in, out] Entry Esrt entry returned
@retval EFI_SUCCESS The variable saving this Esrt Entry exists.
@retval EF_NOT_FOUND No correct variable found.
@@ -215,7 +215,7 @@ EsrtDxeRegisterEsrtEntry(
/**
This function syn up Cached ESRT with data from FMP instances
Function should be called after Connect All in order to locate all FMP protocols
- installed
+ installed.
@retval EFI_SUCCESS Successfully sync cache repository from FMP instances
@retval EFI_NOT_FOUND No FMP Instance are found