Add a threading syscall API.

This commit is contained in:
Drew Galbraith 2023-06-06 16:24:03 -07:00
parent e2aad55a8a
commit ef8eb5d993
14 changed files with 235 additions and 30 deletions

View file

@ -0,0 +1,17 @@
#include "capability/capability.h"
template <>
Process& Capability::obj<Process>() {
if (type_ != PROCESS) {
panic("Accessing %u cap as object.", type_);
}
return *static_cast<Process*>(obj_);
}
template <>
Thread& Capability::obj<Thread>() {
if (type_ != THREAD) {
panic("Accessing %u cap as object.", type_);
}
return *static_cast<Thread*>(obj_);
}