aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
AgeCommit message (Collapse)Author
2018-07-19thread: Convert ThreadStatus into an enum classLioncash
Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
2018-07-19Merge pull request #726 from lioncash/overloadbunnei
hle_ipc: Introduce generic WriteBuffer overload for multiple container types
2018-07-19Merge pull request #721 from lioncash/svcbunnei
svc: Correct always true assertion case in SetThreadCoreMask
2018-07-19hle_ipc: Introduce generic WriteBuffer overload for multiple container typesLioncash
This introduces a slightly more generic variant of WriteBuffer(). Notably, this variant doesn't constrain the arguments to only accepting std::vector instances. It accepts whatever adheres to the ContiguousContainer concept in the C++ standard library. This essentially means, std::array, std::string, and std::vector can be used directly with this interface. The interface no longer forces you to solely use containers that dynamically allocate. To ensure our overloads play nice with one another, we only enable the container-based WriteBuffer if the argument is not a pointer, otherwise we fall back to the pointer-based one.
2018-07-19svc: Correct always true assertion case in SetThreadCoreMaskLioncash
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.
2018-07-19hle_ipc: Amend usage of buffer_index within one of HLERequestContext's ↵Lioncash
WriteBuffer() overloads Previously, the buffer_index parameter was unused, causing all writes to use the buffer index of zero, which is not necessarily what is wanted all the time. Thankfully, all current usages don't use a buffer index other than zero, so this just prevents a bug before it has a chance to spring.
2018-07-18Merge pull request #692 from lioncash/assignbunnei
address_arbiter: Correct assignment within an assertion statement in WakeThreads()
2018-07-18Merge pull request #690 from lioncash/movebunnei
core/memory, core/hle/kernel: Use std::move where applicable
2018-07-18Merge pull request #688 from lioncash/commabunnei
vm_manager: Add missing commas to string literal array elements in GetMemoryStateName()
2018-07-18address_arbiter: Correct assignment within an assertion statement in ↵Lioncash
WakeThreads() This was introduced within 4f81bc4e1bd12e4df7410c6790ba818d8dbba9c0, and considering there's no comment indicating that this is intentional, this is very likely a bug.
2018-07-18vm_manager: Add missing commas to string literal array elements in ↵Lioncash
GetMemoryStateName() Without these, this would perform concatenation, which is definitely not what we want here.
2018-07-18core/memory, core/hle/kernel: Use std::move where applicableLioncash
Avoids pointless copies
2018-07-18core: Don't construct instance of Core::System, just to access its live instanceLioncash
This would result in a lot of allocations and related object construction, just to toss it all away immediately after the call. These are definitely not intentional, and it was intended that all of these should have been accessing the static function GetInstance() through the name itself, not constructed instances.
2018-07-17Merge pull request #671 from MerryMage/clear-exclusive-statebunnei
scheduler: Clear exclusive state when switching contexts
2018-07-17Merge pull request #672 from SciresM/to_address_fixbunnei
svc:: Fix bug in svcWaitForAddress
2018-07-17nvflinger: Fix for BufferQueue event handling.bunnei
2018-07-16Kernel/Arbiter: Fix bug in WaitIfLessThanMichael Scire
2018-07-16scheduler: Clear exclusive state when switching contextsMerryMage
2018-07-14No need to use ASSERT_MSG with an empty messageDavid Marcec
2018-07-02Update clang formatJames Rowe
2018-07-02Rename logging macro back to LOG_*James Rowe
2018-06-22Merge pull request #579 from SciresM/masterbunnei
svc: Fully implement svcSignalToAddress and svcWaitForAddress
2018-06-22IPC: skip empty buffer writemailwl
prevent yuzu crash, if games, like Axiom Verge, trying to read 0 bytes from file
2018-06-22Kernel/Arbiters: Fix casts, cleanup comments/magic numbersMichael Scire
2018-06-21Add additional missing format.Michael Scire
2018-06-21Run clang-format on PR.Michael Scire
2018-06-21Kernel/Arbiters: HLE is atomic, adjust code to reflect that.Michael Scire
2018-06-21Kernel/Arbiters: Initialize arb_wait_address in thread struct.Michael Scire
2018-06-21Kernel/Arbiters: Clear WaitAddress in SignalToAddressMichael Scire
2018-06-21Kernel/Arbiters: Mostly implement SignalToAddressMichael Scire
2018-06-21Kernel/Arbiters: Implement WaitForAddressMichael Scire
2018-06-21Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs.Michael Scire
2018-06-20Build: Fixed some MSVC warnings in various parts of the code.Subv
2018-06-18Merge pull request #572 from Armada651/user-except-stubbunnei
svc: Add a stub for UserExceptionContextAddr.
2018-06-18svc: Add a stub for UserExceptionContextAddr.Jules Blok
2018-06-02Kernel/Threads: A thread waking up by timeout from a WaitProcessWideKey may ↵Subv
already have an assigned lock owner. This situation may happen like so: Thread 1 with low priority calls WaitProcessWideKey with timeout. Thread 2 with high priority calls WaitProcessWideKey without timeout. Thread 3 calls SignalProcessWideKey - Thread 2 acquires the lock and awakens. - Thread 1 can't acquire the lock and is put to sleep with the lock owner being Thread 2. Thread 1's timeout expires, with the lock owner still being set to Thread 2.
2018-05-30Kernel/Thread: Corrected a typo that caused the affinity mask to never be ↵Subv
changed.
2018-05-30Kernel/SVC: Support special core values -2 and -3 in svcSetThreadCoreMask.Subv
Also added some proper error handling.
2018-05-30Kernel/Thread: Corrected a typo in an assert about the processor id.Subv
2018-05-25Add & correct miscellaneous things (#470)greggameplayer
* add some InfoType * correct OpenApplicationProxy cmd number * add IDisplayController functions * fix clang-format * add more system languages
2018-05-23Merge pull request #454 from Subv/signal_processwidebunnei
Kernel/SVC: Signal the highest priority threads first in svcSignalProcessWideKey
2018-05-20Merge pull request #457 from Subv/mutex_waitersbunnei
Mutex: Do not assert when the mutex waiting threads list isn't empty on mutex release.
2018-05-20Mutex: Do not assert when the mutex waiting threads list isn't empty on ↵Subv
mutex release. A thread may own multiple mutexes at the same time, and only release one of them while other threads are waiting for the other mutexes.
2018-05-19Kernel/SVC: Signal the highest priority threads first in ↵Subv
svcSignalProcessWideKey.
2018-05-19Kernel/Threads: Reschedule the proper core when operating on that core's ↵Subv
threads.
2018-05-19SVC: Removed unused WaitSynchronization1 functionSubv
2018-05-17Added RequestWithContext & ControlWithContextDavid Marcec
2018-05-10thread: Rename mask to affinity_masks.bunnei
2018-05-10thread: Support core change on ResumeFromWait and improve ChangeCore.bunnei
2018-05-10scheduler: Protect scheduling functions with a global mutex.bunnei