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