| Age | Commit message (Collapse) | Author |
|
Given if we hit here all is lost, we should probably be logging the
break reason code and associated information to distinguish between the
causes.
|
|
Use an approximated amortized amount of ticks when advancing timing.
|
|
The current core may have nothing to do with the core where the new thread was scheduled to run. In case it's the same core, then the following PrepareReshedule call will take care of that.
|
|
Exit from AddMutexWaiter early if the thread is already waiting for a mutex owned by the owner thread.
This accounts for the possibility of a thread that is waiting on a condition variable being awakened twice in a row.
Also added more validation asserts.
This should fix one of the random crashes in Breath Of The Wild.
|
|
Makes our immutable state explicit.
|
|
kernel: Remove unused object_address_table.cpp/.h
|
|
These source files were entirely unused throughout the rest of the
codebase. This also has the benefit of getting rid of a global variable
as well.
|
|
Removes unnecessary direct dependencies in some headers and also gets
rid of indirect dependencies that were being relied on to be included.
|
|
svc: Log parameters in SetMemoryAttribute()
|
|
The loop's induction variable was signed, but we were comparing against
an unsigned variable.
|
|
Provides slightly more context than only logging out the address value.
|
|
kernel.
|
|
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
|
|
The reason this would never be true is that ideal_processor is a u8 and
THREADPROCESSORID_DEFAULT is an s32. In this case, it boils down to how
arithmetic conversions are performed before performing the comparison.
If an unsigned value has a lesser conversion rank (aka smaller size)
than the signed type being compared, then the unsigned value is promoted
to the signed value (i.e. u8 -> s32 happens before the comparison). No
sign-extension occurs here either.
An alternative phrasing:
Say we have a variable named core and it's given a value of -2.
u8 core = -2;
This becomes 254 due to the lack of sign. During integral promotion to
the signed type, this still remains as 254, and therefore the condition
will always be true, because no matter what value the u8 is given it
will never be -2 in terms of 32 bits.
Now, if one type was a s32 and one was a u32, this would be entirely
different, since they have the same bit width (and the signed type would
be converted to unsigned instead of the other way around) but would
still have its representation preserved in terms of bits, allowing the
comparison to be false in some cases, as opposed to being true all the
time.
---
We also get rid of two signed/unsigned comparison warnings while we're
at it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
svc: Add a stub for UserExceptionContextAddr.
|
|
|
|
Also added some proper error handling.
|
|
svcSignalProcessWideKey.
|
|
threads.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This makes the formatting expectations more obvious (e.g. any zero padding specified
is padding that's entirely dedicated to the value being printed, not any pretty-printing
that also gets tacked on).
|
|
Given we utilize fmt, we don't need to provide our own functions for formatting anymore
|
|
|
|
|
|
Kernel: Reworked the new kernel synchronization primitives.
|
|
Verified with a hwtest and implemented based on reverse engineering.
Thread A's priority will get bumped to the highest priority among all the threads that are waiting for a mutex that A holds.
Once A releases the mutex and ownership is transferred to B, A's priority will return to normal and B's priority will be bumped.
|
|
|
|
They work in tandem with guest code to provide synchronization primitives along with svcArbitrateLock/Unlock
|
|
Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case.
Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock.
TODO:
* Fix svcWaitProcessWideKey
* Fix svcSignalProcessWideKey
* Remove the Mutex class.
|
|
Prevents enum identifiers from leaking into the surrounding scope.
|
|
C++17 has non-member size() which we can just call where necessary.
|
|
* Updated ACC with more service names
* Updated SVC with more service names
* Updated set with more service names
* Updated sockets with more service names
* Updated SPL with more service names
* Updated time with more service names
* Updated vi with more service names
|
|
|
|
|
|
|
|
|