| Age | Commit message (Collapse) | Author |
|
A holdover from citra, the Horizon kernel on the switch has no
prominent kernel object that functions as a timer. At least not
to the degree of sophistication that this class provided.
As such, this can be removed entirely. This class also wasn't used at
all in any meaningful way within the core, so this was just code sitting
around doing nothing. This also allows removing a few things from the
main KernelCore class that allows it to use slightly less resources
overall (though very minor and not anything really noticeable).
|
|
thread list directly
No inheritors of the WaitObject class actually make use of their own
implementations of these functions, so they can be made non-virtual.
It's also kind of sketchy to allow overriding how the threads get added
to the list anyways, given the kernel itself on the actual hardware
doesn't seem to customize based off this.
|
|
This implementation just calls the base class variant of the function,
so this isn't necessary.
|
|
This just calls the base variant of the function, so it can be removed.
|
|
Looking into the implementation of the C++ standard facilities that seem
to be within all modules, it appears that they use 7 as a break reason
to indicate an uncaught C++ exception.
This was primarily found via the third last function called within
Horizon's equivalent of libcxxabi's demangling_terminate_handler(),
which passes the value 0x80000007 to svcBreak.
|
|
Pulse is considered a hack and nothing should be using it. We should completely remove it
|
|
Gets rid of a few unnecessary header dependencies in some source files.
|
|
This is a bounds check to ensure that the thread priority is within the
valid range of 0-64. If it exceeds 64, that doesn't necessarily mean
that an actual priority of 64 was expected (it actually means whoever
called the function screwed up their math).
Instead clarify the message to indicate the allowed range of thread
priorities.
|
|
Now that we handle the kernel capability descriptors we can correct
CreateThread to properly check against the core and priority masks
like the actual kernel does.
|
|
GetAllowedThreadPriorityMask()
Makes them consistent with their kernel capability counterparts.
|
|
Rather than use a switch here, this can be collapsed into a simple range
check, which is a little easier on the eyes.
|
|
kernel/process: Start the main thread using the specified ideal core
|
|
Print backtrace on svcBreak
|
|
This matches kernel behavior in that processes are started using their
specified ideal core, rather than always starting on core 0.
|
|
This makes the naming more closely match its meaning. It's just a
preferred core, not a required default core. This also makes the usages
of this term consistent across the thread and process implementations.
|
|
This function isn't a general purpose function that should be exposed to
everything, given it's specific to initializing the main thread for a
Process instance.
Given that, it's a tad bit more sensible to place this within
process.cpp, which keeps it visible only to the code that actually needs
it.
|
|
In all cases that these functions are needed, the VMManager can just be
retrieved and used instead of providing the same functions in Process'
interface.
This also makes it a little nicer dependency-wise, since it gets rid of
cases where the VMManager interface was being used, and then switched
over to using the interface for a Process instance. Instead, it makes
all accesses uniform and uses the VMManager instance for all necessary
tasks.
All the basic memory mapping functions did was forward to the Process'
VMManager instance anyways.
|
|
kernel: Handle kernel capability descriptors
|
|
Like the other members related to memory regions, the attributes need to
be reset back to their defaults as well.
|
|
svc: Implement SetThreadActivity (thread suspension)
|
|
Fixed uninitialized memory due to missing returns in canary
|
|
kernel/{process, thread}: Amend behavior related to IDs
|
|
While we're at it, we can also toss out the leftover capability parsing
from Citra.
|
|
|
|
This just specifies the handle table size. There's also a section of
reserved bits that are checked against.
|
|
|
|
|
|
Similar to the service capability flags, however, we currently don't
emulate the GIC, so this currently handles all interrupts as being valid
for the time being.
|
|
|
|
Handles the priority mask and core mask flags to allow building up the
masks to determine the usable thread priorities and cores for a kernel
process instance.
|
|
We've had the old kernel capability parser from Citra, however, this is
unused code and doesn't actually map to how the kernel on the Switch
does it. This introduces the basic functional skeleton for parsing
process capabilities.
|
|
If a thread handle is passed to svcGetProcessId, the kernel attempts to
access the process ID via the thread's instance's owning process.
Technically, this function should also be handling the kernel debug
objects as well, however we currently don't handle those kernel objects
yet, so I've left a note via a comment about it to remind myself when
implementing it in the future.
|
|
kernel/svc: Implement svcSetMemoryAttribute
|
|
With all the basic backing functionality implemented, we can now unstub
svcSetMemoryAttribute.
|
|
address range
This puts the backing functionality for svcSetMemoryAttribute in place,
which will be utilized in a following change.
|
|
certain attributes, permissions and states
|
|
Starts the process ID counter off at 81, which is what the kernel itself
checks against internally when creating processes. It's actually
supposed to panic if the PID is less than 81 for a userland process.
|
|
The service call uses a 64-bit value, just like svcGetProcessId. This
amends the function signature accordingly.
|
|
The kernel uses a 64-bit value for the thread ID, so we shouldn't be
using a 32-bit value.
|
|
svcGetProcessId's out parameter is a pointer to a 64-bit value, not a
32-bit one.
|
|
In the actual kernel, this is a 64-bit value, so we shouldn't be using a
32-bit type to handle it.
|
|
|
|
Functions which are suppose to crash on non canary builds usually don't return anything which lead to uninitialized memory being used.
|
|
|
|
This is shorter and more concise. This also removes the now-innaccurate
comment, as it's not returned wholesale to svcQueryMemory anymore.
|
|
Adds the barebones enumeration constants and functions in place to
handle memory attributes, while also essentially leaving the attribute
itself non-functional.
|
|
svc: Implement yield types 0 and -1
|
|
vm_manager/svc: Modify MemoryState enum, and correct error handling for svcQueryMemory
|
|
svc_wrap: Correct register index for a wrapper specialization
|
|
svcQueryProcessMemory is trivial to implement, given all the behavior
necessary for it is present, it just needs a handler for it.
|