TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeMemoryProfileLib.c
Go to the documentation of this file.
1
9#include <Uefi.h>
10
12#include <Library/DebugLib.h>
13
14#include <Guid/MemoryProfile.h>
15
16EDKII_MEMORY_PROFILE_PROTOCOL *mLibProfileProtocol;
17
28EFIAPI
30 IN EFI_HANDLE ImageHandle,
31 IN EFI_SYSTEM_TABLE *SystemTable
32 )
33{
34 EFI_STATUS Status;
35
36 Status = gBS->LocateProtocol (
37 &gEdkiiMemoryProfileGuid,
38 NULL,
39 (VOID **)&mLibProfileProtocol
40 );
41 if (EFI_ERROR (Status)) {
42 mLibProfileProtocol = NULL;
43 }
44
45 return EFI_SUCCESS;
46}
47
71EFIAPI
73 IN PHYSICAL_ADDRESS CallerAddress,
74 IN MEMORY_PROFILE_ACTION Action,
75 IN EFI_MEMORY_TYPE MemoryType,
76 IN VOID *Buffer,
77 IN UINTN Size,
78 IN CHAR8 *ActionString OPTIONAL
79 )
80{
81 if (mLibProfileProtocol == NULL) {
82 return EFI_UNSUPPORTED;
83 }
84
85 return mLibProfileProtocol->Record (
86 mLibProfileProtocol,
87 CallerAddress,
88 Action,
89 MemoryType,
90 Buffer,
91 Size,
92 ActionString
93 );
94}
UINT64 UINTN
EFI_STATUS EFIAPI MemoryProfileLibRecord(IN PHYSICAL_ADDRESS CallerAddress, IN MEMORY_PROFILE_ACTION Action, IN EFI_MEMORY_TYPE MemoryType, IN VOID *Buffer, IN UINTN Size, IN CHAR8 *ActionString OPTIONAL)
EFI_STATUS EFIAPI MemoryProfileLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_MEMORY_TYPE