aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
AgeCommit message (Collapse)Author
2018-11-26Changed logging to be "Log before execution", Added more error logging, all ↵David Marcec
services should now log on some level
2018-11-25svc: Return ERR_INVALID_ENUM_VALUE from svcGetInfoLuke Street
2018-11-22scheduler: Add explanations for YieldWith and WithoutLoadBalancingZach Hilman
2018-11-20Merge pull request #1734 from lioncash/sharedbunnei
kernel/shared_memory: Make data members private, plus minor interface changes
2018-11-20Merge pull request #1667 from DarkLordZach/swkbdbunnei
am: Implement HLE software keyboard applet
2018-11-19kernel/resource_limit: Clean up interfaceLioncash
Cleans out the citra/3DS-specific implementation details that don't apply to the Switch. Sets the stage for implementing ResourceLimit instances properly. While we're at it, remove the erroneous checks within CreateThread() and SetThreadPriority(). While these are indeed checked in some capacity, they are not checked via a ResourceLimit instance. In the process of moving out Citra-specifics, this also replaces the system ResourceLimit instance's values with ones from the Switch.
2018-11-19kernel/shared_memory: Make Map() and Unmap() take the target process by ↵Lioncash
reference rather than as a pointer Both member functions assume the passed in target process will not be null. Instead of making this assumption implicit, we can change the functions to be references and enforce this at the type-system level.
2018-11-18svc: Implement yield types 0 and -1Zach Hilman
2018-11-18Merge pull request #1728 from FearlessTobi/reset-signalMat M
svc: ResetSignal is not stubbed
2018-11-18svc: ResetSignal is not stubbedTobias
https://user-images.githubusercontent.com/20753089/48677874-b8e01c80-eb7b-11e8-8043-b99faa29022c.PNG
2018-11-18am: Deglobalize software keyboard appletZach Hilman
2018-11-18svc: Implement svcCreateTransferMemoryZach Hilman
Seems to be used and created identically to SharedMemory, so just reuse that.
2018-11-16kernel/errors: Clean up error codesLioncash
Similar to PR 1706, which cleans up the error codes for the filesystem code, but done for the kernel error codes. This removes the ErrCodes namespace and specifies the errors directly. This also fixes up any straggling lines of code that weren't using the named error codes where applicable.
2018-11-16Merge pull request #1638 from FreddyFunk/SetMemoryPermission-StubbedMat M
Implement SetMemoryPermission
2018-11-13svc: Use proper random entropy generation algorithmZach Hilman
2018-11-12svc: Return random seed for svcGetInfo RandomEntropyZach Hilman
2018-11-07svcBreak now dumps information from the debug buffer passed (#1646)David
* svcBreak now dumps information from the debug buffer passed info1 and info2 seem to somtimes hold an address to a buffer, this is usually 4 bytes or the size of the int and contains an error code. There's other circumstances where it can be something different so we hexdump these to examine them at a later date. * Addressed comments
2018-11-06Implement SetMemoryPermissionFrederic Laing
2018-11-03Stubbed SetMemoryPermissionFrederic Laing
2018-10-28core: Make System references const where applicableLioncash
2018-10-26svc: Localize the GetInfo enum class to the function itselfLioncash
Nothing from this enum is intended to be used outside of this function.
2018-10-26svc: Implement svcGetInfo command 0xF0000002Lioncash
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; }
2018-10-24kernel/svc: Amend returned error code for invalid priorities in CreateThreadLioncash
Like with the previous change, the kernel doesn't return NOT_AUTHORIZED here. It returns INVALID_THREAD_PRIORITY.
2018-10-24kernel/svc: Move and correct returned error code for invalid thread ↵Lioncash
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.
2018-10-23Merge pull request #1551 from ogniK5377/improved-svcbreakbunnei
Added break types to svcBreak
2018-10-23Merge pull request #1540 from lioncash/handlebunnei
kernel/process: Make the handle table per-process
2018-10-23Added assertion failed, reworked logging levelsDavid Marcec
2018-10-23Added break types to svcBreakDavid Marcec
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
2018-10-20kernel/process: Make the handle table per-processLioncash
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.
2018-10-20svc: Fix vma boundary check in svcQueryMemoryLioncash
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.
2018-10-19Merge pull request #1520 from lioncash/sanbunnei
svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
2018-10-18svc: Check for word alignment of addresses within ↵Lioncash
svcArbitrateLock/svcArbitrateUnlock The kernel itself checks whether or not the provided addresses are word aligned before continuing, so we should be doing the same.
2018-10-18common: Move Is4KBAligned() to alignment.hLioncash
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.
2018-10-18svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemoryLioncash
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.
2018-10-17Merge pull request #1498 from lioncash/aslrbunnei
svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
2018-10-15core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash
2018-10-14svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in ↵Lioncash
svcGetInfo() 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.
2018-10-14Merge pull request #1492 from lioncash/procbunnei
svc: Implement svcGetProcessInfo
2018-10-14Stop all threads on svcBreakDavid Marcec
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)
2018-10-13svc: Implement svcGetProcessInfoLioncash
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-12Merge pull request #1481 from lioncash/typobunnei
svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory
2018-10-12Merge pull request #1467 from ogniK5377/svcbreak-type-fixbunnei
Fixed incorrect types for svcBreak
2018-10-12svc: Fix typos in sanitizing checks for MapMemory/UnmapMemoryLioncash
2018-10-10svc: Add missing address range sanitizing checks to MapMemory/UnmapMemoryLioncash
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.
2018-10-10kernel/thread: Use a regular pointer for the owner/current processLioncash
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).
2018-10-10Use a better name than "dont_kill_application"David Marcec
signal_debugger seems like a more fitting name
2018-10-10Fixed incorrect types for svcBreakDavid Marcec
svcBreak reason should be a u32, not a u64.
2018-10-09Added bitfield instead of manually checking if the bit is setDavid Marcec
2018-10-09Actual kill execution when the bit isn't set, not the other way aroundDavid Marcec
2018-10-09svcBreak, Signalling to the debugger should not kill executionDavid Marcec
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.