diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-24 22:37:20 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-24 22:37:20 +0100 |
| commit | ea8d5390ebe2f1917d07f4eed416661ade96c953 (patch) | |
| tree | b53236e7f42e3955b607b0ff0b43ddf830901ef5 /kernel/initrd.c | |
| parent | 192208770d3866838a450462dd4b1fc8e2b5c91a (diff) | |
| download | fbos-ea8d5390ebe2f1917d07f4eed416661ade96c953.tar.gz fbos-ea8d5390ebe2f1917d07f4eed416661ade96c953.zip | |
Simplify the entry address computation
We actually don't need to preserve the initially computed base address
for each binary, but we can just preserve the final entry address.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel/initrd.c')
| -rw-r--r-- | kernel/initrd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/initrd.c b/kernel/initrd.c index ff1f52b..27d0ece 100644 --- a/kernel/initrd.c +++ b/kernel/initrd.c @@ -101,8 +101,9 @@ __kernel void extract_elf(int task_id, const unsigned char *const addr, size_t s /* }; */ #ifdef __KERNEL__ - tasks[task_id].addr = (const void *)addr; - tasks[task_id].entry_offset = (uint64_t)addr[0x18]; + uint64_t offset = (uint64_t)addr[0x18]; + + tasks[task_id].entry_addr = (const void *)(addr + offset); #endif } |
