mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-15 02:40:38 +00:00
Kernel: Move ShouldAllocateTls enum from Process to execve.cpp
This commit is contained in:
parent
9ca42c4c0e
commit
0d7af498d7
Notes:
sideshowbarker
2024-07-18 22:29:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0d7af498d7f
2 changed files with 7 additions and 7 deletions
Kernel
|
@ -390,11 +390,6 @@ public:
|
|||
|
||||
int exec(String path, Vector<String> arguments, Vector<String> environment, int recusion_depth = 0);
|
||||
|
||||
enum class ShouldAllocateTls {
|
||||
No = 0,
|
||||
Yes,
|
||||
};
|
||||
|
||||
KResultOr<LoadResult> load(NonnullRefPtr<FileDescription> main_program_description, RefPtr<FileDescription> interpreter_description, const Elf32_Ehdr& main_program_header);
|
||||
KResultOr<FlatPtr> get_interpreter_load_offset(const Elf32_Ehdr& main_program_header, FileDescription& main_program_description, FileDescription& interpreter_description);
|
||||
|
||||
|
|
|
@ -155,7 +155,12 @@ static KResultOr<FlatPtr> make_userspace_stack_for_main_thread(Region& region, V
|
|||
return new_esp;
|
||||
}
|
||||
|
||||
static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Space> new_space, FileDescription& object_description, FlatPtr load_offset, Process::ShouldAllocateTls should_allocate_tls)
|
||||
enum class ShouldAllocateTls {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Space> new_space, FileDescription& object_description, FlatPtr load_offset, ShouldAllocateTls should_allocate_tls)
|
||||
{
|
||||
auto& inode = *(object_description.inode());
|
||||
auto vmobject = SharedInodeVMObject::create_with_inode(inode);
|
||||
|
@ -190,7 +195,7 @@ static KResultOr<LoadResult> load_elf_object(NonnullOwnPtr<Space> new_space, Fil
|
|||
KResult ph_load_result = KSuccess;
|
||||
elf_image.for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) {
|
||||
if (program_header.type() == PT_TLS) {
|
||||
ASSERT(should_allocate_tls == Process::ShouldAllocateTls::Yes);
|
||||
ASSERT(should_allocate_tls == ShouldAllocateTls::Yes);
|
||||
ASSERT(program_header.size_in_memory());
|
||||
|
||||
if (!elf_image.is_within_image(program_header.raw_data(), program_header.size_in_image())) {
|
||||
|
|
Loading…
Reference in a new issue