libstratosphere: Fix receive for multi-static IPC buffers

This commit is contained in:
Michael Scire 2018-10-17 03:48:30 -07:00
parent 4944986814
commit 781f2597e5
2 changed files with 5 additions and 1 deletions

View file

@ -117,7 +117,7 @@ int main(int argc, char **argv)
}
/* TODO: What's a good timeout value to use here? */
auto server_manager = std::make_unique<MultiThreadedWaitableManager>(1, U64_MAX, 0x20000);
auto server_manager = std::make_unique<MultiThreadedWaitableManager>(5, U64_MAX, 0x20000);
//auto server_manager = std::make_unique<WaitableManager>(U64_MAX);
/* Create fsp-srv mitm. */

View file

@ -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? */