mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel/aarch64: Implement set_exec_state in ThreadRegisters
This sets up the correct ThreadRegisters state when a process is exec'ed, which happens when the first userspace application is executed. Also changes Processor.cpp to get the stack pointer from the ThreadRegisters.
This commit is contained in:
parent
8960662e57
commit
5781d58fe8
Notes:
sideshowbarker
2024-07-17 01:53:23 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/5781d58fe8 Pull-request: https://github.com/SerenityOS/serenity/pull/17249 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/supercomputer7
2 changed files with 5 additions and 5 deletions
|
@ -241,7 +241,7 @@ FlatPtr Processor::init_context(Thread& thread, bool leave_crit)
|
|||
// x30 is the Link Register for the aarch64 ABI, so this will return to exit_kernel_thread when main thread function returns.
|
||||
eretframe.x[30] = FlatPtr(&exit_kernel_thread);
|
||||
eretframe.elr_el1 = thread_regs.elr_el1;
|
||||
eretframe.sp_el0 = kernel_stack_top;
|
||||
eretframe.sp_el0 = thread_regs.sp_el0;
|
||||
eretframe.tpidr_el0 = 0; // FIXME: Correctly initialize this when aarch64 has support for thread local storage.
|
||||
eretframe.spsr_el1 = thread_regs.spsr_el1;
|
||||
|
||||
|
|
|
@ -39,10 +39,10 @@ struct ThreadRegisters {
|
|||
|
||||
void set_exec_state(FlatPtr entry_ip, FlatPtr userspace_sp, Memory::AddressSpace& space)
|
||||
{
|
||||
(void)entry_ip;
|
||||
(void)userspace_sp;
|
||||
(void)space;
|
||||
TODO_AARCH64();
|
||||
set_ip(entry_ip);
|
||||
set_sp(userspace_sp);
|
||||
ttbr0_el1 = space.page_directory().ttbr0();
|
||||
set_spsr_el1(false);
|
||||
}
|
||||
|
||||
void set_spsr_el1(bool is_kernel_process)
|
||||
|
|
Loading…
Reference in a new issue