Add more UEFI/e820 memory types from latest specifications.

This is only cosmetics.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2016-07-24 09:15:11 +00:00
parent 07ef31f240
commit fb112f72a8
6 changed files with 38 additions and 6 deletions

View File

@ -1090,7 +1090,8 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
"ACPIMemoryNVS",
"MemoryMappedIO",
"MemoryMappedIOPortSpace",
"PalCode"
"PalCode",
"PersistentMemory"
};
/*
@ -1111,7 +1112,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
for (i = 0, p = map; i < ndesc; i++,
p = efi_next_descriptor(p, efihdr->descriptor_size)) {
if (boothowto & RB_VERBOSE) {
if (p->md_type <= EFI_MD_TYPE_PALCODE)
if (p->md_type < nitems(types))
type = types[p->md_type];
else
type = "<INVALID>";
@ -1133,6 +1134,12 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
printf("RP ");
if (p->md_attr & EFI_MD_ATTR_XP)
printf("XP ");
if (p->md_attr & EFI_MD_ATTR_NV)
printf("NV ");
if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
printf("MORE_RELIABLE ");
if (p->md_attr & EFI_MD_ATTR_RO)
printf("RO ");
if (p->md_attr & EFI_MD_ATTR_RT)
printf("RUNTIME");
printf("\n");

View File

@ -40,6 +40,9 @@
#define SMAP_TYPE_ACPI_RECLAIM 3
#define SMAP_TYPE_ACPI_NVS 4
#define SMAP_TYPE_ACPI_ERROR 5
#define SMAP_TYPE_DISABLED 6
#define SMAP_TYPE_PMEM 7
#define SMAP_TYPE_PRAM 12
#define SMAP_XATTR_ENABLED 0x00000001
#define SMAP_XATTR_NON_VOLATILE 0x00000002

View File

@ -1424,7 +1424,8 @@ add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
"ACPIMemoryNVS",
"MemoryMappedIO",
"MemoryMappedIOPortSpace",
"PalCode"
"PalCode",
"PersistentMemory"
};
*mrcnt = 0;
@ -1448,7 +1449,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
for (i = 0, j = 0, p = map; i < ndesc; i++,
p = efi_next_descriptor(p, efihdr->descriptor_size)) {
if (boothowto & RB_VERBOSE) {
if (p->md_type <= EFI_MD_TYPE_PALCODE)
if (p->md_type < nitems(types))
type = types[p->md_type];
else
type = "<INVALID>";
@ -1470,6 +1471,12 @@ add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
printf("RP ");
if (p->md_attr & EFI_MD_ATTR_XP)
printf("XP ");
if (p->md_attr & EFI_MD_ATTR_NV)
printf("NV ");
if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
printf("MORE_RELIABLE ");
if (p->md_attr & EFI_MD_ATTR_RO)
printf("RO ");
if (p->md_attr & EFI_MD_ATTR_RT)
printf("RUNTIME");
printf("\n");

View File

@ -707,7 +707,8 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
"ACPIMemoryNVS",
"MemoryMappedIO",
"MemoryMappedIOPortSpace",
"PalCode"
"PalCode",
"PersistentMemory"
};
/*
@ -728,7 +729,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
for (i = 0, p = map; i < ndesc; i++,
p = efi_next_descriptor(p, efihdr->descriptor_size)) {
if (boothowto & RB_VERBOSE) {
if (p->md_type <= EFI_MD_TYPE_PALCODE)
if (p->md_type < nitems(types))
type = types[p->md_type];
else
type = "<INVALID>";
@ -750,6 +751,12 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
printf("RP ");
if (p->md_attr & EFI_MD_ATTR_XP)
printf("XP ");
if (p->md_attr & EFI_MD_ATTR_NV)
printf("NV ");
if (p->md_attr & EFI_MD_ATTR_MORE_RELIABLE)
printf("MORE_RELIABLE ");
if (p->md_attr & EFI_MD_ATTR_RO)
printf("RO ");
if (p->md_attr & EFI_MD_ATTR_RT)
printf("RUNTIME");
printf("\n");

View File

@ -210,6 +210,9 @@ struct PIR_table
#define SMAP_TYPE_ACPI_RECLAIM 3
#define SMAP_TYPE_ACPI_NVS 4
#define SMAP_TYPE_ACPI_ERROR 5
#define SMAP_TYPE_DISABLED 6
#define SMAP_TYPE_PMEM 7
#define SMAP_TYPE_PRAM 12
#define SMAP_XATTR_ENABLED 0x00000001
#define SMAP_XATTR_NON_VOLATILE 0x00000002

View File

@ -69,6 +69,7 @@ struct efi_md {
#define EFI_MD_TYPE_IOMEM 11 /* Memory-mapped I/O. */
#define EFI_MD_TYPE_IOPORT 12 /* I/O port space. */
#define EFI_MD_TYPE_PALCODE 13 /* PAL */
#define EFI_MD_TYPE_PERSISTENT 14 /* Persistent memory. */
uint32_t __pad;
uint64_t md_phys;
void *md_virt;
@ -82,6 +83,10 @@ struct efi_md {
#define EFI_MD_ATTR_WP 0x0000000000001000UL
#define EFI_MD_ATTR_RP 0x0000000000002000UL
#define EFI_MD_ATTR_XP 0x0000000000004000UL
#define EFI_MD_ATTR_NV 0x0000000000008000UL
#define EFI_MD_ATTR_MORE_RELIABLE \
0x0000000000010000UL
#define EFI_MD_ATTR_RO 0x0000000000020000UL
#define EFI_MD_ATTR_RT 0x8000000000000000UL
};