mirror of https://github.com/acidanthera/audk.git
MdeModulePkg: Manage MemoryProfileLib separately
This commit is contained in:
parent
750a6dec00
commit
443dd80eb8
|
@ -1,12 +1,12 @@
|
|||
/** @file
|
||||
Null routines for memory profile for DxeCore.
|
||||
Null routines for memory profile.
|
||||
|
||||
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Guid/MemoryProfile.h>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
## @file
|
||||
# Memory Profile Library Null instance.
|
||||
#
|
||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
#
|
||||
#
|
||||
##
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = BaseMemoryProfileLibNull
|
||||
MODULE_UNI_FILE = BaseMemoryProfileLibNull.uni
|
||||
FILE_GUID = 888809d7-e5c5-4848-b8b9-f920a7b89ce1
|
||||
MODULE_TYPE = BASE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = MemoryProfileLib
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 EBC
|
||||
#
|
||||
|
||||
[Sources]
|
||||
BaseMemoryProfileLibNull.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
// /** @file
|
||||
// Memory Profile Library Null instance.
|
||||
//
|
||||
// Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
//
|
||||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Memory Profile Library Null instance"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "Memory Profile Library Null instance."
|
||||
|
|
@ -29,7 +29,6 @@
|
|||
[Sources]
|
||||
MemoryAllocationLib.c
|
||||
DxeCoreMemoryAllocationServices.h
|
||||
DxeCoreMemoryProfileLibNull.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
@ -38,3 +37,4 @@
|
|||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
MemoryProfileLib
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## @file
|
||||
# Memory Allocation/Profile Library instance dedicated to DXE Core.
|
||||
# The implementation borrows the DxeCore Memory Allocation/profile services as the primitive
|
||||
# for memory allocation/profile instead of using UEFI boot services or memory profile protocol in an indirect way.
|
||||
# Memory Profile Library instance dedicated to DXE Core.
|
||||
# The implementation borrows the DxeCore Memory profile services as the primitive
|
||||
# for memory profile instead of using UEFI boot services or memory profile protocol in an indirect way.
|
||||
# It is assumed that this library instance must be linked with DxeCore in this package.
|
||||
#
|
||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
|
@ -18,7 +18,6 @@
|
|||
FILE_GUID = 7ADD7147-74E8-4583-BE34-B6BC45353BB5
|
||||
MODULE_TYPE = DXE_CORE
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = MemoryAllocationLib|DXE_CORE
|
||||
LIBRARY_CLASS = MemoryProfileLib|DXE_CORE
|
||||
|
||||
#
|
||||
|
@ -28,8 +27,6 @@
|
|||
#
|
||||
|
||||
[Sources]
|
||||
MemoryAllocationLib.c
|
||||
DxeCoreMemoryAllocationServices.h
|
||||
DxeCoreMemoryProfileLib.c
|
||||
DxeCoreMemoryProfileServices.h
|
||||
|
||||
|
@ -37,7 +34,3 @@
|
|||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// /** @file
|
||||
// Memory Allocation/Profile Library instance dedicated to DXE Core.
|
||||
// Memory Profile Library instance dedicated to DXE Core.
|
||||
//
|
||||
// The implementation borrows the DxeCore Memory Allocation/Profile services as the primitive
|
||||
// for memory allocation/profile instead of using UEFI boot services or memory profile protocol in an indirect way.
|
||||
// The implementation borrows the DxeCore Memory Profile services as the primitive
|
||||
// for memory profile instead of using UEFI boot services or memory profile protocol in an indirect way.
|
||||
// It is assumed that this library instance must be linked with DxeCore in this package.
|
||||
//
|
||||
// Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
|
@ -12,7 +12,7 @@
|
|||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Memory Allocation/Profile Library instance dedicated to DXE Core"
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Memory Profile Library instance dedicated to DXE Core"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "The implementation borrows the DxeCore Memory Allocation/Profile services as the primitive for memory allocation/profile instead of using UEFI boot services or memory profile protocol in an indirect way. It is assumed that this library instance must be linked with DxeCore in this package."
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "The implementation borrows the DxeCore Memory Profile services as the primitive for memory profile instead of using UEFI boot services or memory profile protocol in an indirect way. It is assumed that this library instance must be linked with DxeCore in this package."
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/** @file
|
||||
Support routines for memory allocation routines based on SMM Core internal functions,
|
||||
with memory profile support.
|
||||
|
||||
The PI System Management Mode Core Interface Specification only allows the use
|
||||
of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory
|
||||
allocations as the SMRAM space should be reserved after BDS phase. The functions
|
||||
in the Memory Allocation Library use EfiBootServicesData as the default memory
|
||||
allocation type. For this SMM specific instance of the Memory Allocation Library,
|
||||
EfiRuntimeServicesData is used as the default memory type for all allocations.
|
||||
In addition, allocation for the Reserved memory types are not supported and will
|
||||
always return NULL.
|
||||
|
||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
//
|
||||
// The required functions are defined by PiSmmCore itself.
|
||||
//
|
|
@ -31,13 +31,10 @@
|
|||
#
|
||||
|
||||
[Sources]
|
||||
PiSmmCoreMemoryProfileLibNull.c
|
||||
MemoryAllocationLib.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryProfileLib
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
## @file
|
||||
# Memory Allocation/Profile Library instance dedicated to SMM Core.
|
||||
# The implementation borrows the SMM Core Memory Allocation/Profile services as the primitive
|
||||
# for memory allocation/profile instead of using SMM System Table servces or SMM memory profile protocol in an indirect way.
|
||||
# It is assumed that this library instance must be linked with SMM Cre in this package.
|
||||
# Memory Profile Library instance dedicated to SMM Core.
|
||||
# The implementation borrows the SMM Core Memory Profile services as the primitive
|
||||
# for memory profile instead of using SMM System Table services or SMM memory profile protocol in an indirect way.
|
||||
# It is assumed that this library instance must be linked with SMM Core in this package.
|
||||
#
|
||||
# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
|
@ -18,7 +18,6 @@
|
|||
MODULE_TYPE = SMM_CORE
|
||||
VERSION_STRING = 1.0
|
||||
PI_SPECIFICATION_VERSION = 0x0001000A
|
||||
LIBRARY_CLASS = MemoryAllocationLib|SMM_CORE
|
||||
#
|
||||
# This function is defined in PiSmmCore.
|
||||
#
|
||||
|
@ -42,9 +41,7 @@
|
|||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
UefiBootServicesTableLib
|
||||
MemoryAllocationLib
|
||||
|
||||
[Guids]
|
||||
gEdkiiMemoryProfileGuid ## SOMETIMES_CONSUMES ## GUID # Locate protocol
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// /** @file
|
||||
// Memory Allocation/Profile Library instance dedicated to SMM Core.
|
||||
// Memory Profile Library instance dedicated to SMM Core.
|
||||
//
|
||||
// The implementation borrows the SMM Core Memory Allocation/Profile services as the primitive
|
||||
// for memory allocation/profile instead of using SMM System Table servces or SMM memory profile protocol in an indirect way.
|
||||
// It is assumed that this library instance must be linked with SMM Cre in this package.
|
||||
// The implementation borrows the SMM Core Memory Profile services as the primitive
|
||||
// for memory profile instead of using SMM System Table services or SMM memory profile protocol in an indirect way.
|
||||
// It is assumed that this library instance must be linked with SMM Core in this package.
|
||||
//
|
||||
// Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
|
@ -12,7 +12,7 @@
|
|||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Memory Allocation/Profile Library instance dedicated to SMM Core"
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Memory Profile Library instance dedicated to SMM Core"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "The implementation borrows the SMM Core Memory Allocation/Profile services as the primitive for memory allocation/profile instead of using SMM System Table services or SMM memory profile protocol in an indirect way. This library is only intended to be linked with the SMM Core that resides in this same package."
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "The implementation borrows the SMM Core Memory Profile services as the primitive for memory profile instead of using SMM System Table services or SMM memory profile protocol in an indirect way. This library is only intended to be linked with the SMM Core that resides in this same package."
|
||||
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
/** @file
|
||||
Null routines for memory profile for PiSmmCore.
|
||||
|
||||
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <PiSmm.h>
|
||||
|
||||
#include <Guid/MemoryProfile.h>
|
||||
|
||||
/**
|
||||
Record memory profile of multilevel caller.
|
||||
|
||||
@param[in] CallerAddress Address of caller.
|
||||
@param[in] Action Memory profile action.
|
||||
@param[in] MemoryType Memory type.
|
||||
EfiMaxMemoryType means the MemoryType is unknown.
|
||||
@param[in] Buffer Buffer address.
|
||||
@param[in] Size Buffer size.
|
||||
@param[in] ActionString String for memory profile action.
|
||||
Only needed for user defined allocate action.
|
||||
|
||||
@return EFI_SUCCESS Memory profile is updated.
|
||||
@return EFI_UNSUPPORTED Memory profile is unsupported,
|
||||
or memory profile for the image is not required,
|
||||
or memory profile for the memory type is not required.
|
||||
@return EFI_ACCESS_DENIED It is during memory profile data getting.
|
||||
@return EFI_ABORTED Memory profile recording is not enabled.
|
||||
@return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.
|
||||
@return EFI_NOT_FOUND No matched allocate info found for free action.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MemoryProfileLibRecord (
|
||||
IN PHYSICAL_ADDRESS CallerAddress,
|
||||
IN MEMORY_PROFILE_ACTION Action,
|
||||
IN EFI_MEMORY_TYPE MemoryType,
|
||||
IN VOID *Buffer,
|
||||
IN UINTN Size,
|
||||
IN CHAR8 *ActionString OPTIONAL
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,6 @@
|
|||
## @file
|
||||
# Instance of Memory Allocation Library using SMM Services Table,
|
||||
# with memory profile support.
|
||||
#
|
||||
# Memory Allocation Library that uses services from the SMM Services Table to
|
||||
# allocate and free memory, with memory profile support.
|
||||
#
|
||||
# The implementation of this instance is copied from UefiMemoryAllocationLib
|
||||
# in MdePkg and updated to support both MemoryAllocationLib and MemoryProfileLib.
|
||||
# Instance of Memory Profile Library using the EDK II SMM Memory Profile
|
||||
# Protocol.
|
||||
#
|
||||
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
@ -21,9 +15,6 @@
|
|||
MODULE_TYPE = DXE_SMM_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
PI_SPECIFICATION_VERSION = 0x0001000A
|
||||
LIBRARY_CLASS = MemoryAllocationLib|DXE_SMM_DRIVER
|
||||
CONSTRUCTOR = SmmMemoryAllocationLibConstructor
|
||||
DESTRUCTOR = SmmMemoryAllocationLibDestructor
|
||||
LIBRARY_CLASS = MemoryProfileLib|DXE_SMM_DRIVER
|
||||
CONSTRUCTOR = SmmMemoryProfileLibConstructor
|
||||
|
||||
|
@ -32,7 +23,6 @@
|
|||
#
|
||||
|
||||
[Sources]
|
||||
MemoryAllocationLib.c
|
||||
SmmMemoryProfileLib.c
|
||||
|
||||
[Packages]
|
||||
|
@ -41,7 +31,6 @@
|
|||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
SmmServicesTableLib
|
||||
UefiBootServicesTableLib
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
// /** @file
|
||||
// Instance of Memory Allocation Library using SMM Services Table,
|
||||
// with memory profile support.
|
||||
//
|
||||
// Memory Allocation Library that uses services from the SMM Services Table to
|
||||
// allocate and free memory, with memory profile support.
|
||||
// Instance of Memory Profile Library using the EDK II SMM Memory Profile
|
||||
// Protocol.
|
||||
//
|
||||
// Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
|
@ -12,7 +9,7 @@
|
|||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Instance of Memory Allocation Library using SMM Services Table, with memory profile support"
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Instance of Memory Profile Library using the EDK II SMM Memory Profile Protocol"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "This Memory Allocation Library uses services from the SMM Services Table to allocate and free memory, with memory profile support."
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "Instance of Memory Profile Library using the EDK II SMM Memory Profile Protocol."
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,5 @@
|
|||
## @file
|
||||
# Instance of Memory Allocation Library using EFI Boot Services,
|
||||
# with memory profile support.
|
||||
#
|
||||
# Memory Allocation Library that uses EFI Boot Services to allocate
|
||||
# and free memory, with memory profile support.
|
||||
#
|
||||
# The implementation of this instance is copied from UefiMemoryAllocationLib
|
||||
# in MdePkg and updated to support both MemoryAllocationLib and MemoryProfileLib.
|
||||
# Instance of Memory Profile Library using the EDK II Memory Profile Protocol.
|
||||
#
|
||||
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
|
@ -22,7 +15,6 @@
|
|||
FILE_GUID = 9E8A380A-231E-41E4-AD40-5E706196B853
|
||||
MODULE_TYPE = UEFI_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = MemoryAllocationLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
|
||||
LIBRARY_CLASS = MemoryProfileLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
|
||||
CONSTRUCTOR = MemoryProfileLibConstructor
|
||||
|
||||
|
@ -31,7 +23,6 @@
|
|||
#
|
||||
|
||||
[Sources]
|
||||
MemoryAllocationLib.c
|
||||
DxeMemoryProfileLib.c
|
||||
|
||||
[Packages]
|
||||
|
@ -40,7 +31,6 @@
|
|||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
BaseMemoryLib
|
||||
UefiBootServicesTableLib
|
||||
|
||||
[Guids]
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
// /** @file
|
||||
// Instance of Memory Allocation Library using EFI Boot Services,
|
||||
// with memory profile support.
|
||||
//
|
||||
// Memory Allocation Library that uses EFI Boot Services to allocate
|
||||
// and free memory, with memory profile support.
|
||||
// Instance of Memory Profile Library using the EDK II Memory Profile Protocol.
|
||||
//
|
||||
// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
//
|
||||
|
@ -12,7 +8,7 @@
|
|||
// **/
|
||||
|
||||
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Instance of Memory Allocation Library using EFI Boot Services, with memory profile support"
|
||||
#string STR_MODULE_ABSTRACT #language en-US "Instance of Memory Profile Library using the EDK II Memory Profile Protocol"
|
||||
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "This Memory Allocation Library uses EFI Boot Services to allocate and free memory, with memory profile support."
|
||||
#string STR_MODULE_DESCRIPTION #language en-US "Instance of Memory Profile Library using the EDK II Memory Profile Protocol."
|
||||
|
||||
|
|
|
@ -17,3 +17,5 @@
|
|||
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
|
||||
SmmCpuRendezvousLib|MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf
|
||||
BaseOverflowLib|MdePkg/Library/BaseOverflowLib/BaseOverflowLib.inf
|
||||
|
||||
MemoryProfileLib|MdeModulePkg/Library/BaseMemoryProfileLibNull/BaseMemoryProfileLibNull.inf
|
||||
|
|
Loading…
Reference in New Issue