[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)
|
self.print_cpudata(cpu)
|
||||||
|
|
||||||
previous = int(gdb.parse_and_eval(f"{runlist}.prev"))
|
previous = int(gdb.parse_and_eval(f"{runlist}.prev"))
|
||||||
if previous != 0:
|
print(f" prev: {previous:x}")
|
||||||
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()
|
print()
|
||||||
|
|
||||||
for pri in range(8):
|
for pri in range(8):
|
||||||
@@ -332,8 +328,13 @@ class DumpLogCommand(gdb.Command):
|
|||||||
end += self.base_addr
|
end += self.base_addr
|
||||||
while addr < end:
|
while addr < end:
|
||||||
entry = self.get_entry(addr)
|
entry = self.get_entry(addr)
|
||||||
|
if entry.bytes < 8:
|
||||||
|
print(f"Bad log header size: {entry.bytes}")
|
||||||
|
break
|
||||||
addr += entry.bytes
|
addr += entry.bytes
|
||||||
area = self.areas[entry.area]
|
area = "??"
|
||||||
|
if entry.area < len(self.areas):
|
||||||
|
area = self.areas[entry.area]
|
||||||
level = self.level_names[entry.severity]
|
level = self.level_names[entry.severity]
|
||||||
print(f"{area:>7}:{level:7} {entry.message}")
|
print(f"{area:>7}:{level:7} {entry.message}")
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ scheduler *scheduler::s_instance = nullptr;
|
|||||||
struct run_queue
|
struct run_queue
|
||||||
{
|
{
|
||||||
tcb_node *current = nullptr;
|
tcb_node *current = nullptr;
|
||||||
tcb_node *prev = nullptr;
|
uint64_t prev = 0;
|
||||||
tcb_list ready[scheduler::num_priorities];
|
tcb_list ready[scheduler::num_priorities];
|
||||||
tcb_list blocked;
|
tcb_list blocked;
|
||||||
|
|
||||||
@@ -310,7 +310,7 @@ scheduler::schedule()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
queue.prev = queue.current;
|
queue.prev = queue.current->thread->obj_id();
|
||||||
thread *next_thread = next->thread;
|
thread *next_thread = next->thread;
|
||||||
|
|
||||||
cpu.thread = next_thread;
|
cpu.thread = next_thread;
|
||||||
|
|||||||
Reference in New Issue
Block a user