/* lsefimemmap.c - Display memory map. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
GRUB_MOD_LICENSE ("GPLv3+");
static grub_err_t
{
map_size = 0;
return 0;
if (memory_map == NULL)
return grub_errno;
goto fail;
("Type Physical start - end #Pages "
" Size Attributes\n");
for (desc = memory_map;
{
{
"reserved",
"ldr-code",
"ldr-data",
"BS-code ",
"BS-data ",
"RT-code ",
"RT-data ",
"conv-mem",
"unusable",
"ACPI-rec",
"ACPI-nvs",
"MMIO ",
"IO-ports",
"PAL-code"
};
else
" %08" PRIxGRUB_UINT64_T,
if (size < 1024)
else
{
size /= 1024;
if (size < 1024)
else
{
size /= 1024;
}
}
if (attr & GRUB_EFI_MEMORY_RUNTIME)
grub_printf (" RT");
if (attr & GRUB_EFI_MEMORY_UC)
grub_printf (" UC");
if (attr & GRUB_EFI_MEMORY_WC)
grub_printf (" WC");
if (attr & GRUB_EFI_MEMORY_WT)
grub_printf (" WT");
if (attr & GRUB_EFI_MEMORY_WB)
grub_printf (" WB");
if (attr & GRUB_EFI_MEMORY_UCE)
grub_printf (" UCE");
if (attr & GRUB_EFI_MEMORY_WP)
grub_printf (" WP");
if (attr & GRUB_EFI_MEMORY_RP)
grub_printf (" RP");
if (attr & GRUB_EFI_MEMORY_XP)
grub_printf (" XP");
grub_printf ("\n");
}
fail:
return 0;
}
{
"", "Display EFI memory map.");
}
{
}