Skip to content

Commit

Permalink
libstratosphere: Fix receive for multi-static IPC buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
SciresM committed Oct 17, 2018
1 parent 4944986 commit 781f259
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stratosphere/fs_mitm/source/fsmitm_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down

0 comments on commit 781f259

Please sign in to comment.