| Age | Commit message (Collapse) | Author |
|
Given we now have the kernel as a class, it doesn't make sense to keep
the current process pointer within the System class, as processes are
related to the kernel.
This also gets rid of a subtle case where memory wouldn't be freed on
core shutdown, as the current_process pointer would never be reset,
causing the pointed to contents to continue to live.
|
|
Now that we have a class representing the kernel in some capacity, we
now have a place to put the named port map, so we move it over and get
rid of another piece of global state within the core.
|
|
The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, 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.
|
|
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.
|
|
kernel/error: Amend several error codes
|
|
core: Namespace all code in the arm subdirectory under the Core namespace
|
|
We can make this error code an alias of the resource limit exceeded
error code, allowing us to get rid of the lingering 3DS error code of
the same type.
|
|
We can treat this as an alias of TooLarge for documentation purposes.
This also lets us get rid of another lingering 3DS-related error code.
|
|
This replaces the lingering 3DS constant with the proper one, and
utilizes it within HandleTable's Create() member function.
|
|
|
|
|
|
We already have the variable itself set up to perform this task, so we
can just return its value from the currently executing process instead
of always stubbing it to zero.
|
|
Gets all of these types and interfaces out of the global namespace.
|
|
Core::CoreTiming: add UnscheduleEventThreadsafe
|
|
Allows querying the inverse of IsDomain() to make things more readable.
This will likely also be usable in the event of implementing
ConvertDomainToSession().
|
|
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.
|
|
|
|
Despite being covered by a global mutex, we should still ensure that the
class handles its reference counts properly. This avoids potential
shenanigans when it comes to data races.
Given this is the root object that drives quite a bit of the kernel
object hierarchy, ensuring we always have the correct behavior (and no
races) is a good thing.
|
|
Use an approximated amortized amount of ticks when advancing timing.
|
|
scheduler: Make HaveReadyThreads() a const member function
|
|
Fixed a bunch of race conditions when running in multicore mode.
|
|
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.
|
|
Another thread might be in the middle of a reschedule, thus altering the state of the schedulers.
|
|
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.
|
|
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.
|
|
This function doesn't modify instance state, so the const qualifier can
be added to it.
|
|
request.
|
|
This function doesn't modify anything within the reference Thread
instance.
|
|
These members don't need to be entirely exposed, we can instead expose
an API to operate on them without directly needing to mutate them
We can also guard against overflow/API misuse this way as well, given
active_sessions is an unsigned value.
|
|
Instead we can simply provide accessors to the required data instead of
giving external read/write access to the variables directly.
|
|
In all cases the vector being supplied is empty, so we can just return
by value in these instances.
|
|
kernel/process: Use accessors instead of class members for referencing segment array
|
|
26de4bb521b1ace7af76eff4f6956cb23ac0d58c
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).
|
|
|
|
segment array
Using member variables for referencing the segments array increases the
size of the class in memory for little benefit. The same behavior can be
achieved through the use of accessors that just return the relevant
segment.
|
|
Removes leftover code from citra that isn't needed.
|
|
kernel: Move object class to its own source files
|
|
kernel/thread: Minor changes
|
|
|
|
Makes our immutable state explicit.
|
|
These two variables correspond to address ranges.
|
|
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.
|
|
reference
This function only reads the data being referenced, it doesn't modify
it, so we can turn the reference into a const reference.
|
|
This function isn't used outside of this translation unit, so we can
make it internally linked.
|
|
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.
|
|
Given there's no implementation, we may as well remove the code
entirely.
|
|
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.
|
|
Instead, we can just expose functions that return the queryable state
instead of letting anything modify it.
|