[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.
This commit is contained in:
@@ -43,6 +43,7 @@ create_module(buffer data, const program_desc &desc, bool loaded)
|
|||||||
init::module_program *mod = g_alloc.allocate_module<init::module_program>(path_len);
|
init::module_program *mod = g_alloc.allocate_module<init::module_program>(path_len);
|
||||||
mod->mod_type = init::module_type::program;
|
mod->mod_type = init::module_type::program;
|
||||||
mod->base_address = reinterpret_cast<uintptr_t>(data.pointer);
|
mod->base_address = reinterpret_cast<uintptr_t>(data.pointer);
|
||||||
|
mod->size = data.count;
|
||||||
if (loaded)
|
if (loaded)
|
||||||
mod->mod_flags = static_cast<init::module_flags>(
|
mod->mod_flags = static_cast<init::module_flags>(
|
||||||
static_cast<uint8_t>(mod->mod_flags) |
|
static_cast<uint8_t>(mod->mod_flags) |
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ struct module_program :
|
|||||||
public module
|
public module
|
||||||
{
|
{
|
||||||
uintptr_t base_address;
|
uintptr_t base_address;
|
||||||
|
size_t size;
|
||||||
char filename[];
|
char filename[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user