- Oct 30, 2018
-
-
Lioncash authored
Nothing requires the shared owner ship here, so we can just return a plain pointer.
-
- Oct 26, 2018
-
-
Lioncash authored
Nothing from this enum is intended to be used outside of this function.
-
Lioncash authored
This retrieves: if (curr_thread == handle_thread) { result = total_thread_ticks + (hardware_tick_count - last_context_switch_ticks); } else if (curr_thread == handle_thread && sub_id == current_core_index) { result = hardware_tick_count - last_context_switch_ticks; }
-
- Oct 25, 2018
- Oct 24, 2018
-
-
Lioncash authored
Now that we've gotten the innaccurate error codes out of the way, we can finally toss away a bunch of these, trimming down the error codes to ones that are actually used and knocking out two TODO comments.
-
Lioncash authored
This is more consistent with what the kernel does.
-
Lioncash authored
-
Lioncash authored
This is what the kernel does in this instance.
-
Lioncash authored
These are now entirely unused and can be removed.
-
Lioncash authored
Like with the previous change, the kernel doesn't return NOT_AUTHORIZED here. It returns INVALID_THREAD_PRIORITY.
-
Lioncash authored
kernel/svc: Move and correct returned error code for invalid thread priorities in SetThreadPriority() All priority checks are supposed to occur before checking the validity of the thread handle, we're also not supposed to return ERR_NOT_AUTHORIZED here.
-
Lioncash authored
The kernel appears to return 0xE601 for this situation. Particularly in svcWaitSynchronization, svcReplyAndReceive, and svcGetThreadContext
-
Lioncash authored
The kernel appears to return 0xF601 for this case.
-
- Oct 23, 2018
-
-
David Marcec authored
-
David Marcec authored
There seems to be more such as type 1, and 2. Unsure what these currently are but when a game hits them we can investigate and add the rest
-
- Oct 20, 2018
-
-
Lioncash authored
In the kernel, there isn't a singular handle table that everything gets tossed into or used, rather, each process gets its own handle table that it uses. This currently isn't an issue for us, since we only execute one process at the moment, but we may as well get this out of the way so it's not a headache later on.
-
Lioncash authored
This should be comparing against the queried process' vma_map, not the current process'. The only reason this hasn't become an issue yet is we currently only handle one process being active at any time.
-
- Oct 18, 2018
-
-
Lioncash authored
The kernel itself checks whether or not the provided addresses are word aligned before continuing, so we should be doing the same.
-
Lioncash authored
Aligning on 4KB pages isn't a Switch-specific thing, so this can be moved to common so it can be used with other things as well.
-
Lioncash authored
Now that the changes clarifying the address spaces has been merged, we can wrap the checks that the kernel performs when mapping shared memory (and other forms of memory) into its own helper function and then use those within MapSharedMemory and UnmapSharedMemory to complete the sanitizing checks that are supposed to be done.
-
- Oct 15, 2018
-
-
Lioncash authored
-
Lioncash authored
So, one thing that's puzzled me is why the kernel seemed to *not* use the direct code address ranges in some cases for some service functions. For example, in svcMapMemory, the full address space width is compared against for validity, but for svcMapSharedMemory, it compares against 0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the compared range. Coincidentally, these exact same values are also used in svcGetInfo, and also when initializing the user address space, so this is actually retrieving the ASLR extents, not the extents of the address space in general.
-
- Oct 14, 2018
-
-
David Marcec authored
This should help diagnose crashes easier and prevent many users thinking that a game is still running when in fact it's just an audio thread still running(this is typically not killed when svcBreak is hit since the game expects us to do this)
-
- Oct 13, 2018
-
-
Lioncash authored
A fairly basic service function, which only appears to currently support retrieving the process state. This also alters the ProcessStatus enum to contain all of the values that a kernel process seems to be able of reporting with regards to state.
-
- Oct 12, 2018
-
-
Lioncash authored
These only exist to ferry data into a Process instance and end up going out of scope quite early. Because of this, we can just make it a plain struct for holding things and just std::move it into the relevant function. There's no need to make this inherit from the kernel's Object type.
-
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.
-
Lioncash authored
-
- Oct 11, 2018
-
-
Lioncash authored
This adds the missing address range checking that the service functions do before attempting to map or unmap memory. Given that both service functions perform the same set of checks in the same order, we can wrap these into a function and just call it from both functions, which deduplicates a little bit of code.
-
- 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).
-
David Marcec authored
-
David Marcec authored
signal_debugger seems like a more fitting name
-
David Marcec authored
svcBreak reason should be a u32, not a u64.
-
- Oct 09, 2018
-
-
David Marcec authored
-
David Marcec authored
-
David Marcec authored
When loading NROs, svcBreak is called to signal to the debugger that a new "module" is loaded. As no debugger is technically attached we shouldn't be killing the programs execution.
-
- Oct 06, 2018
-
-
David Marcec authored
-
David Marcec authored
This will allow us to easily remove the use of "NFC" in "System"
-
- 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.
-