Make srvGetServiceHandle non-blocking if service port is full in all cases

This commit is contained in:
TuxSH 2018-01-15 02:27:07 +01:00
parent 553f8d2533
commit 9074688491
2 changed files with 22 additions and 0 deletions

View File

@ -26,10 +26,22 @@
#include "MyThread.h" #include "MyThread.h"
#include "memory.h" #include "memory.h"
#include <3ds/srv.h>
static void _thread_begin(void* arg) static void _thread_begin(void* arg)
{ {
MyThread *t = (MyThread *)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(); t->ep();
MyThread_Exit(); MyThread_Exit();
} }

View File

@ -89,6 +89,16 @@ void initSystem()
ProcessPatchesMenu_PatchUnpatchFSDirectly(); ProcessPatchesMenu_PatchUnpatchFSDirectly();
__sync_init(); __sync_init();
__appInit(); __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; bool terminationRequest = false;