From c536da7279563ea81d7e51a1e9853fe8ae70bc46 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Thu, 23 Dec 2021 16:51:13 -0800 Subject: [PATCH] [boot] Save size of program in its module Init will eventually want to know the full size of the program the bootloader passed it, so save this off in the module_program struct. --- src/boot/loader.cpp | 1 + src/include/init_args.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/boot/loader.cpp b/src/boot/loader.cpp index 7c773c7..7a5df50 100644 --- a/src/boot/loader.cpp +++ b/src/boot/loader.cpp @@ -43,6 +43,7 @@ create_module(buffer data, const program_desc &desc, bool loaded) init::module_program *mod = g_alloc.allocate_module(path_len); mod->mod_type = init::module_type::program; mod->base_address = reinterpret_cast(data.pointer); + mod->size = data.count; if (loaded) mod->mod_flags = static_cast( static_cast(mod->mod_flags) | diff --git a/src/include/init_args.h b/src/include/init_args.h index acd10f5..fe6ffd4 100644 --- a/src/include/init_args.h +++ b/src/include/init_args.h @@ -34,6 +34,7 @@ struct module_program : public module { uintptr_t base_address; + size_t size; char filename[]; };