1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-26 07:55:01 +00:00

Switch the EFI virtual address to a uint64_t

It is defined as a uint64_t in the UEFI spec. As it's not used as a
pointer by the kernel follow this and define it as the same in the
kernel.

Reviewed by:	kib, manu, imp
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D29759
This commit is contained in:
Andrew Turner 2021-04-14 08:22:06 +00:00
parent 2abd4f8581
commit c78ad207ba
7 changed files with 8 additions and 8 deletions

View File

@ -204,7 +204,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
descsz)) { descsz)) {
if ((p->md_attr & EFI_MD_ATTR_RT) == 0) if ((p->md_attr & EFI_MD_ATTR_RT) == 0)
continue; continue;
if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { if (p->md_virt != 0 && p->md_virt != p->md_phys) {
if (bootverbose) if (bootverbose)
printf("EFI Runtime entry %d is mapped\n", i); printf("EFI Runtime entry %d is mapped\n", i);
goto fail; goto fail;

View File

@ -1107,7 +1107,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
type = types[p->md_type]; type = types[p->md_type];
else else
type = "<INVALID>"; type = "<INVALID>";
printf("%23s %012lx %12p %08lx ", type, p->md_phys, printf("%23s %012lx %012lx %08lx ", type, p->md_phys,
p->md_virt, p->md_pages); p->md_virt, p->md_pages);
if (p->md_attr & EFI_MD_ATTR_UC) if (p->md_attr & EFI_MD_ATTR_UC)
printf("UC "); printf("UC ");

View File

@ -442,7 +442,7 @@ arm_add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
type = types[p->md_type]; type = types[p->md_type];
else else
type = "<INVALID>"; type = "<INVALID>";
printf("%23s %012llx %12p %08llx ", type, p->md_phys, printf("%23s %012llx %012llx %08llx ", type, p->md_phys,
p->md_virt, p->md_pages); p->md_virt, p->md_pages);
if (p->md_attr & EFI_MD_ATTR_UC) if (p->md_attr & EFI_MD_ATTR_UC)
printf("UC "); printf("UC ");

View File

@ -184,7 +184,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz)
descsz)) { descsz)) {
if ((p->md_attr & EFI_MD_ATTR_RT) == 0) if ((p->md_attr & EFI_MD_ATTR_RT) == 0)
continue; continue;
if (p->md_virt != NULL && (uint64_t)p->md_virt != p->md_phys) { if (p->md_virt != 0 && p->md_virt != p->md_phys) {
if (bootverbose) if (bootverbose)
printf("EFI Runtime entry %d is mapped\n", i); printf("EFI Runtime entry %d is mapped\n", i);
goto fail; goto fail;

View File

@ -1046,7 +1046,7 @@ print_efi_map_entry(struct efi_md *p)
type = types[p->md_type]; type = types[p->md_type];
else else
type = "<INVALID>"; type = "<INVALID>";
printf("%23s %012lx %12p %08lx ", type, p->md_phys, printf("%23s %012lx %012lx %08lx ", type, p->md_phys,
p->md_virt, p->md_pages); p->md_virt, p->md_pages);
if (p->md_attr & EFI_MD_ATTR_UC) if (p->md_attr & EFI_MD_ATTR_UC)
printf("UC "); printf("UC ");

View File

@ -126,8 +126,8 @@ efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr)
if ((p->md_attr & EFI_MD_ATTR_RT) == 0) if ((p->md_attr & EFI_MD_ATTR_RT) == 0)
continue; continue;
if (addr >= (uintptr_t)p->md_virt && if (addr >= p->md_virt &&
addr < (uintptr_t)p->md_virt + p->md_pages * PAGE_SIZE) addr < p->md_virt + p->md_pages * PAGE_SIZE)
return (true); return (true);
} }

View File

@ -74,7 +74,7 @@ struct efi_md {
#define EFI_MD_TYPE_PERSISTENT 14 /* Persistent memory. */ #define EFI_MD_TYPE_PERSISTENT 14 /* Persistent memory. */
uint32_t __pad; uint32_t __pad;
uint64_t md_phys; uint64_t md_phys;
void *md_virt; uint64_t md_virt;
uint64_t md_pages; uint64_t md_pages;
uint64_t md_attr; uint64_t md_attr;
#define EFI_MD_ATTR_UC 0x0000000000000001UL #define EFI_MD_ATTR_UC 0x0000000000000001UL