]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryProfileLib.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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 #include <PiDxe.h>
10
11 #include <Guid/MemoryProfile.h>
12
13 #include "DxeCoreMemoryProfileServices.h"
14
15 /**
16 Record memory profile of multilevel caller.
17
18 @param[in] CallerAddress Address of caller.
19 @param[in] Action Memory profile action.
20 @param[in] MemoryType Memory type.
21 EfiMaxMemoryType means the MemoryType is unknown.
22 @param[in] Buffer Buffer address.
23 @param[in] Size Buffer size.
24 @param[in] 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 MemoryProfileLibRecord (
40 IN PHYSICAL_ADDRESS CallerAddress,
41 IN MEMORY_PROFILE_ACTION Action,
42 IN EFI_MEMORY_TYPE MemoryType,
43 IN VOID *Buffer,
44 IN UINTN Size,
45 IN CHAR8 *ActionString OPTIONAL
46 )
47 {
48 return CoreUpdateProfile (CallerAddress, Action, MemoryType, Size, Buffer, ActionString);
49 }