From 146aad7f552e8a820f0f634d671526d6e5fb6a13 Mon Sep 17 00:00:00 2001 From: plutoo Date: Sun, 17 Dec 2017 03:47:21 +0100 Subject: [PATCH] Fixes for 1.0.0, correcting NRO aslr base --- crt0/switch_crt0.s | 9 +++++---- nx/source/kernel/svc.s | 5 +++++ nx/source/services/applet.c | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/crt0/switch_crt0.s b/crt0/switch_crt0.s index a4e739a4..88a6061f 100644 --- a/crt0/switch_crt0.s +++ b/crt0/switch_crt0.s @@ -2,18 +2,19 @@ .global _start _start: - bl startup + b startup .word 0 .ascii "HOMEBREW" .org _start+0x80 startup: + // get aslr base + bl +4 + sub x28, x30, #0x84 + // save main thread handle mov x27, x1 - // get aslr base - sub x28, x30, #4 - // clear .bss adrp x0, __bss_start__ adrp x1, __bss_end__ diff --git a/nx/source/kernel/svc.s b/nx/source/kernel/svc.s index c237f3b3..cbfb7fe3 100644 --- a/nx/source/kernel/svc.s +++ b/nx/source/kernel/svc.s @@ -107,6 +107,11 @@ SVC_BEGIN svcWaitSynchronization ret SVC_END +SVC_BEGIN svcCancelSynchronization + svc 0x19 + ret +SVC_END + SVC_BEGIN svcArbitrateLock svc 0x1a ret diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index bc10c614..91788f6c 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -233,7 +233,8 @@ static Result appletSetFocusHandlingMode(u32 mode) { rc = _appletSetFocusHandlingMode(invals[0], invals[1], invals[2]); - if (R_SUCCEEDED(rc)) rc = _appletSetOutOfFocusSuspendingEnabled(invals[3]); + if (R_SUCCEEDED(rc) && kernelAbove200()) + rc = _appletSetOutOfFocusSuspendingEnabled(invals[3]); return rc; }