diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-25 14:48:30 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-25 14:48:30 +0100 |
commit | 40e9edd79811c7cf23aafbf8b1a85db3355a3176 (patch) | |
tree | dae72747fbf14f7d400e099732a66f695296ee95 /Kernel | |
parent | 6c9a6bea1ec050d37280c32e3a8521f215a4d46e (diff) | |
download | serenity-40e9edd79811c7cf23aafbf8b1a85db3355a3176.zip |
LibELF: Move AuxiliaryValue into the ELF namespace
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.h | 2 | ||||
-rw-r--r-- | Kernel/Syscalls/execve.cpp | 34 | ||||
-rw-r--r-- | Kernel/Thread.cpp | 2 | ||||
-rw-r--r-- | Kernel/Thread.h | 2 |
4 files changed, 20 insertions, 20 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h index dd454358c1..dc3210ff6c 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -534,7 +534,7 @@ private: ssize_t do_write(FileDescription&, const UserOrKernelBuffer&, size_t); KResultOr<NonnullRefPtr<FileDescription>> find_elf_interpreter_for_executable(const String& path, char (&first_page)[PAGE_SIZE], int nread, size_t file_size); - Vector<AuxiliaryValue> generate_auxiliary_vector() const; + Vector<ELF::AuxiliaryValue> generate_auxiliary_vector() const; int alloc_fd(int first_candidate_fd = 0); void disown_all_shared_buffers(); diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index 991e325373..c4d8d36c92 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -424,41 +424,41 @@ int Process::do_exec(NonnullRefPtr<FileDescription> main_program_description, Ve return 0; } -Vector<AuxiliaryValue> Process::generate_auxiliary_vector() const +Vector<ELF::AuxiliaryValue> Process::generate_auxiliary_vector() const { - Vector<AuxiliaryValue> auxv; + Vector<ELF::AuxiliaryValue> auxv; // PHDR/EXECFD // PH* - auxv.append({ AuxiliaryValue::PageSize, PAGE_SIZE }); - auxv.append({ AuxiliaryValue::BaseAddress, (void*)m_load_base }); + auxv.append({ ELF::AuxiliaryValue::PageSize, PAGE_SIZE }); + auxv.append({ ELF::AuxiliaryValue::BaseAddress, (void*)m_load_base }); - auxv.append({ AuxiliaryValue::Entry, (void*)m_entry_eip }); + auxv.append({ ELF::AuxiliaryValue::Entry, (void*)m_entry_eip }); // NOTELF - auxv.append({ AuxiliaryValue::Uid, (long)m_uid }); - auxv.append({ AuxiliaryValue::EUid, (long)m_euid }); - auxv.append({ AuxiliaryValue::Gid, (long)m_gid }); - auxv.append({ AuxiliaryValue::EGid, (long)m_egid }); + auxv.append({ ELF::AuxiliaryValue::Uid, (long)m_uid }); + auxv.append({ ELF::AuxiliaryValue::EUid, (long)m_euid }); + auxv.append({ ELF::AuxiliaryValue::Gid, (long)m_gid }); + auxv.append({ ELF::AuxiliaryValue::EGid, (long)m_egid }); // FIXME: Don't hard code this? We might support other platforms later.. (e.g. x86_64) - auxv.append({ AuxiliaryValue::Platform, "i386" }); + auxv.append({ ELF::AuxiliaryValue::Platform, "i386" }); // FIXME: This is platform specific - auxv.append({ AuxiliaryValue::HwCap, (long)CPUID(1).edx() }); + auxv.append({ ELF::AuxiliaryValue::HwCap, (long)CPUID(1).edx() }); - auxv.append({ AuxiliaryValue::ClockTick, (long)TimeManagement::the().ticks_per_second() }); + auxv.append({ ELF::AuxiliaryValue::ClockTick, (long)TimeManagement::the().ticks_per_second() }); // FIXME: Also take into account things like extended filesystem permissions? That's what linux does... - auxv.append({ AuxiliaryValue::Secure, ((m_uid != m_euid) || (m_gid != m_egid)) ? 1 : 0 }); + auxv.append({ ELF::AuxiliaryValue::Secure, ((m_uid != m_euid) || (m_gid != m_egid)) ? 1 : 0 }); char random_bytes[16] {}; get_fast_random_bytes((u8*)random_bytes, sizeof(random_bytes)); - auxv.append({ AuxiliaryValue::Random, String(random_bytes, sizeof(random_bytes)) }); + auxv.append({ ELF::AuxiliaryValue::Random, String(random_bytes, sizeof(random_bytes)) }); - auxv.append({ AuxiliaryValue::ExecFilename, m_executable->absolute_path() }); + auxv.append({ ELF::AuxiliaryValue::ExecFilename, m_executable->absolute_path() }); - auxv.append({ AuxiliaryValue::ExecFileDescriptor, m_main_program_fd }); + auxv.append({ ELF::AuxiliaryValue::ExecFileDescriptor, m_main_program_fd }); - auxv.append({ AuxiliaryValue::Null, 0L }); + auxv.append({ ELF::AuxiliaryValue::Null, 0L }); return auxv; } diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 0e1a5be692..107698adcd 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -855,7 +855,7 @@ RegisterState& Thread::get_register_dump_from_stack() return *(RegisterState*)(kernel_stack_top() - sizeof(RegisterState)); } -KResultOr<u32> Thread::make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<AuxiliaryValue> auxiliary_values) +KResultOr<u32> Thread::make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<ELF::AuxiliaryValue> auxiliary_values) { auto* region = m_process->allocate_region(VirtualAddress(), default_userspace_stack_size, "Stack (Main thread)", PROT_READ | PROT_WRITE, false); if (!region) diff --git a/Kernel/Thread.h b/Kernel/Thread.h index 77c543872e..ff5c6488a1 100644 --- a/Kernel/Thread.h +++ b/Kernel/Thread.h @@ -975,7 +975,7 @@ public: void set_default_signal_dispositions(); bool push_value_on_stack(FlatPtr); - KResultOr<u32> make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<AuxiliaryValue>); + KResultOr<u32> make_userspace_stack_for_main_thread(Vector<String> arguments, Vector<String> environment, Vector<ELF::AuxiliaryValue>); KResult make_thread_specific_region(Badge<Process>); |