summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-16 04:06:46 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-16 04:06:46 +0000
commitd3308de7f5f477508fcd742d1a6287dc23b77eca (patch)
tree2020002b7a33a1481351903b90c17449e15e1a50 /MdeModulePkg
parent300240b62bf138afba3b427d04111e75c01659c0 (diff)
downloadedk2-d3308de7f5f477508fcd742d1a6287dc23b77eca.zip
edk2-d3308de7f5f477508fcd742d1a6287dc23b77eca.tar.gz
edk2-d3308de7f5f477508fcd742d1a6287dc23b77eca.tar.bz2
Use Memory Allocation Library instance for modules of type DXE_SMM_DRIVER
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10014 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c17
-rw-r--r--MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h3
-rw-r--r--MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf5
-rw-r--r--MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c17
-rw-r--r--MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h3
-rw-r--r--MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf6
6 files changed, 17 insertions, 34 deletions
diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c
index 5e7cd18..37ebc05 100644
--- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c
+++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.c
@@ -2,7 +2,7 @@
Report Status Code Router Driver which produces SMM Report Stataus Code Handler Protocol
and SMM Status Code Protocol.
- Copyright (c) 2009, Intel Corporation
+ Copyright (c) 2009 -2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -54,9 +54,8 @@ Register (
IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Link;
- SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry;
+ LIST_ENTRY *Link;
+ SMM_RSC_HANDLER_CALLBACK_ENTRY *CallbackEntry;
if (Callback == NULL) {
return EFI_INVALID_PARAMETER;
@@ -72,13 +71,7 @@ Register (
}
}
- Status = gSmst->SmmAllocatePool (
- EfiRuntimeServicesData,
- sizeof (SMM_RSC_HANDLER_CALLBACK_ENTRY),
- (VOID**)&CallbackEntry
- );
-
- ASSERT_EFI_ERROR(Status);
+ CallbackEntry = (SMM_RSC_HANDLER_CALLBACK_ENTRY *)AllocatePool (sizeof (SMM_RSC_HANDLER_CALLBACK_ENTRY));
ASSERT (CallbackEntry != NULL);
CallbackEntry->Signature = SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE;
@@ -122,7 +115,7 @@ Unregister (
// If the function is found in list, delete it and return.
//
RemoveEntryList (&CallbackEntry->Node);
- gSmst->SmmFreePool (CallbackEntry);
+ FreePool (CallbackEntry);
return EFI_SUCCESS;
}
}
diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h
index d3017b4..d272448 100644
--- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h
+++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h
@@ -1,7 +1,7 @@
/** @file
Internal include file for Report Status Code Router Driver.
- Copyright (c) 2009, Intel Corporation
+ Copyright (c) 2009 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -25,6 +25,7 @@
#include <Library/PcdLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/SmmServicesTableLib.h>
+#include <Library/MemoryAllocationLib.h>
#define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE SIGNATURE_32 ('s', 'h', 'c', 'e')
diff --git a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf
index 2330589..d3ca177 100644
--- a/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf
+++ b/MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf
@@ -20,7 +20,6 @@
FILE_GUID = A6885402-D022-4b0e-A509-4711B90F2A39
MODULE_TYPE = DXE_SMM_DRIVER
PI_SPECIFICATION_VERSION = 0x0001000A
-
ENTRY_POINT = GenericStatusCodeSmmEntry
#
@@ -29,11 +28,10 @@
# VALID_ARCHITECTURES = IA32 X64
#
-[Sources.common]
+[Sources]
ReportStatusCodeRouterSmm.c
ReportStatusCodeRouterSmm.h
-
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
@@ -44,6 +42,7 @@
DebugLib
BaseLib
SynchronizationLib
+ MemoryAllocationLib
[Protocols]
gEfiSmmRscHandlerProtocolGuid ## PRODUCES
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
index 5672ebc..57ebe56 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
@@ -1,7 +1,7 @@
/** @file
Runtime memory status code worker.
- Copyright (c) 2006 - 2009, Intel Corporation
+ Copyright (c) 2006 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -27,24 +27,13 @@ MemoryStatusCodeInitializeWorker (
VOID
)
{
- EFI_STATUS Status;
//
// Allocate SMM memory status code pool.
//
- Status = gSmst->SmmAllocatePool (
- EfiRuntimeServicesData,
- sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024,
- (VOID**)&mSmmMemoryStatusCodeTable
- );
-
- ASSERT_EFI_ERROR(Status);
+ mSmmMemoryStatusCodeTable = (RUNTIME_MEMORY_STATUSCODE_HEADER *)AllocateZeroPool (sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeMemorySize) * 1024);
ASSERT (mSmmMemoryStatusCodeTable != NULL);
- mSmmMemoryStatusCodeTable->RecordIndex = 0;
- mSmmMemoryStatusCodeTable->NumberOfRecords = 0;
- mSmmMemoryStatusCodeTable->MaxRecordsNumber =
- (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
-
+ mSmmMemoryStatusCodeTable->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
index 3127a8c..3254527 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
@@ -1,7 +1,7 @@
/** @file
Internal include file for Status Code Handler Driver.
- Copyright (c) 2009, Intel Corporation
+ Copyright (c) 2009 - 2010, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -29,6 +29,7 @@
#include <Library/UefiDriverEntryPoint.h>
#include <Library/SmmServicesTableLib.h>
#include <Library/SerialPortLib.h>
+#include <Library/MemoryAllocationLib.h>
//
// Runtime memory status code worker definition
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
index b0846f2..6963022 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf
@@ -2,7 +2,7 @@
# Status Code Handler Driver which produces general handlers and hook them
# onto the SMM status code router.
#
-# Copyright (c) 2009, Intel Corporation.
+# Copyright (c) 2009 - 2010, Intel Corporation.
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -20,7 +20,6 @@
FILE_GUID = 79CD78D8-6EDC-4978-BD02-3299C387AB17
MODULE_TYPE = DXE_SMM_DRIVER
PI_SPECIFICATION_VERSION = 0x0001000A
-
ENTRY_POINT = StatusCodeHandlerSmmEntry
#
@@ -29,7 +28,7 @@
# VALID_ARCHITECTURES = IA32 X64
#
-[Sources.common]
+[Sources]
StatusCodeHandlerSmm.c
StatusCodeHandlerSmm.h
SerialStatusCodeWorker.c
@@ -48,6 +47,7 @@
ReportStatusCodeLib
DebugLib
SynchronizationLib
+ MemoryAllocationLib
[Guids]
gMemoryStatusCodeRecordGuid ## CONSUMES ## HOB