mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[kernel] Make scheduler run queue's prev be an id, not a pointer
This would lead to errors in GDB's j6threads when the previous thread had already exited.
This commit is contained in:
@@ -237,11 +237,7 @@ class GetThreadsCommand(gdb.Command):
|
||||
self.print_cpudata(cpu)
|
||||
|
||||
previous = int(gdb.parse_and_eval(f"{runlist}.prev"))
|
||||
if previous != 0:
|
||||
tcb = f"((TCB*){previous:#x})"
|
||||
thread = f"({tcb}->thread)"
|
||||
koid = int(gdb.parse_and_eval(f"{thread}->m_obj_id"))
|
||||
print(f" prev: {koid:x}")
|
||||
print(f" prev: {previous:x}")
|
||||
print()
|
||||
|
||||
for pri in range(8):
|
||||
@@ -332,7 +328,12 @@ class DumpLogCommand(gdb.Command):
|
||||
end += self.base_addr
|
||||
while addr < end:
|
||||
entry = self.get_entry(addr)
|
||||
if entry.bytes < 8:
|
||||
print(f"Bad log header size: {entry.bytes}")
|
||||
break
|
||||
addr += entry.bytes
|
||||
area = "??"
|
||||
if entry.area < len(self.areas):
|
||||
area = self.areas[entry.area]
|
||||
level = self.level_names[entry.severity]
|
||||
print(f"{area:>7}:{level:7} {entry.message}")
|
||||
|
||||
@@ -28,7 +28,7 @@ scheduler *scheduler::s_instance = nullptr;
|
||||
struct run_queue
|
||||
{
|
||||
tcb_node *current = nullptr;
|
||||
tcb_node *prev = nullptr;
|
||||
uint64_t prev = 0;
|
||||
tcb_list ready[scheduler::num_priorities];
|
||||
tcb_list blocked;
|
||||
|
||||
@@ -310,7 +310,7 @@ scheduler::schedule()
|
||||
return;
|
||||
}
|
||||
|
||||
queue.prev = queue.current;
|
||||
queue.prev = queue.current->thread->obj_id();
|
||||
thread *next_thread = next->thread;
|
||||
|
||||
cpu.thread = next_thread;
|
||||
|
||||
Reference in New Issue
Block a user