-\r
- //\r
- // Allocate Memory for table\r
- //\r
- mTable = AllocateZeroPool (\r
- (GROWTH_STEP * sizeof (EFI_SYSTEM_RESOURCE_ENTRY)) + sizeof (EFI_SYSTEM_RESOURCE_TABLE)\r
- );\r
- ASSERT (mTable != NULL);\r
- if (mTable == NULL) {\r
- DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to allocate memory for ESRT.\n"));\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
- mTable->FwResourceCount = 0;\r
- mTable->FwResourceCountMax = GROWTH_STEP;\r
- mTable->FwResourceVersion = EFI_SYSTEM_RESOURCE_TABLE_FIRMWARE_RESOURCE_VERSION;\r
-\r
- //\r
- // Register notify function for all FMP installed\r
- //\r
- mFmpInstallEvent = EfiCreateProtocolNotifyEvent (\r
- &gEfiFirmwareManagementProtocolGuid,\r
- TPL_CALLBACK,\r
- FmpInstallProtocolNotify,\r
- NULL,\r
- &mFmpInstallEventRegistration\r
- );\r
-\r
- ASSERT (mFmpInstallEvent != NULL);\r
-\r
- if (mFmpInstallEvent == NULL) {\r
- DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Failed to Create Protocol Notify Event for FMP.\n"));\r
- }\r