The branch stable/15 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=6bc5a7cd9c4e6b54c6329b9358874d5276cadf41
commit 6bc5a7cd9c4e6b54c6329b9358874d5276cadf41 Author: Olivier Certner <[email protected]> AuthorDate: 2026-01-30 17:33:12 +0000 Commit: Olivier Certner <[email protected]> CommitDate: 2026-02-19 12:28:51 +0000 amd64: parse_memmap(): Move comment about size at proper place While here, declare 'size' only in the relevant block. No functional change (intended). MFC after: 1 week Sponsored by: The FreeBSD Foundation (cherry picked from commit 53bb02015fce72c79498842b898faefc2da3b0fb) --- sys/amd64/amd64/machdep.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 20d221279bd3..2af7f1151208 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -828,15 +828,6 @@ native_parse_memmap(vm_paddr_t *physmap, int *physmap_idx) { struct bios_smap *smap; struct efi_map_header *efihdr; - u_int32_t size; - - /* - * Memory map from INT 15:E820. - * - * subr_module.c says: - * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. - */ efihdr = (struct efi_map_header *)preload_search_info(preload_kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); @@ -849,7 +840,15 @@ native_parse_memmap(vm_paddr_t *physmap, int *physmap_idx) add_efi_map_entries(efihdr, physmap, physmap_idx); strlcpy(bootmethod, "UEFI", sizeof(bootmethod)); } else { - size = *((u_int32_t *)smap - 1); + /* + * Memory map from INT 15:E820. + * + * subr_module.c says: + * "Consumer may safely assume that size value precedes data." + * ie: an int32_t immediately precedes smap. + */ + u_int32_t size = *((u_int32_t *)smap - 1); + bios_add_smap_entries(smap, size, physmap, physmap_idx); strlcpy(bootmethod, "BIOS", sizeof(bootmethod)); }
