- Oct 12, 2018
-
-
Lioncash authored
Regular value initialization is adequate here for zeroing out data. It also has the benefit of not invoking undefined behavior if a non-trivial type is ever added to the struct for whatever reason.
-
- Oct 10, 2018
-
-
Lioncash authored
There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
-
- Oct 05, 2018
-
-
balika011 authored
Conceptually, it doesn't make sense for a thread to be able to persist the lifetime of a scheduler. A scheduler should be taking care of the threads; the threads should not be taking care of the scheduler. If the threads outlive the scheduler (or we simply don't actually terminate/shutdown the threads), then it should be considered a bug that we need to fix. Attributing this to balika011, as they opened #1317 to attempt to fix this in a similar way, but my refactoring of the kernel code caused quite a few conflicts.
-
- Oct 04, 2018
-
-
Lioncash authored
Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
-
- Sep 30, 2018
-
-
Lioncash authored
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
-
- Sep 25, 2018
-
-
Lioncash authored
The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
-
- Sep 21, 2018
-
-
Lioncash authored
Allows making several members of the process class private, it also avoids going through Core::CurrentProcess() just to retrieve the owning process.
-
Lioncash authored
The owning process of a thread is required to exist before the thread, so we can enforce this API-wise by using a reference. We can also avoid the reliance on the system instance by using that parameter to access the page table that needs to be set.
-
- Sep 18, 2018
-
-
Lioncash authored
This modifies the CPU interface to more accurately match an AArch64-supporting CPU as opposed to an ARM11 one. Two of the methods don't even make sense to keep around for this interface, as Adv Simd is used, rather than the VFP in the primary execution state. This is essentially a modernization change that should have occurred from the get-go.
-
- Sep 15, 2018
-
-
fearlessTobi authored
-
- Sep 12, 2018
-
-
Lioncash authored
-
- Aug 31, 2018
-
-
Lioncash authored
The follow-up to e2457418, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
-
- Aug 29, 2018
-
-
Lioncash authored
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
-
- Aug 25, 2018
-
-
Lioncash authored
Gets all of these types and interfaces out of the global namespace.
-
- Aug 13, 2018
-
-
B3n30 authored
-
- Aug 12, 2018
-
-
Subv authored
Another thread might be in the middle of a reschedule, thus altering the state of the schedulers.
-
Subv authored
WakeAfterDelay might be called from any host thread, so err on the side of caution and use the thread-safe CoreTiming::ScheduleEventThreadsafe. Note that CoreTiming is still far from thread-safe, there may be more things we have to work on for it to be up to par with what we want.
-
Subv authored
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.
-
- Aug 04, 2018
-
-
Lioncash authored
This amends cases where crashes can occur that were missed due to the odd way the previous code was set up (using 3DS memory regions that don't exist).
-
- Aug 03, 2018
-
-
Lioncash authored
Removes leftover code from citra that isn't needed.
-
- Aug 02, 2018
-
-
Lioncash authored
Avoids using a u32 to compare against a range of size_t, which can be a source of warnings. While we're at it, compress a std::tie into a structured binding.
-
Lioncash authored
This function only reads the data being referenced, it doesn't modify it, so we can turn the reference into a const reference.
-
Lioncash authored
This function isn't used outside of this translation unit, so we can make it internally linked.
-
Lioncash authored
General moving to keep kernel object types separate from the direct kernel code. Also essentially a preliminary cleanup before eliminating global kernel state in the kernel code.
-
- Jul 31, 2018
-
-
Lioncash authored
Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
-
- Jul 24, 2018
-
-
MerryMage authored
-
- Jul 21, 2018
-
-
Subv authored
Note that there's currently a dynarmic bug preventing this register from being written.
-
- Jul 20, 2018
-
-
Lioncash authored
Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
-
- Jul 18, 2018
-
-
Lioncash authored
Avoids pointless copies
-
Lioncash authored
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.
-
- Jul 03, 2018
-
-
James Rowe authored
-
James Rowe authored
-
- Jun 21, 2018
-
-
Michael Scire authored
-
- Jun 02, 2018
-
-
Subv authored
Kernel/Threads: A thread waking up by timeout from a WaitProcessWideKey may 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.
-
- May 31, 2018
-
-
Subv authored
-
- May 30, 2018
-
-
Subv authored
-
- May 10, 2018