Kernel/IPC: Use 39 microseconds for the SendSyncRequest delay approximation.

As measured by the time it takes for to return when performing the SetLcdForceBlack IPC request to the GSP:GPU service in a n3DS with firmware 11.6

See https://gist.github.com/ds84182/ecdbbd25b56a29bd4e5b32a7544b8e92 for the source code of the test.
This commit is contained in:
Subv 2017-11-08 23:14:40 -05:00
parent e90daa6a4f
commit 98e3872353

View file

@ -81,8 +81,11 @@ ResultCode ServerSession::HandleSyncRequest(SharedPtr<Thread> thread) {
// starvation when a thread only does sync requests to HLE services while a // starvation when a thread only does sync requests to HLE services while a
// lower-priority thread is waiting to run. // lower-priority thread is waiting to run.
// TODO(Subv): Figure out a good value for this. // This delay was approximated in a homebrew application by measuring the average time
static constexpr u64 IPCDelayNanoseconds = 100; // it takes for svcSendSyncRequest to return when performing the SetLcdForceBlack IPC
// request to the GSP:GPU service in a n3DS with firmware 11.6. The measured values have
// a high variance and vary between models.
static constexpr u64 IPCDelayNanoseconds = 39000;
thread->WakeAfterDelay(IPCDelayNanoseconds); thread->WakeAfterDelay(IPCDelayNanoseconds);
} else { } else {
// Add the thread to the list of threads that have issued a sync request with this // Add the thread to the list of threads that have issued a sync request with this