Kernel: Rework kernel-side ELF loading
ELFs are now loaded as MemoryRegions so they don't need special handling anywhere. This also allows file backed COW optimizations to work. This was not the case before. This patch removes now obsolete LoadableELF and unused ELF files from LibElf.
This commit is contained in:
18
kernel/include/kernel/ELF.h
Normal file
18
kernel/include/kernel/ELF.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/FS/Inode.h>
|
||||
#include <kernel/Memory/MemoryRegion.h>
|
||||
|
||||
namespace Kernel::ELF
|
||||
{
|
||||
|
||||
struct LoadResult
|
||||
{
|
||||
bool has_interpreter;
|
||||
vaddr_t entry_point;
|
||||
BAN::Vector<BAN::UniqPtr<MemoryRegion>> regions;
|
||||
};
|
||||
|
||||
BAN::ErrorOr<LoadResult> load_from_inode(BAN::RefPtr<Inode>, const Credentials&, PageTable&);
|
||||
|
||||
}
|
||||
@@ -22,8 +22,6 @@
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
|
||||
namespace LibELF { class LoadableELF; }
|
||||
|
||||
namespace Kernel
|
||||
{
|
||||
|
||||
@@ -269,7 +267,6 @@ namespace Kernel
|
||||
|
||||
OpenFileDescriptorSet m_open_file_descriptors;
|
||||
|
||||
BAN::UniqPtr<LibELF::LoadableELF> m_loadable_elf;
|
||||
BAN::Vector<BAN::UniqPtr<MemoryRegion>> m_mapped_regions;
|
||||
|
||||
pid_t m_sid;
|
||||
|
||||
Reference in New Issue
Block a user