From d3308de7f5f477508fcd742d1a6287dc23b77eca Mon Sep 17 00:00:00 2001 From: mdkinney Date: Tue, 16 Feb 2010 04:06:46 +0000 Subject: 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 --- .../StatusCodeHandler/Smm/MemoryStatusCodeWorker.c | 17 +++-------------- .../StatusCodeHandler/Smm/StatusCodeHandlerSmm.h | 3 ++- .../StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf | 6 +++--- 3 files changed, 8 insertions(+), 18 deletions(-) (limited to 'MdeModulePkg/Universal/StatusCodeHandler') diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c index 5672ebcd0c..57ebe56181 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 3127a8cd13..325452769c 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 #include #include +#include // // Runtime memory status code worker definition diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf index b0846f23d1..6963022526 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 -- cgit v1.2.3