]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryProfileLib.c
Merge branch 'master' of https://github.com/tianocore/edk2
[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
4 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php. \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
14\r
15\r
16#include <PiDxe.h>\r
17\r
18#include <Guid/MemoryProfile.h>\r
19\r
20#include "DxeCoreMemoryProfileServices.h"\r
21\r
22/**\r
23 Record memory profile of multilevel caller.\r
24\r
25 @param[in] CallerAddress Address of caller.\r
26 @param[in] Action Memory profile action.\r
27 @param[in] MemoryType Memory type.\r
28 EfiMaxMemoryType means the MemoryType is unknown.\r
29 @param[in] Buffer Buffer address.\r
30 @param[in] Size Buffer size.\r
31 @param[in] ActionString String for memory profile action.\r
32 Only needed for user defined allocate action.\r
33\r
34 @return EFI_SUCCESS Memory profile is updated.\r
35 @return EFI_UNSUPPORTED Memory profile is unsupported,\r
36 or memory profile for the image is not required,\r
37 or memory profile for the memory type is not required.\r
38 @return EFI_ACCESS_DENIED It is during memory profile data getting.\r
39 @return EFI_ABORTED Memory profile recording is not enabled.\r
40 @return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.\r
41 @return EFI_NOT_FOUND No matched allocate info found for free action.\r
42\r
43**/\r
44EFI_STATUS\r
45EFIAPI\r
46MemoryProfileLibRecord (\r
47 IN PHYSICAL_ADDRESS CallerAddress,\r
48 IN MEMORY_PROFILE_ACTION Action,\r
49 IN EFI_MEMORY_TYPE MemoryType,\r
50 IN VOID *Buffer,\r
51 IN UINTN Size,\r
52 IN CHAR8 *ActionString OPTIONAL\r
53 )\r
54{\r
55 return CoreUpdateProfile (CallerAddress, Action, MemoryType, Size, Buffer, ActionString);\r
56}\r
57\r