[kernel] Store object ids instead of full koids

In preparation for futexes, I wanted to make kobjects a bit lighter.
Storing 32 bits of object id, and 8 bits of type (and not ending the
class in a ushort for handle count, which meant all kobjects were likely
to have a bunch of pad bytes), the kobject class data is now just one 8
byte word.

Also from this, change logs that mention threads or processes from
printing the full koid to just 2 bytes of object id from both process
and thread, which makes following the logs much easier.
This commit is contained in:
Justin C. Miller
2022-10-20 22:41:16 -07:00
parent 6583744532
commit 372bc1d2e6
5 changed files with 44 additions and 37 deletions

View File

@@ -24,7 +24,7 @@ j6_status_t
log(const char *message)
{
thread &th = thread::current();
log::info(logs::syscall, "Message[%llx]: %s", th.koid(), message);
log::info(logs::syscall, "Message <%02lx:%02lx>: %s", th.parent().obj_id(), th.obj_id(), message);
return j6_status_ok;
}
@@ -32,7 +32,7 @@ j6_status_t
noop()
{
thread &th = thread::current();
log::verbose(logs::syscall, "Thread %llx called noop syscall.", th.koid());
log::verbose(logs::syscall, "Thread <%02lx:%02lx> called noop syscall.", th.parent().obj_id(), th.koid());
return j6_status_ok;
}