Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Apr 2022 11:06:00 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 4366c226436b - stable/13 - Fix the spelling of EFI_PAGE_SIZE
Message-ID:  <202204041106.234B603h086493@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=4366c226436b0863c62b1dbcf8171479269b4d85

commit 4366c226436b0863c62b1dbcf8171479269b4d85
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-03-09 12:59:01 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-04-04 09:37:06 +0000

    Fix the spelling of EFI_PAGE_SIZE
    
    We assume EFI_PAGE_SIZE is the same as PAGE_SIZE, however this may not
    be the case. Use the former when working with a list of pages from the
    UEFI firmware so the correct size is used.
    
    This will be needed on arm64 where PAGE_SIZE could be 16k or 64k in the
    future. The other architectures have been updated to be consistent.
    
    Reviewed by:    imp
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D34510
    
    (cherry picked from commit 9cf15aefb9d6f97687ae4a497917be36ac125558)
---
 sys/amd64/amd64/machdep.c  | 2 +-
 sys/arm/arm/machdep_boot.c | 2 +-
 sys/arm64/arm64/machdep.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 8fb65917f700..8a1da968cf02 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -822,7 +822,7 @@ add_efi_map_entries(struct efi_map_header *efihdr, vm_paddr_t *physmap,
 			continue;
 		}
 
-		if (!add_physmap_entry(p->md_phys, (p->md_pages * PAGE_SIZE),
+		if (!add_physmap_entry(p->md_phys, p->md_pages * EFI_PAGE_SIZE,
 		    physmap, physmap_idx))
 			break;
 	}
diff --git a/sys/arm/arm/machdep_boot.c b/sys/arm/arm/machdep_boot.c
index b13cf2ef23ea..88314935b82e 100644
--- a/sys/arm/arm/machdep_boot.c
+++ b/sys/arm/arm/machdep_boot.c
@@ -490,7 +490,7 @@ arm_add_efi_map_entries(struct efi_map_header *efihdr, struct mem_region *mr,
 			break;
 
 		mr[j].mr_start = p->md_phys;
-		mr[j].mr_size = p->md_pages * PAGE_SIZE;
+		mr[j].mr_size = p->md_pages * EFI_PAGE_SIZE;
 		memory_size += mr[j].mr_size;
 	}
 
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index c3d725800fde..c4a2c48ff8ba 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -468,7 +468,7 @@ exclude_efi_map_entry(struct efi_md *p)
 		 */
 		break;
 	default:
-		physmem_exclude_region(p->md_phys, p->md_pages * PAGE_SIZE,
+		physmem_exclude_region(p->md_phys, p->md_pages * EFI_PAGE_SIZE,
 		    EXFLAG_NOALLOC);
 	}
 }
@@ -500,7 +500,7 @@ add_efi_map_entry(struct efi_md *p)
 		 * We're allowed to use any entry with these types.
 		 */
 		physmem_hardware_region(p->md_phys,
-		    p->md_pages * PAGE_SIZE);
+		    p->md_pages * EFI_PAGE_SIZE);
 		break;
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202204041106.234B603h086493>