1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-23 10:52:13 +00:00

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); 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. */ /* TODO: Panic. */
return 0xCAFE; 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 dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override; Result handle_deferred() override;
BootModeService *clone() override {
return new BootModeService(*this);
}
private: private:
/* Actual commands. */ /* Actual commands. */
std::tuple<Result, bool> get_boot_mode(); 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 dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override; Result handle_deferred() override;
DebugMonitorService *clone() override {
return new DebugMonitorService(*this);
}
private: private:
/* Actual commands. */ /* Actual commands. */
std::tuple<Result, u32> get_unknown_stub(u64 unknown, OutBuffer<u8> out_unknown); 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 dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override; Result handle_deferred() override;
InformationService *clone() override {
return new InformationService(*this);
}
private: private:
/* Actual commands. */ /* Actual commands. */
std::tuple<Result, u64> get_title_id(u64 pid); std::tuple<Result, u64> get_title_id(u64 pid);

View file

@ -52,21 +52,6 @@ class ProcessList final : public IWaitable {
} }
/* 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 { Handle get_handle() override {
/* TODO: Panic, because we don't have a handle. */ /* TODO: Panic, because we don't have a handle. */

View file

@ -41,15 +41,15 @@ void Registration::AutoProcessListLock::Unlock() {
} }
void Registration::InitializeSystemResources() { void Registration::InitializeSystemResources() {
g_process_event = new SystemEvent(&IEvent::PanicCallback); g_process_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_debug_title_event = new SystemEvent(&IEvent::PanicCallback); g_debug_title_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_debug_application_event = new SystemEvent(&IEvent::PanicCallback); g_debug_application_event = new SystemEvent(NULL, &IEvent::PanicCallback);
g_process_launch_start_event = new SystemEvent(&Registration::ProcessLaunchStartCallback); g_process_launch_start_event = new SystemEvent(NULL, &Registration::ProcessLaunchStartCallback);
ResourceLimitUtils::InitializeLimits(); 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]); svcClearEvent(handles[0]);
Registration::HandleProcessLaunch(); Registration::HandleProcessLaunch();
return 0; return 0;

View file

@ -42,7 +42,7 @@ class Registration {
static void InitializeSystemResources(); static void InitializeSystemResources();
static IWaitable *GetProcessLaunchStartEvent(); 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 IWaitable *GetProcessList();
static void HandleSignaledProcess(Process *process); 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 dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) override;
Result handle_deferred() override; Result handle_deferred() override;
ShellService *clone() override {
return new ShellService(*this);
}
private: private:
/* Actual commands. */ /* Actual commands. */
std::tuple<Result, u64> launch_process(u64 launch_flags, Registration::TidSid tid_sid); std::tuple<Result, u64> launch_process(u64 launch_flags, Registration::TidSid tid_sid);