yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0
This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
yuzu-mainline/src
Lioncash 7fe27de26e svc: Use the current process' handle table for retrieving the process instance to act upon
The kernel uses the handle table of the current process to retrieve the
process that should be used to retrieve certain information. To someone
not familiar with the kernel, this might raise the question of "Ok,
sounds nice, but doesn't this make it impossible to retrieve information
about the current process?".

No, it doesn't, because HandleTable instances in the kernel have the
notion of a "pseudo-handle", where certain values allow the kernel to
lookup objects outside of a given handle table. Currently, there's only
a pseudo-handle for the current process (0xFFFF8001) and a pseudo-handle
for the current thread (0xFFFF8000), so to retrieve the current process,
one would just pass 0xFFFF8001 into svcGetInfo.

The lookup itself in the handle table would be something like:

template <typename T>
T* Lookup(Handle handle) {
    if (handle == PSEUDO_HANDLE_CURRENT_PROCESS) {
        return CurrentProcess();
    }

    if (handle == PSUEDO_HANDLE_CURRENT_THREAD) {
        return CurrentThread();
    }

    return static_cast<T*>(&objects[handle]);
}

which, as is shown, allows accessing the current process or current
thread, even if those two objects aren't actually within the HandleTable
instance.
2018-12-02 03:41:49 -05:00
..
audio_core audio_core/audio_renderer: Fix typo in AuxInfo member name 2018-11-13 13:32:13 -05:00
common Merge pull request #1773 from lioncash/thread 2018-11-23 08:52:05 -08:00
core svc: Use the current process' handle table for retrieving the process instance to act upon 2018-12-02 03:41:49 -05:00
input_common Port #4141 from citra: Joystick hotplug support (#1275) 2018-09-10 21:29:59 -04:00
tests global: Use std::optional instead of boost::optional (#1578) 2018-10-30 00:03:25 -04:00
video_core Fix debug build 2018-12-01 02:11:42 -05:00
web_service compatdb: Use a seperate endpoint for testcase submission 2018-10-28 13:23:02 +01:00
yuzu configure_input: Amend clang-format discrepancies 2018-11-30 03:31:56 -05:00
yuzu_cmd Merge pull request #1725 from FernandoS27/gl43 2018-11-23 23:56:57 -05:00
.clang-format Remove special rules for Windows.h and library includes 2016-09-21 00:16:33 -07:00
CMakeLists.txt Port web_service from Citra 2018-10-02 15:30:48 +02:00