summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc_wrap.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-11-23general: fix compile for Apple ClangLiam1-2/+2
2022-11-12kernel: implement FlushProcessDataCacheLiam1-0/+8
2022-10-12k_server_session: preliminary support for userspace server sessionsLiam1-0/+18
2022-10-12Add implementation of svcCreateSessionLiam1-0/+14
2022-06-27core: Replace all instances of ResultCode with Resultgerman771-62/+62
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-3/+2
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-02-15kernel: svc: Add OutputDebugString32, CreateCodeMemory32, ControlCodeMemory32Sergi Granell1-0/+22
Very straightforward, they are just wrappers to the 64-bit version of the SVC.
2021-12-23core: hle: kernel: Implement SetMemoryPermission.bunnei1-0/+8
- Not seen in any games yet, but validated with kernel tests.
2021-12-05kernel: svc: Implement Map/UnmapProcessMemory and Create/ControlCodeMemoryitsmeft241-0/+27
Used by Skyline modding framework
2021-11-03svc: Correct WaitSynchronization num_handles param typeMorph1-2/+2
num_handles is a s32
2021-05-06fixup! hle: kernel: Improve MapSharedMemory and implement UnmapSharedMemory.bunnei1-3/+3
2021-05-06hle: kernel: Improve MapSharedMemory and implement UnmapSharedMemory.bunnei1-3/+14
2021-05-06hle: kernel: Migrate KResourceLimit to KAutoObject.bunnei1-3/+16
2021-05-06hle: kernel: svc: Use new handle table API for Process.bunnei1-3/+5
2021-05-06hle: kernel: Migrate KTransferMemory to KAutoObject.bunnei1-5/+7
2021-01-29hle: kernel: Recode implementation of KThread to be more accurate.bunnei1-3/+53
2021-01-11core: hle: Integrate new KConditionVariable and KAddressArbiter implementations.bunnei1-16/+22
2021-01-11core: hle: kernel: Update KSynchronizationObject.bunnei1-4/+5
2020-10-21Revert "core: Fix clang build"bunnei1-9/+8
2020-10-18core: Fix clang buildLioncash1-8/+9
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-06-27SVC: Implement 32-bits wrappers and update Dynarmic.Fernando Sahmkow1-3/+102
2020-06-27SVC: Add GetCurrentProcessorNumber32, CreateTransferMemory32, SetMemoryAttribute32Fernando Sahmkow1-0/+16
2020-06-27SVC: Add GetThreadPriority32 & SetThreadPriority32Fernando Sahmkow1-0/+18
2020-03-03core: hle: Implement separate A32/A64 SVC interfaces.bunnei1-42/+116
2019-12-11kernel/svc: Correct function signature of SignalProcessWideKeyLioncash1-5/+5
This function doesn't actually return a result code, so we can amend the signature of it to match.
2019-12-08kernel/svc: Provide implementations for svcDumpInfo/svcDumpInfoNewLioncash1-0/+11
These are fairly trivial to implement, we can just do nothing. This also provides a spot for us to potentially dump out any relevant info in the future (e.g. for debugging purposes with homebrew, etc). While we're at it, we can also correct the names of both of these supervisor calls.
2019-07-07Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire1-0/+5
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
2019-04-13kernel/svc: Implement svcMapProcessCodeMemoryLioncash1-0/+7
This is utilized for mapping code modules into memory. Notably, the ldr service would call this in order to map objects into memory.
2019-04-08kernel/svc: Deglobalize the supervisor call handlersLioncash1-159/+193
Adjusts the interface of the wrappers to take a system reference, which allows accessing a system instance without using the global accessors. This also allows getting rid of all global accessors within the supervisor call handling code. While this does make the wrappers themselves slightly more noisy, this will be further cleaned up in a follow-up. This eliminates the global system accessors in the current code while preserving the existing interface.
2019-04-02kernel/svc: Implement svcGetProcessListLioncash1-0/+8
This service function simply copies out a specified number of kernel process IDs, while simultaneously reporting the total number of processes.
2018-12-19kernel/svc: Correct output parameter for svcGetProcessIdLioncash1-1/+9
svcGetProcessId's out parameter is a pointer to a 64-bit value, not a 32-bit one.
2018-12-12svc: Enable svcQueryProcessMemoryLioncash1-0/+5
svcQueryProcessMemory is trivial to implement, given all the behavior necessary for it is present, it just needs a handler for it.
2018-12-12svc: Handle memory writing explicitly within QueryProcessMemoryLioncash1-17/+0
Moves the memory writes directly into QueryProcessMemory instead of letting the wrapper function do it. It would be inaccurate to allow the handler to do it because there's cases where memory shouldn't even be written to. For example, if the given process handle is invalid. HOWEVER, if the memory writing is within the wrapper, then we have no control over if these memory writes occur, meaning in an error case, 68 bytes of memory randomly get trashed with zeroes, 64 of those being written to wherever the memory info address points to, and the remaining 4 being written wherever the page info address points to. One solution in this case would be to just conditionally check within the handler itself, but this is kind of smelly, given the handler shouldn't be performing conditional behavior itself, it's a behavior of the managed function. In other words, if you remove the handler from the equation entirely, does the function still retain its proper behavior? In this case, no. Now, we don't potentially trash memory from this function if an invalid query is performed.
2018-12-12svc_wrap: Correct register index for a wrapper specializationLioncash1-1/+1
This would result in svcSetMemoryAttribute getting the wrong value for its third parameter. This is currently fine, given the service function is stubbed, however this will be unstubbed in a future change, so this needs to change.
2018-12-12vm_manager: Migrate memory querying to the VMManager interfaceLioncash1-1/+1
Gets rid of the need to directly access the managed VMAs outside of the memory manager itself just for querying memory.
2018-12-12vm_manager: Migrate MemoryInfo and PageInfo to vm_manager.hLioncash1-1/+1
Gets the two structures out of an unrelated header and places them with the rest of the memory management code. This also corrects the structures. PageInfo appears to only contain a 32-bit flags member, and the extra padding word in MemoryInfo isn't necessary.
2018-12-04kernel/svc: Implement svcCreateEvent()Lioncash1-0/+13
svcCreateEvent operates by creating both a readable and writable event and then attempts to add both to the current process' handle table. If adding either of the events to the handle table fails, then the relevant error from the handle table is returned. If adding the readable event after the writable event to the table fails, then the writable event is removed from the handle table and the relevant error from the handle table is returned. Note that since we do not currently test resource limits, we don't check the resource limit table yet.
2018-11-27svc: Implement svcCreateResourceLimit()Lioncash1-0/+8
This function simply creates a ResourceLimit instance and attempts to create a handle for it within the current process' handle table. If the kernal fails to either create the ResourceLimit instance or create a handle for the ResourceLimit instance, it returns a failure code (OUT_OF_RESOURCE, and HANDLE_TABLE_FULL respectively). Finally, it exits by providing the output parameter with the handle value for the ResourceLimit instance and returning that it was successful. Note: We do not return OUT_OF_RESOURCE because, if yuzu runs out of available memory, then new will currently throw. We *could* allocate the kernel instance with std::nothrow, however this would be inconsistent with how all other kernel objects are currently allocated.
2018-11-03Stubbed SetMemoryPermissionFrederic Laing1-0/+5
2018-10-13svc: Implement svcGetProcessInfoLioncash1-0/+8
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.
2018-10-10Changed all casts in svc_wrap.h to be static_cast insteadDavid Marcec1-25/+28
2018-10-10Fixed incorrect types for svcBreakDavid Marcec1-0/+5
svcBreak reason should be a u32, not a u64.
2018-09-30kernel/svc: Implement svcGetThreadContext()Lioncash1-0/+5
Now that we have all of the rearranging and proper structure sizes in place, it's fairly trivial to implement svcGetThreadContext(). In the 64-bit case we can more or less just write out the context as is, minus some minor value sanitizing. In the 32-bit case we'll need to clear out the registers that wouldn't normally be accessible from a 32-bit AArch32 exectuable (or process).
2018-09-18svc_wrap: Convert the PARAM macro into a functionLioncash1-37/+36
This can just be a regular function, getting rid of the need to also explicitly undef the define at the end of the file. Given FuncReturn() was already converted into a function, it's #undef can also be removed.
2018-09-12svc: Correct parameter type for OutputDebugString()Lioncash1-2/+2
This should be a u64 to represent size.
2018-06-22Add additional missing format.Michael Scire1-2/+6
2018-06-21Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs.Michael Scire1-0/+10
2018-05-11core: Implement multicore support.bunnei1-12/+12
2018-04-03svc: Stub out SetThreadActivity, GetThreadContext.bunnei1-0/+5
2018-03-30svc: Stub GetThreadCoreMask.bunnei1-0/+15
2018-02-25Add UnmapSharedMemoryN00byKing1-0/+5
C++11 requires spaces on the Identifier Add inttypes include clang
2018-01-20Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113)David1-0/+9
* Added svcCreateSharedMemory * Services which are not implemented now throw UNIMPLEMENTED() * clang-format * changed perms to u32 * removed camelcase
2018-01-14svc: Implement svcMapSharedMemory.bunnei1-0/+5
2018-01-13yuzu: Update license text to be consistent across project.bunnei1-1/+1
2018-01-12svc: Implement GetSystemTick.bunnei1-0/+8
2018-01-11svc: Stub ResetSignal and CreateTransferMemorySubv1-0/+8
2018-01-11svc: Stub SetMemoryAttributeSubv1-0/+6
2018-01-09SVC: Fixed WaitSynchronization with multiple handles when at least one of them is ready.Subv1-2/+5
2018-01-09kernel: Rename Semaphore to ConditionVariable.bunnei1-1/+1
2018-01-07svc: Implement svcSignalProcessWideKey.bunnei1-2/+2
2018-01-06svc: Implement svcWaitProcessWideKeyAtomic.bunnei1-0/+5
2018-01-03hle: Move SVC code to kernel namespace.bunnei1-22/+22
2017-12-31function_wrappers: Cleanup, fix warnings, remove unused code.bunnei1-187/+35
2017-12-29svc: Implement MapMemory.bunnei1-0/+5
2017-12-28svc: Implement SetHeapSize.bunnei1-2/+10
2017-10-23svc: Implement GetThreadId and GetProcessId.bunnei1-0/+8
2017-10-20hle: Fix QueryMemory response for MemoryInfo.bunnei1-15/+3
2017-10-04SVC: Remove GetPointer usage in CreatePort.Subv1-4/+2
2017-10-04SVC: Replace GetPointer usage with ReadCString in ConnectToPort.Subv1-15/+0
2017-10-04SVC: Replace GetPointer usage with ReadBlock in OutputDebugString.Subv1-2/+2
2017-10-04SVC: Replace GetPointer usage with Read32 in ReplyAndReceive.Subv1-3/+2
2017-10-04SVC: Replace GetPointer usage with Read32 in WaitSynchronizationN.Subv1-4/+4
2017-09-30arm: Use 64-bit addressing in a bunch of places.bunnei1-1/+1
2017-06-26Kernel/SVC: Partially implemented svcReplyAndReceive.Subv1-10/+13
It behaves mostly as WaitSynchronizationN with wait_all = false, except for IPC buffer translation. The target thread of an IPC response will now wake up when responding. IPC buffer translation is currently not implemented. Error passing back to svcSendSyncRequest is currently not implemented.
2017-06-23Kernel: Fix SVC wrapper for CreatePortYuri Kunde Schlesner1-3/+2
The return parameters were flipped.
2017-06-22Kernel: Implement CreateSession SVCYuri Kunde Schlesner1-0/+10
2017-05-25Kernel: Centralize error definitions in errors.hYuri Kunde Schlesner1-1/+1
2017-04-01Fix OutputDebugString syscallMichael Theall1-2/+2
2016-12-22core: Replace "AppCore" nomenclature with just "CPU".bunnei1-30/+30
2016-12-22core: Remove HLE module, consolidate code & various cleanups.bunnei1-8/+8
2016-12-22core: Consolidate core and system state, remove system module & cleanups.bunnei1-30/+30
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-1/+1
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-35/+68
2016-06-11Kernel/SVC: Implemented svcCreatePort.Subv1-0/+10
2016-05-13Kernel/SVC: Fixed the register order for svcCreateMemoryBlock.Subv1-1/+2
R0 is used as the last parameter instead of R4.
2016-03-13svc: Move ResetType enum to the kernel event headerLioncash1-0/+1
2016-01-14HLE/SVC: Implement UnmapMemoryBlock.Subv1-0/+4
This implementation will need to be (almost completely) changed when we implement multiprocess support.
2015-12-01Kernel: Implement svcGetSystemInfoYuri Kunde Schlesner1-0/+8
This makes smealum/ctrulib@b96dd51d3349961189d4ab1bc2a5c45deff21c09 work with Citra.
2015-08-16Kernel: Implement svcGetProcessInfo in a basic wayYuri Kunde Schlesner1-0/+8
This also adds some basic memory usage accounting. These two types are used by Super Smash Bros. during startup.
2015-07-17Kernel/SVC: Implemented svcQueryProcessMemorySubv1-0/+12
2015-07-17Kernel/SVC: Implemented svcQueryMemory.Subv1-2/+10
2015-07-17Core\HLE : Fix Warningzawata1-1/+1
"signed/unsigned mismatch"
2015-06-17kernel: Fix svcWaitSynch to always acquire requested wait objects.bunnei1-3/+14
2015-05-17Implement svcBreakarchshift1-0/+4
2015-05-15Core/ResourceLimits: Implemented the basic structure of ResourceLimits.Subv1-2/+2
Implemented svcs GetResourceLimit, GetResourceLimitCurrentValues and GetResourceLimitLimitValues. Note that the resource limits do not currently keep track of used objects, since we have no way to distinguish between an object created by the application, and an object created by some HLE module once we're inside Kernel::T::Create.
2015-05-15Memmap: Re-organize memory function in two filesYuri Kunde Schlesner1-3/+3
memory.cpp/h contains definitions related to acessing memory and configuring the address space mem_map.cpp/h contains higher-level definitions related to configuring the address space accoording to the kernel and allocating memory.
2015-04-10Thread: Implement priority boost for starved threads.bunnei1-0/+7
SVC: Return correct error code on invalid CreateThread processor ID. SVC: Assert when creating a thread with an invalid userland priority.
2015-01-30SVC: Use CASCADE_RESULT in SVC handlersYuri Kunde Schlesner1-4/+0
2015-01-30SVC: Change return type of handlers to ResultCodeYuri Kunde Schlesner1-42/+37
2015-01-09Move ThreadContext to core/core.h and deal with the falloutYuri Kunde Schlesner1-0/+2
2015-01-09SVC: Implemented the Timer service calls.Subv1-0/+6
2014-12-31SOC_U: Preliminary implementation of sockets.Subv1-0/+7
Stubbed CreateMemoryBlock Using Berkeley sockets, and Winsock2.2 on Windows. So far ftpony creates the socket and accepts incoming connections SOC_U: Renamed functions to maintain consistency Also prevents possible scope errors / conflicts with the actual Berkeley socket functions SOCU: Close all the opened sockets when cleaning up SOCU
2014-12-21License changepurpasmart961-1/+1
2014-12-13SVC: Implemented ReleaseSemaphore.Subv1-0/+7
This behavior was tested on hardware, however i'm still not sure what use the "initial_count" parameter has
2014-12-13SVC: Implemented svcCreateSemaphoreSubv1-0/+7
ToDo: Implement svcReleaseSemaphore * Some testing against hardware needed
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generatedEmmanuel Gil Peyrot1-2/+2
2014-08-19SVC: Added support for svc_GetSystemTick.bunnei1-18/+42
Changed HLE function return methods to be static inline functions.
2014-07-08function_wrappers: Fixed incorrect wrapper, added another.bunnei1-2/+9
2014-06-13HLE: Moved "PARAM" and "RETURN" macros to function_wrappers.h (this is only module where they are needed).bunnei1-0/+6
2014-06-13SVC: Renamed all function wrapper templates to Wrap, moved to HLE namespace.bunnei1-31/+19
2014-06-13SVC: Cleaned up function wrappers to pass in correct argument types.bunnei1-722/+63
2014-06-02svc: updated WaitSynchronizationN to properly use first pointer argumentbunnei1-1/+3
2014-06-02svc: cleaned up function_wrappers, updated various SVCs to make use of pointer argumentsbunnei1-15/+22
2014-06-01svc: added missing function wrapper for SleepThreadbunnei1-0/+4
2014-05-30svc: added svcClearEvent, stubbed function for svcArbitrateAddress, and various fixesbunnei1-0/+6
- force kernel reschedule after svcWaitSynchronization - fixed some bugs with passing in pointer arguments - cleaned up some comments and log messages
2014-05-29hle: properly cast 64-bit function wrapper parameters to (u64)bunnei1-2/+2
2014-05-29hle: removed PARAM64 macro (this was incorrect), made several bug fixes accordingly for decoding U64 function parametersbunnei1-2/+2
2014-05-18added stubbed function for WaitSynchronizationNbunnei1-1/+6
2014-05-16- added SVC stubs for QueryMemory and GetThreadIdbunnei1-0/+5
- added SVC structs MemoryInfo and PageInfo
2014-05-14added CreateThread, CreateMutex, and ReleaseMutex SVC stubs (just parameter decoding for now)bunnei1-1/+1
2014-05-07- added debug logging to syscall.cppbunnei1-1/+11
- added stubbed HLE syscall functions for svc_GetResourceLimit and svc_GetResourceLimitCurrentValues
2014-05-02- added some function wrappers for HLEbunnei1-8/+12
- added stub for SVC CreateAddressArbiter - added OutputDebugString SVC
2014-04-28Problematic template functionsarchshift1-15/+0
2014-04-17added a new function wrapperbunnei1-0/+5
2014-04-17- fixed tabs in function_wrappers.hbunnei1-268/+273
- fixed log message wording in hle.cpp - added syscall stubs for CloseHandle and WaitSynchronization1
2014-04-11added initial modules for setting up SysCall HLEbunnei1-0/+726