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