[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 @@
/// Definition of base type for user-interactable kernel objects
#include "j6/errors.h"
#include "j6/signals.h"
#include "j6/types.h"
#include "kutil/vector.h"
@@ -76,6 +77,12 @@ public:
/// Remove the given thread from the list of threads waiting on this object.
inline void remove_blocked_thread(thread *t) { m_blocked_threads.remove_swap(t); }
/// Perform any cleanup actions necessary to mark this object closed
virtual void close();
/// Check if this object has been closed
inline bool closed() const { return check_signal(j6_signal_closed); }
protected:
/// Interface for subclasses to handle when all handles are closed. Subclasses
/// should either call the base version, or assert j6_signal_no_handles.