From 9074688491d11461f3b5942d34f36d197f8c4c43 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Mon, 15 Jan 2018 02:27:07 +0100 Subject: [PATCH] Make srvGetServiceHandle non-blocking if service port is full in all cases --- sysmodules/rosalina/source/MyThread.c | 12 ++++++++++++ sysmodules/rosalina/source/main.c | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/sysmodules/rosalina/source/MyThread.c b/sysmodules/rosalina/source/MyThread.c index 6d420f5..8ede9eb 100644 --- a/sysmodules/rosalina/source/MyThread.c +++ b/sysmodules/rosalina/source/MyThread.c @@ -26,10 +26,22 @@ #include "MyThread.h" #include "memory.h" +#include <3ds/srv.h> static void _thread_begin(void* arg) { MyThread *t = (MyThread *)arg; + + // ROSALINA HACKJOB BEGIN + // NORMAL APPS SHOULD NOT DO THIS, EVER + u32 *tls = (u32 *)getThreadLocalStorage(); + memset(tls, 0, 0x80); + tls[0] = 0x21545624; + // ROSALINA HACKJOB END + + // Rosalina specific: + srvSetBlockingPolicy(true); // GetServiceHandle nonblocking if service port is full + t->ep(); MyThread_Exit(); } diff --git a/sysmodules/rosalina/source/main.c b/sysmodules/rosalina/source/main.c index e75ffac..1dafa6a 100644 --- a/sysmodules/rosalina/source/main.c +++ b/sysmodules/rosalina/source/main.c @@ -89,6 +89,16 @@ void initSystem() ProcessPatchesMenu_PatchUnpatchFSDirectly(); __sync_init(); __appInit(); + + // ROSALINA HACKJOB BEGIN + // NORMAL APPS SHOULD NOT DO THIS, EVER + u32 *tls = (u32 *)getThreadLocalStorage(); + memset(tls, 0, 0x80); + tls[0] = 0x21545624; + // ROSALINA HACKJOB END + + // Rosalina specific: + srvSetBlockingPolicy(true); // GetServiceHandle nonblocking if service port is full } bool terminationRequest = false;