mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[kernel] Use map for process handles
Replace linearly-indexed vector of handles with new kutil::map. Also provide thread::current() and process::current() accessors so that every syscall doesn't need to include the scheduler to deduce the current process.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "j6/signals.h"
|
||||
#include "cpu.h"
|
||||
#include "log.h"
|
||||
#include "objects/thread.h"
|
||||
#include "objects/process.h"
|
||||
@@ -40,6 +41,12 @@ thread::from_tcb(TCB *tcb)
|
||||
return reinterpret_cast<thread*>(kutil::offset_pointer(tcb, offset));
|
||||
}
|
||||
|
||||
thread &
|
||||
thread::current()
|
||||
{
|
||||
return *bsp_cpu_data.t;
|
||||
}
|
||||
|
||||
void
|
||||
thread::wait_on_signals(kobject *obj, j6_signal_t signals)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user