#pragma once #include "ELF.h" #include "arch/CPU.h" #include "arch/MMU.h" #include "fs/VFS.h" #include "memory/UserVM.h" #include "thread/Thread.h" #include #include #include #include #include class Thread; class ThreadImage { public: static Result> try_load_from_elf(SharedPtr inode); static Result> clone_from_thread(Thread* parent); Result push_mem_on_stack(const u8* mem, usize size); Result push_string_vector_on_stack(const Vector& vec); void apply(Thread* thread); private: OwnedPtr m_vm_allocator; PageDirectory* m_directory { nullptr }; Stack m_user_stack; Stack m_kernel_stack; ELFData m_loaded_image_data; u64 m_sp; };