Date: Thu, 23 Jul 2026 10:00:28 +0000 From: Olivier Certner <olce@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: fbe6a98490f9 - stable/14 - amd64: parse_memmap(): Move comment about size at proper place Message-ID: <6a61e63c.3cab5.6bf33b7d@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=fbe6a98490f9ef58cdb13f8cabc3177f9757842d commit fbe6a98490f9ef58cdb13f8cabc3177f9757842d Author: Olivier Certner <olce@FreeBSD.org> AuthorDate: 2026-01-30 17:33:12 +0000 Commit: Olivier Certner <olce@FreeBSD.org> CommitDate: 2026-07-23 09:59:00 +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 e4761a2e8579..66b36ee7ca12 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -819,15 +819,6 @@ native_parse_memmap(caddr_t kmdp, 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(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP); @@ -840,7 +831,15 @@ native_parse_memmap(caddr_t kmdp, 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)); }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a61e63c.3cab5.6bf33b7d>
