From 71084bdd77f63d277aa111b58dc7b7aa3f8b2b63 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 17 Oct 2018 03:48:30 -0700 Subject: [PATCH] libstratosphere: Fix receive for multi-static IPC buffers --- include/stratosphere/isession.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/stratosphere/isession.hpp b/include/stratosphere/isession.hpp index 95156a2d..12fc6650 100644 --- a/include/stratosphere/isession.hpp +++ b/include/stratosphere/isession.hpp @@ -187,6 +187,10 @@ class ISession : public IWaitable { ipcAddRecvStatic(&c_for_reply, this->pointer_buffer.data(), this->pointer_buffer.size(), 0); ipcPrepareHeader(&c_for_reply, 0); + /* Fix libnx bug in serverside C descriptor handling. */ + ((u32 *)armGetTls())[1] &= 0xFFFFC3FF; + ((u32 *)armGetTls())[1] |= (2) << 10; + if (R_SUCCEEDED(rc = svcReplyAndReceive(&handle_index, &this->server_handle, 1, 0, U64_MAX))) { if (handle_index != 0) { /* TODO: Panic? */