fs.mitm: WIP LayeredFS impl (NOTE: UNUSABLE ATM)

Also greatly refactors libstratosphere, and does a lot of other things.
There is a lot of code in this one.
This commit is contained in:
Michael Scire
2018-06-14 17:50:01 -06:00
parent 82b248aeac
commit c2d9ac8f5c
56 changed files with 1615 additions and 243 deletions

View File

@@ -4,18 +4,20 @@
#include "iwaitable.hpp"
typedef Result (*EventCallback)(Handle *handles, size_t num_handles, u64 timeout);
typedef Result (*EventCallback)(void *arg, Handle *handles, size_t num_handles, u64 timeout);
class IEvent : public IWaitable {
protected:
std::vector<Handle> handles;
EventCallback callback;
void *arg;
public:
IEvent(Handle wait_h, EventCallback callback) {
IEvent(Handle wait_h, void *a, EventCallback callback) {
if (wait_h) {
this->handles.push_back(wait_h);
}
this->arg = a;
this->callback = callback;
}
@@ -41,7 +43,7 @@ class IEvent : public IWaitable {
}
virtual Result handle_signaled(u64 timeout) {
return this->callback(this->handles.data(), this->handles.size(), timeout);
return this->callback(this->arg, this->handles.data(), this->handles.size(), timeout);
}
static Result PanicCallback(Handle *handles, size_t num_handles, u64 timeout) {