Skip to content

Commit

Permalink
Fix pm:dmnt for 5.0.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
plutooo committed Sep 18, 2018
1 parent 3ecd841 commit 00287b6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nx/source/services/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "result.h"
#include "arm/atomics.h"
#include "kernel/ipc.h"
#include "kernel/detect.h"
#include "services/pm.h"
#include "services/sm.h"

Expand Down Expand Up @@ -73,7 +74,7 @@ Result pmdmntStartProcess(u64 pid) {
raw = ipcPrepareHeader(&c, sizeof(*raw));

raw->magic = SFCI_MAGIC;
raw->cmd_id = 2;
raw->cmd_id = kernelAbove500() ? 1 : 2;
raw->pid = pid;

Result rc = serviceIpcDispatch(&g_pmdmntSrv);
Expand Down Expand Up @@ -106,7 +107,7 @@ Result pmdmntGetTitlePid(u64* pid_out, u64 title_id) {
raw = ipcPrepareHeader(&c, sizeof(*raw));

raw->magic = SFCI_MAGIC;
raw->cmd_id = 3;
raw->cmd_id = kernelAbove500() ? 2 : 3;
raw->title_id = title_id;

Result rc = serviceIpcDispatch(&g_pmdmntSrv);
Expand Down Expand Up @@ -144,7 +145,7 @@ Result pmdmntEnableDebugForTitleId(Handle* handle_out, u64 title_id) {
raw = ipcPrepareHeader(&c, sizeof(*raw));

raw->magic = SFCI_MAGIC;
raw->cmd_id = 4;
raw->cmd_id = kernelAbove500() ? 3 : 4;
raw->title_id = title_id;

Result rc = serviceIpcDispatch(&g_pmdmntSrv);
Expand Down Expand Up @@ -216,7 +217,7 @@ Result pmdmntGetApplicationPid(u64* pid_out) {
raw = ipcPrepareHeader(&c, sizeof(*raw));

raw->magic = SFCI_MAGIC;
raw->cmd_id = 5;
raw->cmd_id = kernelAbove500() ? 4 : 5;

Result rc = serviceIpcDispatch(&g_pmdmntSrv);

Expand Down Expand Up @@ -252,7 +253,7 @@ Result pmdmntEnableDebugForApplication(Handle* handle_out) {
raw = ipcPrepareHeader(&c, sizeof(*raw));

raw->magic = SFCI_MAGIC;
raw->cmd_id = 6;
raw->cmd_id = kernelAbove500() ? 5 : 6;

Result rc = serviceIpcDispatch(&g_pmdmntSrv);

Expand Down Expand Up @@ -346,4 +347,4 @@ Result pmshellTerminateProcessByTitleId(u64 titleID) {
}

return rc;
}
}

0 comments on commit 00287b6

Please sign in to comment.