mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user