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