Make PM Compile. Note: Currently broken.

This commit is contained in:
Michael Scire 2018-06-14 23:32:01 -06:00
parent c2d9ac8f5c
commit 4d36697080
8 changed files with 24 additions and 22 deletions

View file

@ -46,7 +46,7 @@ class IEvent : public IWaitable {
return this->callback(this->arg, this->handles.data(), this->handles.size(), timeout);
}
static Result PanicCallback(Handle *handles, size_t num_handles, u64 timeout) {
static Result PanicCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout) {
/* TODO: Panic. */
return 0xCAFE;
}

View file

@ -12,6 +12,10 @@ class BootModeService final : public IServiceObject {
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override;
BootModeService *clone() override {
return new BootModeService(*this);
}
private:
/* Actual commands. */
std::tuple<Result, bool> get_boot_mode();

View file

@ -32,6 +32,10 @@ class DebugMonitorService final : public IServiceObject {
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override;
DebugMonitorService *clone() override {
return new DebugMonitorService(*this);
}
private:
/* Actual commands. */
std::tuple<Result, u32> get_unknown_stub(u64 unknown, OutBuffer<u8> out_unknown);

View file

@ -12,6 +12,10 @@ class InformationService final : public IServiceObject {
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override;
InformationService *clone() override {
return new InformationService(*this);
}
private:
/* Actual commands. */
std::tuple<Result, u64> get_title_id(u64 pid);

View file

@ -52,21 +52,6 @@ class ProcessList final : public IWaitable {
}
/* IWaitable */
unsigned int get_num_waitables() override {
return process_waiters.size();
}
void get_waitables(IWaitable **dst) override {
Lock();
for (unsigned int i = 0; i < process_waiters.size(); i++) {
dst[i] = process_waiters[i];
}
Unlock();
}
void delete_child(IWaitable *child) override {
/* TODO: Panic, because we should never be asked to delete a child. */
}
Handle get_handle() override {
/* TODO: Panic, because we don't have a handle. */

View file

@ -41,15 +41,15 @@ void Registration::AutoProcessListLock::Unlock() {
}
void Registration::InitializeSystemResources() {
g_process_event = new SystemEvent(&IEvent::PanicCallback);
g_debug_title_event = new SystemEvent(&IEvent::PanicCallback);
g_debug_application_event = new SystemEvent(&IEvent::PanicCallback);
g_process_launch_start_event = new SystemEvent(&Registration::ProcessLaunchStartCallback);
g_process_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_debug_title_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_debug_application_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_process_launch_start_event = new SystemEvent(NULL, &Registration::ProcessLaunchStartCallback);
ResourceLimitUtils::InitializeLimits();
}
Result Registration::ProcessLaunchStartCallback(Handle *handles, size_t num_handles, u64 timeout) {
Result Registration::ProcessLaunchStartCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout) {
svcClearEvent(handles[0]);
Registration::HandleProcessLaunch();
return 0;

View file

@ -42,7 +42,7 @@ class Registration {
static void InitializeSystemResources();
static IWaitable *GetProcessLaunchStartEvent();
static Result ProcessLaunchStartCallback(Handle *handles, size_t num_handles, u64 timeout);
static Result ProcessLaunchStartCallback(void *arg, Handle *handles, size_t num_handles, u64 timeout);
static IWaitable *GetProcessList();
static void HandleSignaledProcess(Process *process);

View file

@ -35,6 +35,11 @@ class ShellService final : public IServiceObject {
Result dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override;
ShellService *clone() override {
return new ShellService(*this);
}
private:
/* Actual commands. */
std::tuple<Result, u64> launch_process(u64 launch_flags, Registration::TidSid tid_sid);