]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryProfileLib.c
BaseTools: Library hashing fix and optimization for --hash feature
[mirror_edk2.git] / MdeModulePkg / Library / DxeCoreMemoryAllocationLib / DxeCoreMemoryProfileLib.c
CommitLineData
e2735692
SZ
1/** @file\r
2 Support routines for memory profile for DxeCore.\r
3\r
d1102dba 4 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
e2735692
SZ
6\r
7**/\r
8\r
9\r
10#include <PiDxe.h>\r
11\r
12#include <Guid/MemoryProfile.h>\r
13\r
14#include "DxeCoreMemoryProfileServices.h"\r
15\r
16/**\r
17 Record memory profile of multilevel caller.\r
18\r
19 @param[in] CallerAddress Address of caller.\r
20 @param[in] Action Memory profile action.\r
21 @param[in] MemoryType Memory type.\r
22 EfiMaxMemoryType means the MemoryType is unknown.\r
23 @param[in] Buffer Buffer address.\r
24 @param[in] Size Buffer size.\r
25 @param[in] ActionString String for memory profile action.\r
26 Only needed for user defined allocate action.\r
27\r
28 @return EFI_SUCCESS Memory profile is updated.\r
29 @return EFI_UNSUPPORTED Memory profile is unsupported,\r
30 or memory profile for the image is not required,\r
31 or memory profile for the memory type is not required.\r
32 @return EFI_ACCESS_DENIED It is during memory profile data getting.\r
33 @return EFI_ABORTED Memory profile recording is not enabled.\r
34 @return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.\r
35 @return EFI_NOT_FOUND No matched allocate info found for free action.\r
36\r
37**/\r
38EFI_STATUS\r
39EFIAPI\r
40MemoryProfileLibRecord (\r
41 IN PHYSICAL_ADDRESS CallerAddress,\r
42 IN MEMORY_PROFILE_ACTION Action,\r
43 IN EFI_MEMORY_TYPE MemoryType,\r
44 IN VOID *Buffer,\r
45 IN UINTN Size,\r
46 IN CHAR8 *ActionString OPTIONAL\r
47 )\r
48{\r
49 return CoreUpdateProfile (CallerAddress, Action, MemoryType, Size, Buffer, ActionString);\r
50}\r
51\r