18extern UINT8 MemoryAttributeManagerDxeHiiBin[];
19extern UINT8 MemoryAttributeManagerDxeStrings[];
36 MEMORY_ATTRIBUTE_MANAGER_FORMSET_GUID
40 END_ENTIRE_DEVICE_PATH_SUBTYPE,
42 (UINT8)(END_DEVICE_PATH_LENGTH),
43 (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
66 Status =
gBS->InstallMultipleProtocolInterfaces (
68 &gEfiDevicePathProtocolGuid,
72 if (EFI_ERROR (Status)) {
77 &gMemoryAttributeManagerFormSetGuid,
79 MemoryAttributeManagerDxeStrings,
80 MemoryAttributeManagerDxeHiiBin,
84 if (HiiHandle ==
NULL) {
85 gBS->UninstallMultipleProtocolInterfaces (
87 &gEfiDevicePathProtocolGuid,
91 return EFI_OUT_OF_RESOURCES;
110 VOID *MemoryAttributeProtocol;
112 Size =
sizeof (Handle);
113 Status =
gBS->LocateHandle (
115 &gEfiMemoryAttributeProtocolGuid,
120 if (EFI_ERROR (Status)) {
121 ASSERT (Status == EFI_NOT_FOUND);
125 Status =
gBS->HandleProtocol (
127 &gEfiMemoryAttributeProtocolGuid,
128 &MemoryAttributeProtocol
131 if (EFI_ERROR (Status)) {
135 Status =
gBS->UninstallProtocolInterface (
137 &gEfiMemoryAttributeProtocolGuid,
138 MemoryAttributeProtocol
141 if (EFI_ERROR (Status)) {
147 "EFI Memory Attribute Protocol disabled due to user/platform preference!\n"
171 Config.Enabled = PROTOCOL_ENABLED_DEFAULT;
174 Status =
gRT->GetVariable (
175 MEMORY_ATTRIBUTE_MANAGER_DATA_VAR_NAME,
176 &gMemoryAttributeManagerFormSetGuid,
181 if (EFI_ERROR (Status)) {
182 Status =
gRT->SetVariable (
183 MEMORY_ATTRIBUTE_MANAGER_DATA_VAR_NAME,
184 &gMemoryAttributeManagerFormSetGuid,
192 if (!Config.Enabled) {
#define HARDWARE_DEVICE_PATH
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
STATIC VOID UninstallEfiMemoryAttributeProtocol(VOID)
STATIC EFI_STATUS EFIAPI InstallHiiPages(VOID)
EFI_STATUS EFIAPI MemoryAttributeManagerInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
#define EFI_VARIABLE_NON_VOLATILE