14STATIC CONST CHAR16 NameEfiReservedMemoryType[] = L
"Reserved";
15STATIC CONST CHAR16 NameEfiLoaderCode[] = L
"LoaderCode";
16STATIC CONST CHAR16 NameEfiLoaderData[] = L
"LoaderData";
17STATIC CONST CHAR16 NameEfiBootServicesCode[] = L
"BootServiceCode";
18STATIC CONST CHAR16 NameEfiBootServicesData[] = L
"BootServiceData";
19STATIC CONST CHAR16 NameEfiRuntimeServicesCode[] = L
"RuntimeCode";
20STATIC CONST CHAR16 NameEfiRuntimeServicesData[] = L
"RuntimeData";
21STATIC CONST CHAR16 NameEfiConventionalMemory[] = L
"Available";
22STATIC CONST CHAR16 NameEfiPersistentMemory[] = L
"Persistent";
23STATIC CONST CHAR16 NameEfiUnusableMemory[] = L
"UnusableMemory";
24STATIC CONST CHAR16 NameEfiACPIReclaimMemory[] = L
"ACPIReclaimMemory";
25STATIC CONST CHAR16 NameEfiACPIMemoryNVS[] = L
"ACPIMemoryNVS";
26STATIC CONST CHAR16 NameEfiMemoryMappedIO[] = L
"MemoryMappedIO";
27STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] = L
"MemoryMappedIOPortSpace";
29STATIC CONST CHAR16 NameEfiUnacceptedMemoryType[] = L
"Unaccepted";
34STATIC CONST CHAR16 NameEfiBootServicesCodeShort[] = L
"BS_Code";
35STATIC CONST CHAR16 NameEfiBootServicesDataShort[] = L
"BS_Data";
36STATIC CONST CHAR16 NameEfiRuntimeServicesCodeShort[] = L
"RT_Code";
37STATIC CONST CHAR16 NameEfiRuntimeServicesDataShort[] = L
"RT_Data";
38STATIC CONST CHAR16 NameEfiUnusableMemoryShort[] = L
"Unusable";
39STATIC CONST CHAR16 NameEfiACPIReclaimMemoryShort[] = L
"ACPI_Recl";
40STATIC CONST CHAR16 NameEfiACPIMemoryNVSShort[] = L
"ACPI_NVS";
41STATIC CONST CHAR16 NameEfiMemoryMappedIOShort[] = L
"MMIO";
42STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpaceShort[] = L
"MMIO_Port";
73 if (Entry->Type >= Type) {
78 if ((Entry !=
NULL) && (Entry->Type == Type)) {
90 if (NewEntry ==
NULL) {
94 NewEntry->Type = Type;
95 NewEntry->NumberOfPages = 0;
99 NewEntry->NumberOfPages += NumberOfPages;
117 CHAR16 *ProblemParam;
125 UINT64 ReservedPages;
126 UINT64 LoadCodePages;
127 UINT64 LoadDataPages;
134 UINT64 ReservedPagesSize;
135 UINT64 LoadCodePagesSize;
136 UINT64 LoadDataPagesSize;
137 UINT64 BSCodePagesSize;
138 UINT64 BSDataPagesSize;
139 UINT64 RTDataPagesSize;
140 UINT64 RTCodePagesSize;
141 UINT64 AvailPagesSize;
142 UINT64 TotalPagesSize;
143 UINT64 AcpiReclaimPages;
145 UINT64 MmioSpacePages;
146 UINT64 AcpiReclaimPagesSize;
147 UINT64 AcpiNvsPagesSize;
148 UINT64 MmioSpacePagesSize;
149 UINT64 MmioPortPages;
150 UINT64 MmioPortPagesSize;
151 UINT64 UnusableMemoryPages;
152 UINT64 UnusableMemoryPagesSize;
154 UINT64 PalCodePagesSize;
155 UINT64 UnacceptedPages;
156 UINT64 UnacceptedPagesSize;
157 UINT64 PersistentPages;
158 UINT64 PersistentPagesSize;
164 AcpiReclaimPages = 0;
177 UnusableMemoryPages = 0;
200 if (EFI_ERROR (Status)) {
201 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
213 Status =
gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
214 if (Status == EFI_BUFFER_TOO_SMALL) {
217 if (Descriptors ==
NULL) {
223 Status =
gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
226 if (EFI_ERROR (Status)) {
239 for ( Walker = Descriptors
244 switch (Walker->
Type) {
246 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiReservedMemoryType, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
250 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderCode, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
255 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderData, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
260 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiBootServicesCodeShort : NameEfiBootServicesCode, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
265 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiBootServicesDataShort : NameEfiBootServicesData, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
270 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiRuntimeServicesCodeShort : NameEfiRuntimeServicesCode, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
275 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiRuntimeServicesDataShort : NameEfiRuntimeServicesData, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
280 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiConventionalMemory, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
285 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPersistentMemory, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
290 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiUnusableMemoryShort : NameEfiUnusableMemory, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
294 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiACPIReclaimMemoryShort : NameEfiACPIReclaimMemory, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
299 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiACPIMemoryNVSShort : NameEfiACPIMemoryNVS, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
304 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiMemoryMappedIOShort : NameEfiMemoryMappedIO, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
308 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiMemoryMappedIOPortSpaceShort : NameEfiMemoryMappedIOPortSpace, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
312 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPalCode, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
317 ShellPrintHiiEx (-1, -1,
NULL, (EFI_STRING_ID)(!Sfo ?
STRING_TOKEN (STR_MEMMAP_LIST_ITEM) :
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiUnacceptedMemoryType, Walker->
PhysicalStart, Walker->
PhysicalStart+
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages)-1, Walker->
NumberOfPages, Walker->
Attribute);
327 ShellPrintHiiEx (-1, -1,
NULL,
STRING_TOKEN (STR_MEMMAP_LIST_ITEM_OTHER), gShellDebug1HiiHandle, Walker->
Type, Walker->
PhysicalStart, Walker->
PhysicalStart +
MultU64x64 (SIZE_4KB, Walker->
NumberOfPages) - 1, Walker->
NumberOfPages, Walker->
Attribute);
339 ReservedPagesSize =
MultU64x64 (SIZE_4KB, ReservedPages);
340 LoadCodePagesSize =
MultU64x64 (SIZE_4KB, LoadCodePages);
341 LoadDataPagesSize =
MultU64x64 (SIZE_4KB, LoadDataPages);
342 BSCodePagesSize =
MultU64x64 (SIZE_4KB, BSCodePages);
343 BSDataPagesSize =
MultU64x64 (SIZE_4KB, BSDataPages);
344 RTDataPagesSize =
MultU64x64 (SIZE_4KB, RTDataPages);
345 RTCodePagesSize =
MultU64x64 (SIZE_4KB, RTCodePages);
346 AvailPagesSize =
MultU64x64 (SIZE_4KB, AvailPages);
347 TotalPagesSize =
MultU64x64 (SIZE_4KB, TotalPages);
348 AcpiReclaimPagesSize =
MultU64x64 (SIZE_4KB, AcpiReclaimPages);
349 AcpiNvsPagesSize =
MultU64x64 (SIZE_4KB, AcpiNvsPages);
350 MmioSpacePagesSize =
MultU64x64 (SIZE_4KB, MmioSpacePages);
351 MmioPortPagesSize =
MultU64x64 (SIZE_4KB, MmioPortPages);
352 PalCodePagesSize =
MultU64x64 (SIZE_4KB, PalCodePages);
353 UnacceptedPagesSize =
MultU64x64 (SIZE_4KB, UnacceptedPages);
354 PersistentPagesSize =
MultU64x64 (SIZE_4KB, PersistentPages);
355 UnusableMemoryPagesSize =
MultU64x64 (SIZE_4KB, UnusableMemoryPages);
362 gShellDebug1HiiHandle,
378 AcpiReclaimPagesSize,
405 gShellDebug1HiiHandle,
407 Entry->NumberOfPages,
417 gShellDebug1HiiHandle,
427 gShellDebug1HiiHandle,
439 UnusableMemoryPagesSize,
440 AcpiReclaimPagesSize,
453 if (Descriptors !=
NULL) {
464 return (ShellStatus);
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
UINT64 EFIAPI MultU64x64(IN UINT64 Multiplicand, IN UINT64 Multiplier)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define BASE_CR(Record, TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
SHELL_STATUS EFIAPI ShellCommandRunMemMap(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID AddMemoryLength(LIST_ENTRY *List, UINT32 Type, UINT64 NumberOfPages)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI CommandInit(VOID)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
SHELL_PARAM_ITEM SfoParamList[]
Helper structure for -sfo only (besides -? and -b)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
@ EfiMemoryMappedIOPortSpace
@ EfiUnacceptedMemoryType
#define EFI_MEMORY_DESCRIPTOR_VERSION
EFI_PHYSICAL_ADDRESS PhysicalStart