[PATCH 09/16] bootm: stash initial OS address/entry in image_data

Ahmad Fatoum
2026-03-12T14:46:03Z

Save the initial os_address and os_entry values that were passed to
bootm_boot() in new os_address_hint and os_entry_hint fields. These
preserve the originally requested values even if os_address/os_entry
are modified during the boot process.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
common/bootm.c | 4 ++--
include/bootm.h | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/common/bootm.c b/common/bootm.c
index 01d569dd37d4..25cbce6ccb3f 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -530,8 +530,8 @@ struct image_data *bootm_boot_prep(const struct bootm_data *bootm_data)
data->force = bootm_data->force;
data->dryrun = bootm_data->dryrun;
data->initrd_address = bootm_data->initrd_address;
- data->os_address = bootm_data->os_address;
- data->os_entry = bootm_data->os_entry;
+ data->os_address = data->os_address_hint = bootm_data->os_address;
+ data->os_entry = data->os_entry_hint = bootm_data->os_entry;
data->efi_boot = bootm_data->efi_boot;

ret = file_read_and_detect_boot_image_type(data->os_file, &data->os_header);
diff --git a/include/bootm.h b/include/bootm.h
index d3874a0e8ef2..570ac4d289f2 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -86,6 +86,10 @@ struct image_data {
/* entry point to the os. relative to the start of the image */
unsigned long os_entry;

+ /* initial os_address/os_entry supplied at entry to bootm_boot */
+ unsigned long os_address_hint;
+ unsigned long os_entry_hint;
+
/* if initrd is already loaded this resource will be !NULL */
struct resource *initrd_res;

--
2.47.3