aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Certner <olce@FreeBSD.org>2026-01-30 17:33:12 +0000
committerOlivier Certner <olce@FreeBSD.org>2026-02-03 17:19:00 +0000
commit53bb02015fce72c79498842b898faefc2da3b0fb (patch)
treee897c9fe6a1f86a9f0a24ea4ef4778072e07005a
parent64f7e3c9c178ab35cb1f8fdf791aec74ede6f6b2 (diff)
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
-rw-r--r--sys/amd64/amd64/machdep.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index e56de986ccba..ae5df475f046 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -827,15 +827,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);
@@ -848,7 +839,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));
}