mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
Kernel: Move ShouldAllocateTls enum from Process to execve.cpp
This commit is contained in:
parent
9ca42c4c0e
commit
0d7af498d7
2 changed files with 7 additions and 7 deletions
|
@ -390,11 +390,6 @@ public:
|
||||||
|
|
||||||
int exec(String path, Vector<String> arguments, Vector<String> environment, int recusion_depth = 0);
|
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<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);
|
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;
|
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& inode = *(object_description.inode());
|
||||||
auto vmobject = SharedInodeVMObject::create_with_inode(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;
|
KResult ph_load_result = KSuccess;
|
||||||
elf_image.for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) {
|
elf_image.for_each_program_header([&](const ELF::Image::ProgramHeader& program_header) {
|
||||||
if (program_header.type() == PT_TLS) {
|
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());
|
ASSERT(program_header.size_in_memory());
|
||||||
|
|
||||||
if (!elf_image.is_within_image(program_header.raw_data(), program_header.size_in_image())) {
|
if (!elf_image.is_within_image(program_header.raw_data(), program_header.size_in_image())) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue