[kernel] Consolodate koid and close syscalls

A number of object types had _close or _koid syscalls. Moved those to be
generic for kobject.
This commit is contained in:
2020-10-05 21:51:42 -07:00
parent 1904e240cf
commit 97ea77bd27
18 changed files with 79 additions and 94 deletions

View File

@@ -3,6 +3,7 @@
/// Utility functions for use in syscall handler implementations
#include "j6/types.h"
#include "objects/kobject.h"
#include "objects/process.h"
namespace syscalls {
@@ -26,6 +27,13 @@ T * get_handle(j6_handle_t handle)
return static_cast<T*>(o);
}
template <>
inline kobject * get_handle<kobject>(j6_handle_t handle)
{
process &p = process::current();
return p.lookup_handle(handle);
}
template <typename T>
T * remove_handle(j6_handle_t handle)
{