aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1687 from lioncash/deduplicationbunnei2018-11-152-37/+13
|\ | | | | kernel/thread: Deduplicate scheduler switching code
| * kernel/thread: Deduplicate scheduler switching codeLioncash2018-11-142-37/+13
| | | | | | | | | | The code in both places was the same verbatim, so we can extract it to a function to deduplicate the logic.
* | Merge pull request #1679 from DarkLordZach/deterministic-rng-2bunnei2018-11-143-1/+27
|\ \ | | | | | | svc: Use proper random entropy generation algorithm
| * | svc: Use proper random entropy generation algorithmZach Hilman2018-11-133-1/+27
| |/
* | vm_manager: Unstub GetTotalHeapUsage()Lioncash2018-11-131-2/+1
| | | | | | | | | | | | Now that we've moved all of the heap-related stuff to the VMManager class, we can unstub this function, as the necessary members are visible now.
* | kernel/process: Migrate heap-related memory management out of the process ↵Lioncash2018-11-134-84/+97
|/ | | | | | | class and into the vm manager Avoids a breach of responsibilities in the interface and keeps the direct code for memory management within the VMManager class.
* svc: Return random seed for svcGetInfo RandomEntropyZach Hilman2018-11-121-1/+2
|
* svcBreak now dumps information from the debug buffer passed (#1646)David2018-11-071-0/+28
| | | | | | | | * 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
* general: Remove unused boost inclusions where applicableLioncash2018-10-301-2/+0
| | | | Cleans up unused includes and trims off some dependencies on externals.
* global: Use std::optional instead of boost::optional (#1578)Frederic L2018-10-301-4/+4
| | | | | | | | | | | | | | | | * get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
* Merge pull request #1621 from lioncash/ipcbunnei2018-10-292-4/+8
|\ | | | | hle_ipc: Make GetDomainMessageHeader return a regular pointer
| * hle_ipc: Add member function for querying the existence of a domain headerLioncash2018-10-292-1/+5
| | | | | | | | Gets rid of the need to call the getter and then check for null.
| * hle_ipc: Make GetDomainMessageHeader return a regular pointerLioncash2018-10-292-3/+3
| | | | | | | | | | Nothing requires the shared owner ship here, so we can just return a plain pointer.
* | core: Make System references const where applicableLioncash2018-10-282-3/+3
|/
* svc: Localize the GetInfo enum class to the function itselfLioncash2018-10-262-32/+31
| | | | Nothing from this enum is intended to be used outside of this function.
* svc: Implement svcGetInfo command 0xF0000002Lioncash2018-10-266-4/+98
| | | | | | | | | | 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; }
* process: LoadModule should clear JIT instruction cache.bunnei2018-10-251-0/+6
|
* Kernel/Memory: Added a function to first a suitable guest address at which ↵bunnei2018-10-252-0/+28
| | | | to allocate a region of a given size.
* kernel/errors: Remove now-unused, unnecessary, error codesLioncash2018-10-241-8/+0
| | | | | | 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.
* kernel/shared_memory: Return ERR_INVALID_MEMORY_PERMISSIONS instead of ↵Lioncash2018-10-241-4/+3
| | | | | | ERR_INVALID_COMBINATION This is more consistent with what the kernel does.
* kernel/server_port: Simplify emptiness check within ShouldWait()Lioncash2018-10-241-1/+1
|
* kernel/server_port: Change error case return value in Accept() to ERR_NOT_FOUNDLioncash2018-10-242-3/+1
| | | | This is what the kernel does in this instance.
* kernel/error: Remove leftover 3DS error codesLioncash2018-10-241-5/+0
| | | | These are now entirely unused and can be removed.
* kernel/svc: Amend returned error code for invalid priorities in CreateThreadLioncash2018-10-241-1/+1
| | | | | Like with the previous change, the kernel doesn't return NOT_AUTHORIZED here. It returns INVALID_THREAD_PRIORITY.
* kernel/svc: Move and correct returned error code for invalid thread ↵Lioncash2018-10-241-5/+6
| | | | | | | | 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.
* kernel/error: Add error code for invalid pointersLioncash2018-10-241-1/+1
| | | | | The kernel appears to return 0xE601 for this situation. Particularly in svcWaitSynchronization, svcReplyAndReceive, and svcGetThreadContext
* kernel/error: Add error code for closed sessionsLioncash2018-10-241-1/+3
| | | | The kernel appears to return 0xF601 for this case.
* Merge pull request #1551 from ogniK5377/improved-svcbreakbunnei2018-10-231-5/+51
|\ | | | | Added break types to svcBreak
| * Added assertion failed, reworked logging levelsDavid Marcec2018-10-231-16/+24
| |
| * Added break types to svcBreakDavid Marcec2018-10-231-4/+42
| | | | | | | | 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
* | Merge pull request #1540 from lioncash/handlebunnei2018-10-238-98/+95
|\ \ | |/ |/| kernel/process: Make the handle table per-process
| * kernel/process: Make the handle table per-processLioncash2018-10-208-98/+95
| | | | | | | | | | | | | | | | 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.
* | svc: Fix vma boundary check in svcQueryMemoryLioncash2018-10-201-1/+1
|/ | | | | | 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.
* Merge pull request #1520 from lioncash/sanbunnei2018-10-193-3/+50
|\ | | | | svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
| * svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemoryLioncash2018-10-183-3/+50
| | | | | | | | | | | | | | | | 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.
* | svc: Check for word alignment of addresses within ↵Lioncash2018-10-181-0/+8
| | | | | | | | | | | | | | svcArbitrateLock/svcArbitrateUnlock The kernel itself checks whether or not the provided addresses are word aligned before continuing, so we should be doing the same.
* | common: Move Is4KBAligned() to alignment.hLioncash2018-10-181-9/+7
|/ | | | | 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.
* Merge pull request #1498 from lioncash/aslrbunnei2018-10-174-28/+44
|\ | | | | svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
| * svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in ↵Lioncash2018-10-144-28/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrsLioncash2018-10-154-15/+15
|/
* Merge pull request #1492 from lioncash/procbunnei2018-10-143-4/+50
|\ | | | | svc: Implement svcGetProcessInfo
| * svc: Implement svcGetProcessInfoLioncash2018-10-133-4/+50
| | | | | | | | | | | | | | 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.
* | Stop all threads on svcBreakDavid Marcec2018-10-141-0/+6
|/ | | | 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)
* Merge pull request #1483 from lioncash/codesetbunnei2018-10-124-40/+14
|\ | | | | kernel/process: Make CodeSet a regular non-inherited object
| * kernel/process: Make CodeSet a regular non-inherited objectLioncash2018-10-124-40/+14
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #1481 from lioncash/typobunnei2018-10-121-3/+3
|\ \ | | | | | | svc: Fix typos in sanitizing checks for MapMemory/UnmapMemory
| * | svc: Fix typos in sanitizing checks for MapMemory/UnmapMemoryLioncash2018-10-121-3/+3
| |/
* | Merge pull request #1467 from ogniK5377/svcbreak-type-fixbunnei2018-10-122-28/+36
|\ \ | | | | | | Fixed incorrect types for svcBreak
| * | Changed all casts in svc_wrap.h to be static_cast insteadDavid Marcec2018-10-101-25/+28
| | |
| * | Use a better name than "dont_kill_application"David Marcec2018-10-101-2/+2
| | | | | | | | | | | | signal_debugger seems like a more fitting name