29 lines
574 B
C
29 lines
574 B
C
|
#pragma once
|
||
|
|
||
|
#include "ELF.h"
|
||
|
#include "arch/CPU.h"
|
||
|
#include "arch/MMU.h"
|
||
|
#include "fs/VFS.h"
|
||
|
#include "memory/UserVM.h"
|
||
|
#include <luna/LinkedList.h>
|
||
|
#include <luna/OwnedPtr.h>
|
||
|
#include <luna/Result.h>
|
||
|
#include <luna/Stack.h>
|
||
|
|
||
|
class Thread;
|
||
|
|
||
|
class ThreadImage
|
||
|
{
|
||
|
public:
|
||
|
static Result<OwnedPtr<ThreadImage>> try_load_from_elf(SharedPtr<VFS::Inode> inode);
|
||
|
|
||
|
void apply(Thread* thread);
|
||
|
|
||
|
private:
|
||
|
OwnedPtr<UserVM> m_vm_allocator;
|
||
|
PageDirectory* m_directory { nullptr };
|
||
|
Stack m_user_stack;
|
||
|
Stack m_kernel_stack;
|
||
|
ELFData m_loaded_image_data;
|
||
|
};
|