mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
Kernel: Introduce threads, and refactor everything in support of it.
The scheduler now operates on threads, rather than on processes. Each process has a main thread, and can have any number of additional threads. The process exits when the main thread exits. This patch doesn't actually spawn any additional threads, it merely does all the plumbing needed to make it possible. :^)
This commit is contained in:
parent
b0de6aa8d8
commit
60d25f0f4a
Notes:
sideshowbarker
2024-07-19 14:57:58 +09:00
Author: https://github.com/awesomekling
Commit: 60d25f0f4a
32 changed files with 1356 additions and 1098 deletions
|
@ -74,7 +74,7 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
[[gnu::noinline]] void dump_backtrace_impl(dword ebp, bool use_ksyms)
|
||||
{
|
||||
if (!current) {
|
||||
hang();
|
||||
//hang();
|
||||
return;
|
||||
}
|
||||
if (use_ksyms && !ksyms_ready) {
|
||||
|
@ -87,13 +87,13 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
};
|
||||
Vector<RecognizedSymbol> recognized_symbols;
|
||||
if (use_ksyms) {
|
||||
for (dword* stack_ptr = (dword*)ebp; current->validate_read_from_kernel(LinearAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
|
||||
for (dword* stack_ptr = (dword*)ebp; current->process().validate_read_from_kernel(LinearAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
|
||||
dword retaddr = stack_ptr[1];
|
||||
if (auto* ksym = ksymbolicate(retaddr))
|
||||
recognized_symbols.append({ retaddr, ksym });
|
||||
}
|
||||
} else{
|
||||
for (dword* stack_ptr = (dword*)ebp; current->validate_read_from_kernel(LinearAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
|
||||
for (dword* stack_ptr = (dword*)ebp; current->process().validate_read_from_kernel(LinearAddress((dword)stack_ptr)); stack_ptr = (dword*)*stack_ptr) {
|
||||
dword retaddr = stack_ptr[1];
|
||||
kprintf("%x (next: %x)\n", retaddr, stack_ptr ? (dword*)*stack_ptr : 0);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ void load_ksyms()
|
|||
auto result = VFS::the().open("/kernel.map", 0, 0, *VFS::the().root_inode());
|
||||
ASSERT(!result.is_error());
|
||||
auto descriptor = result.value();
|
||||
auto buffer = descriptor->read_entire_file(*current);
|
||||
auto buffer = descriptor->read_entire_file(current->process());
|
||||
ASSERT(buffer);
|
||||
load_ksyms_from_data(buffer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue