]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/MemoryProfileLib.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Include / Library / MemoryProfileLib.h
1 /** @file
2 Provides services to record memory profile of multilevel caller.
3
4 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _MEMORY_PROFILE_LIB_H_
10 #define _MEMORY_PROFILE_LIB_H_
11
12 #include <Guid/MemoryProfile.h>
13
14 /**
15 Record memory profile of multilevel caller.
16
17 @param[in] CallerAddress Address of caller.
18 @param[in] Action Memory profile action.
19 @param[in] MemoryType Memory type.
20 EfiMaxMemoryType means the MemoryType is unknown.
21 @param[in] Buffer Buffer address.
22 @param[in] Size Buffer size.
23 @param[in] ActionString String for memory profile action.
24 Only needed for user defined allocate action.
25
26 @return EFI_SUCCESS Memory profile is updated.
27 @return EFI_UNSUPPORTED Memory profile is unsupported,
28 or memory profile for the image is not required,
29 or memory profile for the memory type is not required.
30 @return EFI_ACCESS_DENIED It is during memory profile data getting.
31 @return EFI_ABORTED Memory profile recording is not enabled.
32 @return EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.
33 @return EFI_NOT_FOUND No matched allocate info found for free action.
34
35 **/
36 EFI_STATUS
37 EFIAPI
38 MemoryProfileLibRecord (
39 IN PHYSICAL_ADDRESS CallerAddress,
40 IN MEMORY_PROFILE_ACTION Action,
41 IN EFI_MEMORY_TYPE MemoryType,
42 IN VOID *Buffer,
43 IN UINTN Size,
44 IN CHAR8 *ActionString OPTIONAL
45 );
46
47 #endif