mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Kernel: Fix debug message and kernel stack region names in thread setup
This commit is contained in:
parent
0cb89f5927
commit
0fdbe08637
Notes:
sideshowbarker
2024-07-19 10:44:15 +09:00
Author: https://github.com/deoxxa Commit: https://github.com/SerenityOS/serenity/commit/0fdbe086373 Pull-request: https://github.com/SerenityOS/serenity/pull/904 Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 3 deletions
|
@ -84,7 +84,7 @@ Thread::Thread(Process& process)
|
|||
m_tss.cr3 = m_process.page_directory().cr3();
|
||||
|
||||
if (m_process.is_ring0()) {
|
||||
m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d; Ring0)", m_tid), false, true);
|
||||
m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d)", m_tid), false, true);
|
||||
m_kernel_stack_region->set_stack(true);
|
||||
m_kernel_stack_base = m_kernel_stack_region->vaddr().get();
|
||||
m_kernel_stack_top = m_kernel_stack_region->vaddr().offset(default_kernel_stack_size).get() & 0xfffffff8u;
|
||||
|
@ -92,13 +92,13 @@ Thread::Thread(Process& process)
|
|||
kprintf("Allocated ring0 stack @ %p - %p\n", m_kernel_stack_base, m_kernel_stack_top);
|
||||
} else {
|
||||
// Ring3 processes need a separate stack for Ring0.
|
||||
m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d; Ring3)", m_tid), false, true);
|
||||
m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d)", m_tid), false, true);
|
||||
m_kernel_stack_region->set_stack(true);
|
||||
m_kernel_stack_base = m_kernel_stack_region->vaddr().get();
|
||||
m_kernel_stack_top = m_kernel_stack_region->vaddr().offset(default_kernel_stack_size).get() & 0xfffffff8u;
|
||||
m_tss.ss0 = 0x10;
|
||||
m_tss.esp0 = m_kernel_stack_top;
|
||||
kprintf("Allocated ring3 stack @ %p - %p\n", m_kernel_stack_base, m_kernel_stack_top);
|
||||
kprintf("Allocated ring0 stack @ %p - %p\n", m_kernel_stack_base, m_kernel_stack_top);
|
||||
}
|
||||
m_process.page_directory().update_kernel_mappings();
|
||||
|
||||
|
|
Loading…
Reference in a new issue