summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* core: refactor emulated cpu core activationLiam2023-12-041-1475/+1480
|
* kernel: update KProcessLiam2023-10-221-1/+1
|
* kernel: prefer std::addressofLiam2023-03-131-90/+90
|
* svc: Fix type consistency (exposed on macOS)Merry2023-02-211-8/+8
|
* kernel: use GetCurrentProcessLiam2023-02-131-1/+1
|
* kernel/svc: switch to generated wrappersLiam2023-02-071-429/+4415
|
* kernel/svc: Split implementations into separate filesLiam2023-02-051-2683/+3
|
* kernel: KPageTable: updateLiam2023-01-221-2/+2
|
* Revert "Revert "k_page_group: synchronize""bunnei2023-01-081-1/+1
|
* Revert "k_page_group: synchronize"gidoly2022-12-291-1/+1
|
* k_page_group: synchronizeLiam2022-12-251-1/+1
|
* kernel: svc: Fix duplicated InfoType enumNarr the Reg2022-12-151-90/+47
|
* kernel: process: Implement GetFreeThreadCountNarr the Reg2022-12-151-1/+14
| | | | Used by Just Dance® 2023 Edition
* kernel: implement FlushProcessDataCacheLiam2022-11-121-8/+18
|
* kernel/svc_types: refreshLiam2022-11-101-69/+48
|
* Merge pull request #9173 from bunnei/kern-update-15liamwhite2022-11-051-1/+1
|\ | | | | Kernel: Various updates for FW 15.0.x
| * core: hle: kernel: Add KEventInfo.bunnei2022-11-041-1/+1
| |
* | kernel: fix port trackingLiam2022-10-311-1/+0
| |
* | kernel: invert session request handling flowLiam2022-10-311-2/+4
|/
* general: Enforce C4800 everywhere except in video_coreMorph2022-10-221-2/+2
|
* core: hle: kernel: k_process: Improve management of page table & cleanup.bunnei2022-10-191-1/+1
|
* core: hle: kernel: k_process: Change Status -> State.bunnei2022-10-191-2/+2
|
* Merge pull request #9061 from liamwhite/writable-eventliamwhite2022-10-141-13/+12
|\ | | | | kernel: remove KWritableEvent
| * kernel: remove KWritableEventLiam2022-10-131-13/+12
| |
* | k_server_session: preliminary support for userspace server sessionsLiam2022-10-121-14/+68
| |
* | Add implementation of svcCreateSessionLiam2022-10-121-1/+89
|/
* kernel: use KScheduler from mesosphereLiam2022-07-151-6/+1
|
* Merge pull request #8512 from german77/nnResultMorph2022-06-291-150/+144
|\ | | | | Replace multiple names with a better name
| * core: kernel: Replace instances of KPageLinkedList with KPageGroupgerman772022-06-271-1/+1
| |
| * core: Replace all instances of ResultCode with Resultgerman772022-06-271-149/+143
| |
* | Merge pull request #8504 from comex/mesosphere-current-processbunnei2022-06-271-0/+24
|\ \ | |/ |/| Support `InfoType_MesosphereCurrentProcess`
| * Re-add missing `case` and braces, and trim whitespacecomex2022-06-261-1/+3
| |
| * Update src/core/hle/kernel/svc.cppcomex2022-06-261-6/+14
| | | | | | Co-authored-by: liamwhite <liamwhite@users.noreply.github.com>
| * Support InfoType_MesosphereCurrentProcesscomex2022-06-261-0/+14
| |
* | kernel: make current thread pointer thread localLiam2022-06-231-7/+6
|/
* Implement ExitProcess svcNikita Strygin2022-06-161-1/+2
| | | | | | | Currently this just stops all the emulation This works under assumption that only application will try to use ExitProcess, with services not touching it If application exits - it quite makes sense to end the emulation
* Merge pull request #8457 from liamwhite/kprocess-suspendFernando S2022-06-161-1/+1
|\ | | | | kernel: implement KProcess suspension
| * kernel: implement KProcess suspensionLiam2022-06-141-1/+1
| |
* | Merge pull request #8464 from liamwhite/break-debugMai2022-06-151-0/+7
|\ \ | | | | | | kernel: notify debugger on break SVC
| * | kernel: notify debugger on break SVCLiam2022-06-151-0/+7
| |/
* / core: centralize profile scope for DynarmicLiam2022-06-151-3/+0
|/
* common: Change semantics of UNREACHABLE to unconditionally crashLiam2022-06-141-1/+1
|
* kernel: svc: Replace -1ULL with 0xFFFFFFFFFFFFFFFFMorph2022-04-241-1/+1
| | | | Resolves the C4146 compiler warning on MSVC.
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-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.
* hle: kernel: Invalidate entire icache in UnmapProcessMemory and UnmapCodeMemory (fixes #8174)tech-ticks2022-04-091-1/+2
|
* hle: kernel: svc: MapProcessMemory: Fix usage of KPageLinkedList to use physical address space.bunnei2022-03-261-2/+5
|
* hle: kernel: svc: CreateCodeMemory: Remove log of 'out' host pointer.bunnei2022-03-261-2/+2
| | | | - This does not seem terribly useful and is inconsistent with other usage.
* hle: kernel: svc: UnmapProcessCodeMemory: Fix inverted alignment check.bunnei2022-03-261-1/+1
|
* core: hle: kernel: KEvent: Pass in owner KProcess on event creation.bunnei2022-02-211-1/+1
| | | | - This is necessary to ensure resource limits are freed from the right process.
* kernel: svc: Add OutputDebugString32, CreateCodeMemory32, ControlCodeMemory32Sergi Granell2022-02-151-4/+18
| | | | | Very straightforward, they are just wrappers to the 64-bit version of the SVC.
* svc: Set unique names for function tablesNarr the Reg2022-02-091-77/+77
|
* service: pm: Implement AtmosphereGetProcessInfotech-ticks2022-02-041-1/+1
|
* svc: Add 32 bit SynchronizePreemptionStateNarr the Reg2022-02-011-1/+1
| | | | Used by Espgaluda II
* core: hle: kernel: Rename Un/Map to Un/MapMeory.bunnei2022-01-221-2/+2
|
* hle: kernel: k_page_table: Update SetProcessMemoryPermission.bunnei2022-01-121-1/+3
|
* hle: kernel: k_page_table: Rename *ProcessCodeMemory -> *CodeMemory.bunnei2022-01-121-2/+2
|
* core: hle: kernel: svc: Updates to SetMemoryAttribute and SetMemoryPermission.bunnei2022-01-081-30/+20
|
* core: hle: kernel: Implement thread pinning.bunnei2021-12-311-1/+20
| | | | | - We largely had the mechanics in place for thread pinning, this change hooks these up. - Validated with tests https://github.com/Atmosphere-NX/Atmosphere/blob/master/tests/TestSvc/source/test_thread_pinning.cpp.
* core: hle: kernel: Updated implementation of svcSetHeapSize.bunnei2021-12-281-16/+7
| | | | | - Updates our svcSetHeapSize with latest HOS, furthermore allowing heap size to properly be extended/shrunk. - Validated with tests https://github.com/Atmosphere-NX/Atmosphere/blob/master/tests/TestSvc/source/test_set_heap_size.cpp.
* core: hle: kernel: Implement SetMemoryPermission.bunnei2021-12-231-1/+31
| | | | - Not seen in any games yet, but validated with kernel tests.
* hle: kernel: svc: GetInfo: Fix error checking with IdleTickCount.bunnei2021-12-221-14/+9
| | | | | - Enforce tha the supplied handle is invalid, not valid. - This gets Witcher 3 booting.
* core: hle: Remove global HLE lock.bunnei2021-12-181-9/+0
| | | | | - This was added early on as a hack to protect against some concurrency issues. - It's not clear that this serves any purpose anymore, and if it does, individual components should be fixed rather than using a global recursive mutex.
* Merge pull request #7462 from bunnei/kernel-improve-schedulingbunnei2021-12-131-15/+20
|\ | | | | Kernel: Improve threading & scheduling V3
| * hle: kernel: svc: Fix deadlock that can occur with single core.bunnei2021-12-071-10/+8
| |
| * hle: kernel: KServerSession: Migrate to updated KThreadQueue.bunnei2021-12-071-3/+10
| |
| * hle: kernel: KThread: Remove tracking of sync object from threads.bunnei2021-12-071-2/+1
| |
| * core: hle: kernel: Reflect non-emulated threads as core 3.bunnei2021-12-071-2/+3
| |
* | kernel: svc: Implement Map/UnmapProcessMemory and Create/ControlCodeMemoryitsmeft242021-12-051-4/+210
|/ | | | Used by Skyline modding framework
* kernel: svc: Move all IsValid functions to an anonymous namespaceMorph2021-11-211-3/+15
|
* kernel: svc: Implement SetProcessMemoryPermissionMorph2021-11-211-1/+41
| | | | - Used by Skyline modding framework
* general: Rename GetTitleID to GetProgramIDMorph2021-11-041-1/+1
|
* core: Remove unused includesameerj2021-11-041-10/+0
|
* svc: Correct WaitSynchronization num_handles param typeMorph2021-11-031-2/+2
| | | | num_handles is a s32
* Merge pull request #7227 from vonchenplus/fix_memory_leak_v2bunnei2021-11-021-0/+6
|\ | | | | Fix memory leak v2
| * Fix memory leakFeng Chen2021-10-271-0/+6
| |
* | SVC: Implement svcInfo:IdleTickCountFernando Sahmkow2021-10-161-0/+17
|/ | | | Used by the Witcher 3
* Fix KScopedAutoObject object leak when SendSyncRequestFeng Chen2021-09-251-6/+8
|
* Revert "kernel: Various improvements to scheduler"bunnei2021-08-261-1/+1
|
* Fix check is thread current in GetThreadContextValeri2021-08-191-1/+1
| | | Misplaced break made it only check for the first core.
* core: hle: kernel: Reflect non-emulated threads as core 3.bunnei2021-08-071-1/+1
|
* hle: kernel: svc: Remove part of ExitProcess.bunnei2021-07-211-5/+0
| | | | - ExitProcess is not actually implemented either way, and this needs more work before we implement.
* kernel: svc: ConnectToNamedPort: Close extra reference to port.bunnei2021-07-211-0/+1
|
* kernel: svc: Add missing error check to CancelSynchronization.bunnei2021-06-101-2/+2
| | | | - Avoids a potential crash if the handle is invalid, and also makes this code accurate to real kernel behavior.
* general: Replace RESULT_SUCCESS with ResultSuccessMorph2021-06-021-52/+52
| | | | Transition to PascalCase for result names.
* core: Make variable shadowing a compile-time errorLioncash2021-05-161-3/+3
| | | | | | Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
* hle: kernel: svc: Update ConnectToNamedPort to use new CreateNamedServicePort interface.bunnei2021-05-111-4/+3
|
* kernel: svc: Remove unused RetrieveResourceLimitValue function.bunnei2021-05-061-32/+0
|
* hle: kernel: svc: ConnectToNamedPort: Use KHandleTable::Reserve.bunnei2021-05-061-3/+8
|
* hle: kernel: Migrate to KHandleTable.bunnei2021-05-061-4/+4
|
* hle: kernel: Improve MapSharedMemory and implement UnmapSharedMemory.bunnei2021-05-061-60/+78
|
* hle: kernel: Rename Process to KProcess.bunnei2021-05-061-15/+15
|
* hle: kernel: Migrate KPort, KClientPort, and KServerPort to KAutoObject.bunnei2021-05-061-9/+13
|
* hle: kernel: Migrate KClientPort to KAutoObject.bunnei2021-05-061-1/+1
|
* hle: kernel: HandleTable: Remove deprecated APIs.bunnei2021-05-061-1/+1
|
* hle: kernel: Migrate KResourceLimit to KAutoObject.bunnei2021-05-061-63/+64
|
* hle: kernel: svc: Migrate WaitSynchronization.bunnei2021-05-061-47/+23
|
* hle: kernel: svc: Use new handle table API for Process.bunnei2021-05-061-13/+12
|
* hle: kernel: Migrate KTransferMemory to KAutoObject.bunnei2021-05-061-45/+48
|
* hle: kernel: Migrate KSession, KClientSession, and KServerSession to KAutoObject.bunnei2021-05-061-10/+8
|
* hle: kernel: svc: Migrate GetThreadContext, GetThreadCoreMask.bunnei2021-05-061-2/+59
|
* hle: kernel: svc: Migrate GetProcessId, CancelSynchronization, SetThreadActivity.bunnei2021-05-061-13/+67
|
* hle: kernel: svc_results: Update naming..bunnei2021-05-061-19/+19
|
* hle: kernel: Migrate KReadableEvent and KWritableEvent to KAutoObject.bunnei2021-05-061-38/+32
|
* hle: kernel: Refactor several threads/events/sharedmemory to use slab heaps.bunnei2021-05-061-2/+2
|
* hle: kernel: Migrate KEvent to KAutoObject.bunnei2021-05-061-6/+3
|
* hle: kernel: Migrate KSharedMemory to KAutoObject.bunnei2021-05-061-12/+9
|
* hle: kernel: Migrate KProcess to KAutoObject.bunnei2021-05-061-3/+3
|
* hle: kernel: Refactor IPC interfaces to not use std::shared_ptr.bunnei2021-05-061-1/+1
|
* hle: kernel: Migrate more of KThread to KAutoObject.bunnei2021-05-061-200/+68
|
* hle: kernel: svc: Migrate GetThreadPriority, StartThread, and ExitThread.bunnei2021-05-061-21/+12
|
* hle: kernel: svc: Migrate CreateThread.bunnei2021-05-061-14/+21
|
* k_resource_limit: Minor cleanup of member variables/headersameerj2021-04-141-1/+1
|
* svc: Expand SVC tablesLioncash2021-04-071-0/+132
| | | | | 12.x expanded the range of SVC entries from 0x7F to 0xBF (with all new entries being unused), so we can expand it to also match.
* hle: kernel: KThread: Rework dummy threads & fix memory leak.bunnei2021-03-061-2/+3
| | | | | - Dummy threads are created on thread local storage for all host threads. - Fixes a leak by removing creation of fibers, which are not applicable here.
* Revert "core: Switch to unique_ptr for usage of Common::Fiber."bunnei2021-03-061-1/+2
|
* core: Switch to unique_ptr for usage of Common::Fiber.bunnei2021-02-271-2/+1
| | | | | - With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
* hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable.bunnei2021-02-191-3/+3
|
* hle: kernel: Migrate to KMemoryBlock, KMemoryBlockManager, and others.bunnei2021-02-191-14/+14
|
* hle: kernel: Migrate MemoryLayout to KMemoryLayout.bunnei2021-02-191-7/+6
|
* hle: kernel: Rename SharedMemory to KSharedMemory.bunnei2021-02-191-2/+2
|
* kernel: More accurately reserve and release resourcesameerj2021-02-131-8/+13
|
* kernel: KScopedReservation implementationameerj2021-02-131-3/+30
| | | | This implements KScopedReservation, allowing resource limit reservations to be more HW accurate, and release upon failure without requiring too many conditionals.
* kernel: Unify result codes (#5890)Chloe2021-02-131-98/+98
| | | | | | | | | * kernel: Unify result codes Drop the usage of ERR_NAME convention in kernel for ResultName. Removed seperation between svc_results.h & errors.h as we mainly include both most of the time anyways. * oops * rename errors to svc_results
* svc: Provide more detailed error logs for svc functionsLioncash2021-02-061-59/+188
| | | | | Allows SVC calls to have much more informative information during error cases. This also doesn't hide control flow returns from the reader.
* hle: kernel: svc: Cleanup KEvent/KReadableEvent/KWritableEvent SVCs.bunnei2021-02-051-57/+78
|
* hle: kernel: Reimplement KReadableEvent and KWritableEvent.bunnei2021-02-051-4/+5
|
* hle: kernel: Rename WritableEvent to KWritableEvent.bunnei2021-02-051-4/+4
|
* hle: kernel: Rename ReadableEvent to KReadableEvent.bunnei2021-02-051-3/+3
|
* Simplify limitableresource namesChloe Marcec2021-02-031-5/+3
|
* Move to GetGlobalTimeNs, fix GetTotalPhysicalMemoryAvailableChloe Marcec2021-01-301-4/+3
|
* kernel: Rewrite resource limit to be more accurateChloe Marcec2021-01-301-12/+16
| | | | Matches closer to hardware
* hle: kernel: process: Add state lock.bunnei2021-01-291-4/+7
|
* hle: kernel: Recode implementation of KThread to be more accurate.bunnei2021-01-291-203/+152
|
* hle: kernel: KThread: Clean up thread priorities.bunnei2021-01-291-40/+26
|
* hle: kernel: KThread: Reorganize thread priority defaults.bunnei2021-01-291-6/+4
|
* hle: kernel: KThread: Fix ThreadType definition.bunnei2021-01-291-3/+2
|
* core: hle: kernel: Rename Thread to KThread.bunnei2021-01-291-15/+15
|
* hle: kernel: thread: Preserve thread wait reason for debugging only.bunnei2021-01-111-0/+1
| | | | - This is decoupled from core functionality and used for debugging only.
* core: hle: Integrate new KConditionVariable and KAddressArbiter implementations.bunnei2021-01-111-237/+127
|
* hle: kernel: thread: Replace ThreadStatus/ThreadSchedStatus with a single ThreadState.bunnei2021-01-111-6/+5
| | | | - This is how the real kernel works, and is more accurate and simpler.
* core: hle: kernel: Update KSynchronizationObject.bunnei2021-01-111-30/+17
|
* svc: demote SleepThread log to LOG_TRACEameerj2020-12-291-1/+1
| | | | This log is called often, and introduces a lot of noise when debug logging is enabled, making it difficult to see other debug logs.
* Merge pull request #5131 from bunnei/scheduler-rewritebunnei2020-12-211-47/+31
|\ | | | | Rewrite Kernel scheduler based on Atmosphere
| * hle: kernel: Migrate to KScopedSchedulerLock.bunnei2020-12-061-4/+4
| |
| * hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler.bunnei2020-12-061-1/+2
| |
| * hle: kernel: Rewrite scheduler implementation based on Mesopshere.bunnei2020-12-061-31/+26
| |
| * hle: kernel: svc: Remove reschedule on svcBreak.bunnei2020-12-061-5/+0
| | | | | | | | - This breaks things, and is unnecessary, since emulation will be done at this point.
| * hle: kernel: svc: Remove unnecessary hack in svcSleep.bunnei2020-12-061-7/+0
| |
| * hle: kernel: Port KAffinityMask from Mesosphere.bunnei2020-12-061-1/+1
| |
* | svc: Remove unnecessary castsLioncash2020-12-081-35/+25
|/ | | | | | Simplifies and removes some casts. In all cases, these were generally widening from a 32-bit unsigned type to a 64-bit unsigned type, so no information would be lost from the conversion.
* hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.bunnei2020-11-291-0/+9
|
* svc: Remove unnecessary [[maybe_unused]] tagLioncash2020-11-231-1/+1
| | | | | The parameter is used in this function, so this suppression isn't necessary.
* Revert "core: Fix clang build"bunnei2020-10-211-4/+3
|
* core: Fix clang buildLioncash2020-10-181-3/+4
| | | | | | | Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
* kernel: Remove all dependencies on the global system instanceLioncash2020-09-141-1/+1
| | | | | With this, the kernel finally doesn't depend directly on the global system instance anymore.
* kernel: Remove unused variablesLioncash2020-07-161-5/+2
| | | | Resolves some compiler warnings in the Linux build.
* SVC: Implement 32-bits wrappers and update Dynarmic.Fernando Sahmkow2020-06-271-27/+171
|
* SVC: Add GetCurrentProcessorNumber32, CreateTransferMemory32, SetMemoryAttribute32Fernando Sahmkow2020-06-271-6/+23
|
* SVC: Add GetThreadPriority32 & SetThreadPriority32Fernando Sahmkow2020-06-271-2/+12
|
* Common/Kernel: Corrections and small bug fixing.Fernando Sahmkow2020-06-271-2/+2
|
* General: Cleanup legacy code.Fernando Sahmkow2020-06-271-2/+1
|
* Kernel/svcBreak: Implement CacheInvalidation for Singlecore and correct svcBreak.Fernando Sahmkow2020-06-271-2/+2
|
* HLE_IPC: Correct HLE Event behavior on timeout.Fernando Sahmkow2020-06-271-1/+9
|
* SingleCore: Use Cycle Timing instead of Host Timing.Fernando Sahmkow2020-06-271-0/+5
|
* General: Move ARM_Interface into Threads.Fernando Sahmkow2020-06-271-9/+2
|
* SVC/ARM: Correct svcSendSyncRequest and cache ticks on arm interface.Fernando Sahmkow2020-06-271-1/+1
|
* ARM: Addapt to new Exclusive Monitor Interface.Fernando Sahmkow2020-06-271-3/+1
|
* General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running.Fernando Sahmkow2020-06-271-3/+7
|
* Kernel: Rewind on SVC change.Fernando Sahmkow2020-06-271-5/+4
|
* Kernel: Preempt Single core on redudant yields.Fernando Sahmkow2020-06-271-6/+17
|
* Kernel: Fixes, corrections and asserts to scheduler and different svcs.Fernando Sahmkow2020-06-271-13/+14
|
* ARM/Memory: Correct Exclusive Monitor and Implement Exclusive Memory Writes.Fernando Sahmkow2020-06-271-1/+1
|
* SVC: Correct SetThreadActivity.Fernando Sahmkow2020-06-271-4/+1
|
* SVC: Correct svcWaitForAddress and svcSignalToAddress.Fernando Sahmkow2020-06-271-3/+0
|
* Kernel: Corrections to Scheduling.Fernando Sahmkow2020-06-271-1/+0
|
* Core: Correct HLE Event Callbacks and other issues.Fernando Sahmkow2020-06-271-3/+2
|
* General: Add AssertsFernando Sahmkow2020-06-271-0/+1
|
* General: Add better safety for JIT use.Fernando Sahmkow2020-06-271-1/+5
|
* SVC: Correct races on physical core switching.Fernando Sahmkow2020-06-271-5/+4
|
* SVC: Add locks to the memory management.Fernando Sahmkow2020-06-271-0/+21
|
* SVC: Correct WaitSynchronization, WaitProcessWideKey, SignalProcessWideKey.Fernando Sahmkow2020-06-271-27/+48
|
* SVC: Cleanup old methods.Fernando Sahmkow2020-06-271-13/+9
|
* SVC: Correct SendSyncRequest.Fernando Sahmkow2020-06-271-4/+17
|
* SVC: Correct SignalEvent, ClearEvent, ResetSignal, WaitSynchronization, CancelSynchronization, ArbitrateLockFernando Sahmkow2020-06-271-1/+0
|
* SVC: Remove global HLE Lock.Fernando Sahmkow2020-06-271-3/+0
|
* SVC: Correct GetThreadPriority, SetThreadPriority, GetThreadCoreMask, SetThreadCoreMask, GetCurrentProcessorNumberFernando Sahmkow2020-06-271-9/+8
|
* SVC: Correct CreateThread, StartThread, ExitThread, SleepThread.Fernando Sahmkow2020-06-271-13/+5
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-271-15/+6
| | | | | | | This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
* kernel: Don't fail silentlyDavid Marcec2020-04-291-0/+7
|
* kernel: Bad GetInfo ids should not be marked as stubsDavid Marcec2020-04-281-2/+2
| | | | As we currently match hardware and don't return a successful result, these should be marked as errors instead of warnings and as stubs.
* Merge pull request #3780 from lioncash/processbunnei2020-04-251-2/+138
|\ | | | | svc: Re-add MapProcessCodeMemory/UnmapProcessCodeMemory
| * svc: Re-add MapProcessCodeMemory/UnmapProcessCodeMemoryLioncash2020-04-241-2/+138
| | | | | | | | These were lost in the re-implementation of the virtual memory manager.
* | svc: Remove unused variableLioncash2020-04-231-3/+0
|/ | | | Since the VMM refactor, this is no longer used or needed.
* core: hle: Address various feedback & code cleanup.bunnei2020-04-171-1/+1
| | | | - Should be no functional changes.
* kernel: svc: Updates for new VMM.bunnei2020-04-171-488/+116
| | | | - Includes removing some SVC impls. that are untested.
* core: memory: Move to Core::Memory namespace.bunnei2020-04-171-5/+5
| | | | - helpful to disambiguate Kernel::Memory namespace.
* core: kernel: Add svc_types header to include SVC-specific types.bunnei2020-04-171-0/+1
|
* core: kernel: Move SVC to its own namesapce.bunnei2020-04-171-3/+3
|
* core: hle: Implement separate A32/A64 SVC interfaces.bunnei2020-03-031-65/+264
|
* Core: Address FeedbackFernando Sahmkow2020-02-141-1/+1
|
* Kernel: Refactor synchronization to better match REFernando Sahmkow2020-02-111-60/+7
|
* Kernel: Change WaitObject to Synchronization object. In order to better reflect RE.Fernando Sahmkow2020-02-111-6/+7
|
* kernel: transfer_memory: Properly reserve and reset memory region.bunnei2020-02-061-2/+6
|
* Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow2020-01-261-1/+1
| | | | This commit instends on better naming the new purpose of this classes.
* kernel/svc: Correct function signature of SignalProcessWideKeyLioncash2019-12-111-4/+1
| | | | | This function doesn't actually return a result code, so we can amend the signature of it to match.
* kernel/svc: Provide implementations for svcDumpInfo/svcDumpInfoNewLioncash2019-12-081-2/+13
| | | | | | | | | 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.
* kernel: Implement a more accurate IPC dispatch.bunnei2019-11-281-4/+5
|
* core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash2019-11-271-12/+15
| | | | | | | | | The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
* core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash2019-11-271-6/+10
| | | | | | | | | | | | | | With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
* core/memory: Migrate over ReadCString() to the Memory classLioncash2019-11-271-2/+4
| | | | | This only had one usage spot, so this is fairly straightforward to convert over.
* core: Prepare various classes for memory read/write migrationLioncash2019-11-271-1/+1
| | | | | | | | | | Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
* core/memory: Migrate over address checking functions to the new Memory classLioncash2019-11-271-2/+2
| | | | | | | | | A fairly straightforward migration. These member functions can just be mostly moved verbatim with minor changes. We already have the necessary plumbing in places that they're used. IsKernelVirtualAddress() can remain a non-member function, since it doesn't rely on class state in any form.
* kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. (#3154)bunnei2019-11-251-26/+26
| | | | | | * kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for kernel objects. - See https://github.com/citra-emu/citra/pull/4710 for details.
* Update svc.cppbunnei2019-11-231-0/+1
|
* svc: GetSystemTick should return cntpct_el0, not core ticks.bunnei2019-11-231-1/+3
|
* Merge pull request #3114 from FernandoS27/cond-varbunnei2019-11-231-21/+7
|\ | | | | Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
| * Kernel: Optimize condition variable threads management.Fernando Sahmkow2019-11-211-1/+1
| |
| * Kernel: Correct SignalProcessWideKeyFernando Sahmkow2019-11-211-6/+2
| | | | | | | | When the target is 0, all threads must be processed.
| * Kernel: Correct behavior of Condition Variables to be more similar to real hardware.Fernando Sahmkow2019-11-211-15/+5
| | | | | | | | | | | | | | This commit ensures cond var threads act exactly as they do in the real console. The original implementation uses an RBTree and the behavior of cond var threads is that at the same priority level they act like a FIFO.
* | Kernel: Correct Cancel Synchronization.Fernando Sahmkow2019-11-161-0/+5
|/ | | | | | This commit corrects the behavior of cancel synchronization when the thread is running/ready and ensures the next wait is cancelled as it's suppose to.
* kernel: events: Remove ResetType::Automatic.bunnei2019-11-031-1/+1
| | | | | | | | - This does not actually seem to exist in the real kernel - games reset these automatically. # Conflicts: # src/core/hle/service/am/applets/applets.cpp # src/core/hle/service/filesystem/fsp_srv.cpp
* Kernel: Address Feedback.Fernando Sahmkow2019-10-151-6/+6
|
* KernelSVC: Assert that condition variable address is aligned to 4 bytes.Fernando Sahmkow2019-10-151-0/+4
|
* Kernel: Correct redundant yields to only advance time forward.Fernando Sahmkow2019-10-151-3/+5
|
* Kernel: Correct Results in Condition Variables and MutexesFernando Sahmkow2019-10-151-18/+9
|
* Scheduler: Add protections for Yield bombingFernando Sahmkow2019-10-151-4/+9
| | | | | | In case of redundant yields, the scheduler will now idle the core for it's timeslice, in order to avoid continuously yielding the same thing over and over.
* Kernel: Style and CorrectionsFernando Sahmkow2019-10-151-6/+9
|
* Correct PrepareRescheduleFernando Sahmkow2019-10-151-32/+17
|
* Correct Supervisor Calls to work with the new scheduler,Fernando Sahmkow2019-10-151-26/+41
|
* Merge pull request #2687 from lioncash/tls-processbunnei2019-07-181-3/+1
|\ | | | | kernel/process: Allocate the process' TLS region during initialization
| * kernel/process: Allocate the process' TLS region during initializationLioncash2019-07-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | Prior to execution within a process beginning, the process establishes its own TLS region for uses (as far as I can tell) related to exception handling. Now that TLS creation was decoupled from threads themselves, we can add this behavior to our Process class. This is also good, as it allows us to remove a stub within svcGetInfo, namely querying the address of that region.
* | Kernel: Downgrade WaitForAddress and SignalToAddress messages to Trace.Fernando Sahmkow2019-07-181-4/+4
| | | | | | | | | | This messages were originally set as warnning since few games used these svcs and it was needed for debugging. This is no longer the case.
* | Merge pull request #2690 from SciresM/physmem_fixesFernando Sahmkow2019-07-141-16/+101
|\ \ | | | | | | Implement MapPhysicalMemory/UnmapPhysicalMemory
| * | clang-format fixesMichael Scire2019-07-071-2/+1
| | |
| * | address review commentaryMichael Scire2019-07-071-20/+12
| | |
| * | Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire2019-07-071-8/+102
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* / Restore memory perms on svcUnmapMemory/UnloadNroMichael Scire2019-07-111-1/+8
|/ | | | | | | | | | | | | | | | Prior to PR, Yuzu did not restore memory to RW- on unmap of mirrored memory or unloading of NRO. (In fact, in the NRO case, the memory was unmapped instead of reprotected to --- on Load, so it was actually lost entirely...) This PR addresses that, and restores memory to RW- as it should. This fixes a crash in Super Smash Bros when creating a World of Light save for the first time, and possibly other games/circumstances.
* kernel/vm_manager: Rename 'new map' to 'stack'Lioncash2019-07-061-10/+10
| | | | | | Provides a more accurate name for the memory region and also disambiguates between the map and new map regions of memory, making it easier to understand.
* Merge pull request #2482 from DarkLordZach/prepobunnei2019-06-211-1/+7
|\ | | | | core: Add detailed local reporting feature for development
| * svc: Save report on call to svcBreakZach Hilman2019-05-251-1/+7
| |
* | kernel/svc: Implement TotalMemoryUsedWithoutMmHeap/TotalMemoryAvailableWithoutMmHeapLioncash2019-06-101-2/+15
| | | | | | | | | | | | | | | | | | Given we don't currently implement the personal heap yet, the existing memory querying functions are essentially doing what the memory querying types introduced in 6.0.0 do. So, we can build the necessary machinery over the top of those and just use them as part of info types.
* | kernel/svc: Amend naming for TotalMemoryUsage in svcGetInfo()Lioncash2019-06-101-4/+4
| | | | | | | | | | Disambiguates and makes the name a little more consistent with TotalPhysicalMemoryUsed.
* | kernel/svc: Remove duplicate enum entry in svcGetInfo()Lioncash2019-06-101-2/+1
|/
* Merge pull request #2410 from lioncash/affinitybunnei2019-05-191-36/+43
|\ | | | | kernel/svc: Reorganize and fix up the initial handling of svcSetThreadCoreMask()
| * kernel/svc: Make svcCreateThread/svcStartThread/svcSleepThread/svcExitThread calls show up in the debug logLioncash2019-04-291-4/+4
| | | | | | | | | | | | These are actually quite important indicators of thread lifetimes, so they should be going into the debug log, rather than being treated as misc info and delegated to the trace log.
| * kernel/svc: Reorganize svcSetThreadCoreMask()Lioncash2019-04-291-32/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the code much nicer to follow in terms of behavior and control flow. It also fixes a few bugs in the implementation. Notably, the thread's owner process shouldn't be accessed in order to retrieve the core mask or ideal core. This should be done through the current running process. The only reason this bug wasn't encountered yet is because we currently only support running one process, and thus every owner process will be the current process. We also weren't checking against the process' CPU core mask to see if an allowed core is specified or not. With this out of the way, it'll be less noisy to implement proper handling of the affinity flags internally within the kernel thread instances.
| * kernel/thread: Update thread processor ID flagsLioncash2019-04-291-1/+1
| | | | | | | | Adds the missing flags to the enum and documents them.
* | Merge pull request #2486 from lioncash/resetnameSebastian Valle2019-05-191-1/+1
|\ \ | | | | | | core/kernel/object: Rename ResetType enum members for clarity
| * | core/kernel/object: Rename ResetType enum membersLioncash2019-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renames the members to more accurately indicate what they signify. "OneShot" and "Sticky" are kind of ambiguous identifiers for the reset types, and can be kind of misleading. Automatic and Manual communicate the kind of reset type in a clearer manner. Either the event is automatically reset, or it isn't and must be manually cleared. The "OneShot" and "Sticky" terminology is just a hold-over from Citra where the kernel had a third type of event reset type known as "Pulse". Given the Switch kernel only has two forms of event reset types, we don't need to keep the old terminology around anymore.
* | | kernel/svc: Mark GetThreadList() and UnmapProcessCodeMemory() as internally linkedLioncash2019-05-191-4/+4
|/ / | | | | | | | | | | These are only used from within this translation unit, so they don't need to have external linkage. They were intended to be marked with this anyways to be consistent with the other service functions.
* | Merge pull request #2416 from lioncash/waitbunnei2019-04-251-6/+4
|\ \ | | | | | | kernel/svc: Clean up wait synchronization related functionality
| * | kernel/thread: Unify wait synchronization typesLioncash2019-04-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a holdover from Citra, where the 3DS has both WaitSynchronization1 and WaitSynchronizationN. The switch only has one form of wait synchronizing (literally WaitSynchonization). This allows us to throw out code that doesn't apply at all to the Switch kernel. Because of this unnecessary dichotomy within the wait synchronization utilities, we were also neglecting to properly handle waiting on multiple objects. While we're at it, we can also scrub out any lingering references to WaitSynchronization1/WaitSynchronizationN in comments, and change them to WaitSynchronization (or remove them if the mention no longer applies).
| * | kernel/svc: Migrate svcCancelSynchronization behavior to a thread functionLioncash2019-04-171-4/+2
| | | | | | | | | | | | | | | | | | | | | The actual behavior of this function is slightly more complex than what we're currently doing within the supervisor call. To avoid dumping most of this behavior in the supervisor call itself, we can migrate this to another function.
* | | kernel/svc: Name supervisor call 0x36Lioncash2019-04-191-1/+1
| | | | | | | | | | | | | | | This call was added to the SVC handlers in the 8.0.0 kernel, so we can finally give it a name.
* | | Merge pull request #2397 from lioncash/thread-unusedbunnei2019-04-181-8/+10
|\ \ \ | |/ / |/| | kernel/thread: Remove unused guest_handle member variable
| * | svc: Specify handle value in thread's nameLioncash2019-04-151-2/+5
| | | | | | | | | | | | Allows the handle to be seen alongside the entry point.
| * | kernel/thread: Remove unused guest_handle member variableLioncash2019-04-141-6/+5
| |/ | | | | | | | | | | This member variable is entirely unused. It was only set but never actually utilized. Given that, we can remove it to get rid of noise in the thread interface.
* | kernel/svc: Implement svcUnmapProcessCodeMemoryLioncash2019-04-131-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | Essentially performs the inverse of svcMapProcessCodeMemory. This unmaps the aliasing region first, then restores the general traits of the aliased memory. What this entails, is: - Restoring Read/Write permissions to the VMA. - Restoring its memory state to reflect it as a general heap memory region. - Clearing the memory attributes on the region.
* | kernel/svc: Implement svcMapProcessCodeMemoryLioncash2019-04-131-1/+69
|/ | | | | This is utilized for mapping code modules into memory. Notably, the ldr service would call this in order to map objects into memory.
* kernel/svc: Deglobalize the supervisor call handlersLioncash2019-04-081-162/+175
| | | | | | | | | | | 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.
* kernel/svc: Properly sanitize mutex address in WaitProcessWideKeyAtomicLioncash2019-04-041-0/+14
| | | | | | We need to be checking whether or not the given address is within the kernel address space or if the given address isn't word-aligned and bail in these scenarios instead of trashing any kernel state.
* Merge pull request #2305 from lioncash/sharedbunnei2019-04-031-1/+1
|\ | | | | kernel/shared_memory: Sanitize supplied size when unmapping
| * kernel/shared_memory: Sanitize supplied size when unmappingLioncash2019-03-291-1/+1
| | | | | | | | | | | | | | | | The kernel makes sure that the given size to unmap is always the same size as the entire region managed by the shared memory instance, otherwise it returns an error code signifying an invalid size. This is similarly done for transfer memory (which we already check for).
* | kernel/svc: Implement svcGetThreadListLioncash2019-04-021-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | Similarly like svcGetProcessList, this retrieves the list of threads from the current process. In the kernel itself, a process instance maintains a list of threads, which are used within this function. Threads are registered to a process' thread list at thread initialization, and unregistered from the list upon thread destruction (if said thread has a non-null owning process). We assert on the debug event case, as we currently don't implement kernel debug objects.
* | kernel/svc: Implement svcGetProcessListLioncash2019-04-021-1/+38
| | | | | | | | | | | | This service function simply copies out a specified number of kernel process IDs, while simultaneously reporting the total number of processes.
* | general: Use deducation guides for std::lock_guard and std::unique_lockLioncash2019-04-011-1/+1
| | | | | | | | | | | | | | Since C++17, the introduction of deduction guides for locking facilities means that we no longer need to hardcode the mutex type into the locks themselves, making it easier to switch mutex types, should it ever be necessary in the future.
* | Merge pull request #2304 from lioncash/memsizebunnei2019-03-311-4/+4
|\ \ | |/ |/| kernel/process: Report total physical memory used to svcGetInfo slightly better
| * kernel/process: Report total physical memory used to svcGetInfoLioncash2019-03-291-4/+4
| | | | | | | | | | | | | | Reports the (mostly) correct size through svcGetInfo now for queries to total used physical memory. This still doesn't correctly handle memory allocated via svcMapPhysicalMemory, however, we don't currently handle that case anyways.
* | Merge pull request #2266 from FernandoS27/arbitrationbunnei2019-03-291-9/+10
|\ \ | |/ |/| Kernel: Fixes to Arbitration and SignalProcessWideKey Management
| * Fix small bug that kept a thread as a condvar thread after being signalled.Fernando Sahmkow2019-03-201-5/+6
| |
| * Add CondVar Thread State.Fernando Sahmkow2019-03-201-2/+2
| |
| * Small fixes to address_arbiter to better match the IDB.Fernando Sahmkow2019-03-201-2/+2
| |
* | Merge pull request #2284 from lioncash/heap-allocbunnei2019-03-281-6/+3
|\ \ | | | | | | kernel/vm_manager: Unify heap allocation/freeing functions
| * | kernel/vm_manager: Rename HeapAllocate to SetHeapSizeLioncash2019-03-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it more obvious that this function is intending to stand in for the actual supervisor call itself, and not acting as a general heap allocation function. Also the following change will merge the freeing behavior of HeapFree into this function, so leaving it as HeapAllocate would be misleading.
| * | kernel/vm_manager: Remove unnecessary heap_used data memberLioncash2019-03-241-1/+1
| | | | | | | | | | | | | | | This isn't required anymore, as all the kernel ever queries is the size of the current heap, not the total usage of it.
| * | kernel/vm_manager: Tidy up heap allocation codeLioncash2019-03-241-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another holdover from citra that can be tossed out is the notion of the heap needing to be allocated in different addresses. On the switch, the base address of the heap will always be managed by the memory allocator in the kernel, so this doesn't need to be specified in the function's interface itself. The heap on the switch is always allocated with read/write permissions, so we don't need to add specifying the memory permissions as part of the heap allocation itself either. This also corrects the error code returned from within the function. If the size of the heap is larger than the entire heap region, then the kernel will report an out of memory condition.
* | | Merge pull request #2232 from lioncash/transfer-memorybunnei2019-03-241-6/+114
|\ \ \ | |/ / |/| | core/hle/kernel: Split transfer memory handling out into its own class
| * | core/hle/kernel/svc: Implement svcUnmapTransferMemoryLioncash2019-03-131-1/+48
| | | | | | | | | | | | | | | Similarly, like svcMapTransferMemory, we can also implement svcUnmapTransferMemory fairly trivially as well.
| * | core/hle/kernel/svc: Implement svcMapTransferMemoryLioncash2019-03-131-1/+57
| | | | | | | | | | | | | | | Now that transfer memory handling is separated from shared memory, we can implement svcMapTransferMemory pretty trivially.
| * | core/hle/kernel: Split transfer memory handling out into its own classLioncash2019-03-131-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Within the kernel, shared memory and transfer memory facilities exist as completely different kernel objects. They also have different validity checking as well. Therefore, we shouldn't be treating the two as the same kind of memory. They also differ in terms of their behavioral aspect as well. Shared memory is intended for sharing memory between processes, while transfer memory is intended to be for transferring memory to other processes. This breaks out the handling for transfer memory into its own class and treats it as its own kernel object. This is also important when we consider resource limits as well. Particularly because transfer memory is limited by the resource limit value set for it. While we currently don't handle resource limit testing against objects yet (but we do allow setting them), this will make implementing that behavior much easier in the future, as we don't need to distinguish between shared memory and transfer memory allocations in the same place.
* | | Merge pull request #2234 from lioncash/mutexbunnei2019-03-221-6/+11
|\ \ \ | |_|/ |/| | core/hle/kernel: Make Mutex a per-process class.
| * | core/hle/kernel: Make Mutex a per-process class.Lioncash2019-03-151-6/+11
| |/ | | | | | | | | | | | | Makes it an instantiable class like it is in the actual kernel. This will also allow removing reliance on global accessors in a following change, now that we can encapsulate a reference to the system instance in the class.
* | kernel/thread: Move thread exiting logic from ExitCurrentThread to svcExitThreadLioncash2019-03-161-3/+7
| | | | | | | | | | Puts the operation on global state in the same places as the rest of the svc calls.
* | kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interfaceLioncash2019-03-161-11/+11
|/ | | | | | Rather than make a global accessor for this sort of thing. We can make it a part of the thread interface itself. This allows getting rid of a hidden global accessor in the kernel code.
* kernel: Make the address arbiter instance per-processLioncash2019-03-081-2/+4
| | | | | | | | | | Now that we have the address arbiter extracted to its own class, we can fix an innaccuracy with the kernel. Said inaccuracy being that there isn't only one address arbiter. Each process instance contains its own AddressArbiter instance in the actual kernel. This fixes that and gets rid of another long-standing issue that could arise when attempting to create more than one process.
* kernel/svc: Move address arbiter signaling behind a unified API functionLioncash2019-03-081-15/+2
| | | | | | | Similar to how WaitForAddress was isolated to its own function, we can also move the necessary conditional checking into the address arbiter class itself, allowing us to hide the implementation details of it from public use.
* kernel/svc: Move address arbiter waiting behind a unified API functionLioncash2019-03-081-14/+2
| | | | | | Rather than let the service call itself work out which function is the proper one to call, we can make that a behavior of the arbiter itself, so we don't need to directly expose those implementation details.
* Merge pull request #2197 from lioncash/includebunnei2019-03-071-0/+1
|\ | | | | core/hle/ipc: Remove unnecessary includes
| * core/hle/ipc: Remove unnecessary includesLioncash2019-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | Removes a few inclusion dependencies from the headers or replaces existing ones with ones that don't indirectly include the required headers. This allows removing an inclusion of core/memory.h, meaning that if the memory header is ever changed in the future, it won't result in rebuilding the entirety of the HLE services (as the IPC headers are used quite ubiquitously throughout the HLE service implementations).
* | Merge pull request #2199 from lioncash/arbiterbunnei2019-03-061-6/+8
|\ \ | | | | | | kernel/address_arbiter: Convert the address arbiter into a class
| * | kernel/address_arbiter: Convert the address arbiter into a classLioncash2019-03-051-6/+8
| |/ | | | | | | | | | | Places all of the functions for address arbiter operation into a class. This will be necessary for future deglobalizing efforts related to both the memory and system itself.
* / svc: Migrate address range checking functions to VMManagerLioncash2019-03-041-21/+4
|/ | | | Provides a bit of a more proper interface for these functions.
* core_timing: Convert core timing into a classLioncash2019-02-161-4/+6
| | | | | | | | | | | Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
* core_timing: Rename CoreTiming namespace to Core::TimingLioncash2019-02-121-4/+4
| | | | | | Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
* kernel/svc: Log out uncaught C++ exceptions from svcBreakLioncash2019-01-271-0/+4
| | | | | | | | | | Looking into the implementation of the C++ standard facilities that seem to be within all modules, it appears that they use 7 as a break reason to indicate an uncaught C++ exception. This was primarily found via the third last function called within Horizon's equivalent of libcxxabi's demangling_terminate_handler(), which passes the value 0x80000007 to svcBreak.
* kernel/svc: Correct misleading error message within CreateThread()Lioncash2018-12-311-2/+3
| | | | | | | | | | This is a bounds check to ensure that the thread priority is within the valid range of 0-64. If it exceeds 64, that doesn't necessarily mean that an actual priority of 64 was expected (it actually means whoever called the function screwed up their math). Instead clarify the message to indicate the allowed range of thread priorities.
* kernel/svc: Sanitize core number and thread priorities in CreateThread()Lioncash2018-12-311-6/+17
| | | | | | Now that we handle the kernel capability descriptors we can correct CreateThread to properly check against the core and priority masks like the actual kernel does.
* kernel/process: Rename GetAllowedProcessorMask() and GetAllowedThreadPriorityMask()Lioncash2018-12-311-8/+8
| | | | Makes them consistent with their kernel capability counterparts.
* kernel/svc: Simplify thread core ID sanitizing in CreateThreadLioncash2018-12-311-7/+1
| | | | | Rather than use a switch here, this can be collapsed into a simple range check, which is a little easier on the eyes.
* Merge pull request #1956 from lioncash/process-threadSebastian Valle2018-12-311-9/+9
|\ | | | | kernel/process: Start the main thread using the specified ideal core
| * kernel: Rename 'default' CPU core to 'ideal' coreLioncash2018-12-281-9/+9
| | | | | | | | | | | | This makes the naming more closely match its meaning. It's just a preferred core, not a required default core. This also makes the usages of this term consistent across the thread and process implementations.
* | Merge pull request #1847 from ogniK5377/backtrace-breakbunnei2018-12-301-0/+3
|\ \ | | | | | | Print backtrace on svcBreak
| * | Moved backtrace to ArmInterfaceDavid Marcec2018-12-191-2/+3
| | |
| * | Print backtrace on svcBreakDavid Marcec2018-12-031-0/+2
| | | | | | | | | | | | When we get an svcBreak we get a backtrace now
* | | kernel/process: Remove most allocation functions from Process' interfaceLioncash2018-12-281-14/+18
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | In all cases that these functions are needed, the VMManager can just be retrieved and used instead of providing the same functions in Process' interface. This also makes it a little nicer dependency-wise, since it gets rid of cases where the VMManager interface was being used, and then switched over to using the interface for a Process instance. Instead, it makes all accesses uniform and uses the VMManager instance for all necessary tasks. All the basic memory mapping functions did was forward to the Process' VMManager instance anyways.
* | Merge pull request #1849 from encounter/svcSetThreadActivitybunnei2018-12-261-4/+34
|\ \ | | | | | | svc: Implement SetThreadActivity (thread suspension)
| * | svc: Implement SetThreadActivity (thread suspension)Luke Street2018-12-041-4/+34
| | |
* | | Merge pull request #1925 from lioncash/pidbunnei2018-12-211-11/+24
|\ \ \ | | | | | | | | kernel/{process, thread}: Amend behavior related to IDs
| * | | kernel/svc: Handle thread handles within GetProcessIdLioncash2018-12-191-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a thread handle is passed to svcGetProcessId, the kernel attempts to access the process ID via the thread's instance's owning process. Technically, this function should also be handling the kernel debug objects as well, however we currently don't handle those kernel objects yet, so I've left a note via a comment about it to remind myself when implementing it in the future.
| * | | kernel/svc: Correct output parameter for svcGetThreadIdLioncash2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | The service call uses a 64-bit value, just like svcGetProcessId. This amends the function signature accordingly.
| * | | kernel/svc: Correct output parameter for svcGetProcessIdLioncash2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | svcGetProcessId's out parameter is a pointer to a 64-bit value, not a 32-bit one.
* | | | svc: Implement svcSetMemoryAttributeLioncash2018-12-191-5/+46
|/ / / | | | | | | | | | | | | With all the basic backing functionality implemented, we can now unstub svcSetMemoryAttribute.
* | | Merge pull request #1732 from DarkLordZach/yield-typesbunnei2018-12-151-9/+29
|\ \ \ | | | | | | | | svc: Implement yield types 0 and -1
| * | | svc: Avoid incorrect fast yield conditionZach Hilman2018-12-051-6/+1
| | | |
| * | | scheduler: Avoid manual Reschedule callZach Hilman2018-12-041-1/+3
| | | | | | | | | | | | This will automatically occur anyway when PrepareReschedule is called
| * | | scheduler: Only work steal higher priority threads from other coresZach Hilman2018-12-031-10/+6
| | | |
| * | | svc: Avoid performance-degrading unnecessary rescheduleZach Hilman2018-12-021-7/+4
| | | |
| * | | scheduler: Add explanations for YieldWith and WithoutLoadBalancingZach Hilman2018-11-221-7/+14
| | | |
| * | | svc: Implement yield types 0 and -1Zach Hilman2018-11-191-2/+25
| | | |
* | | | Merge pull request #1899 from lioncash/statebunnei2018-12-141-24/+28
|\ \ \ \ | | | | | | | | | | vm_manager/svc: Modify MemoryState enum, and correct error handling for svcQueryMemory
| * | | | svc: Enable svcQueryProcessMemoryLioncash2018-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | svcQueryProcessMemory is trivial to implement, given all the behavior necessary for it is present, it just needs a handler for it.
| * | | | svc: Write out the complete MemoryInfo structure in QueryProcessMemoryLioncash2018-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous change, the memory writing was moved into the service function itself, however it still had a problem, in that the entire MemoryInfo structure wasn't being written out, only the first 32 bytes of it were being written out. We still need to write out the trailing two reference count members and zero out the padding bits. Not doing this can result in wrong behavior in userland code in the following scenario: MemoryInfo info; // Put on the stack, not quaranteed to be zeroed out. svcQueryMemory(&info, ...); if (info.device_refcount == ...) // Whoops, uninitialized read. This can also cause the wrong thing to happen if the user code uses std::memcmp to compare the struct, with another one (questionable, but allowed), as the padding bits are not guaranteed to be a deterministic value. Note that the kernel itself also fully zeroes out the structure before writing it out including the padding bits.
| * | | | svc: Handle memory writing explicitly within QueryProcessMemoryLioncash2018-12-121-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | vm_manager: Migrate memory querying to the VMManager interfaceLioncash2018-12-121-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Gets rid of the need to directly access the managed VMAs outside of the memory manager itself just for querying memory.
| * | | | vm_manager: Amend MemoryState enum membersLioncash2018-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends the MemoryState enum to use the same values like the actual kernel does. Also provides the necessary operators to operate on them. This will be necessary in the future for implementing svcSetMemoryAttribute, as memory block state is checked before applying the attribute.
* | | | | Fix Process object leak on emulation stopJens Schmer2018-12-121-7/+6
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Process object kept itself alive indefinitely because its handle_table contains a SharedMemory object which owns a reference to the same Process object, creating a circular ownership scenario. Break that up by storing only a non-owning pointer in the SharedMemory object.
* | | | Merge pull request #1876 from lioncash/vmabunnei2018-12-101-8/+12
|\ \ \ \ | | | | | | | | | | vm_manager: Make vma_map private
| * | | | vm_manager: Make vma_map privateLioncash2018-12-061-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was only ever public so that code could check whether or not a handle was valid or not. Instead of exposing the object directly and allowing external code to potentially mess with the map contents, we just provide a member function that allows checking whether or not a handle is valid. This makes all member variables of the VMManager class private except for the page table.
* | | | | kernel/svc: Correct behavior of svcResetSignal()Lioncash2018-12-051-4/+11
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | While partially correct, this service call allows the retrieved event to be null, as it also uses the same handle to check if it was referring to a Process instance. The previous two changes put the necessary machinery in place to allow for this, so we can simply call those member functions here and be done with it.
* | | | kernel/svc: Remove unused header inclusionLioncash2018-12-041-1/+0
| | | |
* | | | kernel/svc: Implement svcSignalEvent()Lioncash2018-12-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function simply does a handle table lookup for a writable event instance identified by the given handle value. If a writable event cannot be found for the given handle, then an invalid handle error is returned. If a writable event is found, then it simply signals the event, as one would expect.
* | | | kernel/svc: Implement svcCreateEvent()Lioncash2018-12-041-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #1853 from lioncash/eventbunnei2018-12-041-6/+13
|\ \ \ \ | | | | | | | | | | kernel/object: Amend handle types to distinguish between readable and writable events
| * | | | kernel/object: Amend handle types to distinguish between readable and writable eventsLioncash2018-12-041-6/+13
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two kernel object should absolutely never have the same handle ID type. This can cause incorrect behavior when it comes to retrieving object types from the handle table. In this case it allows converting a WritableEvent into a ReadableEvent and vice-versa, which is undefined behavior, since the object types are not the same. This also corrects ClearEvent() to check both kernel types like the kernel itself does.
* / | | kernel/svc: Implement the resource limit svcGetInfo optionLioncash2018-12-041-1/+28
|/ / / | | | | | | | | | | | | Allows a process to register the resource limit as part of its handle table.
* | | [Kernel::CreateThread] Match format specifiers to LOG_TRACE's argumentsV.Kalyuzhny2018-12-041-1/+1
| | |
* | | Merge pull request #1840 from lioncash/infobunnei2018-12-041-50/+100
|\ \ \ | | | | | | | | svc: Reorganize svcGetInfo, handle more error cases for existing implemented info categories
| * | | svc: Use the current process' handle table for retrieving the process instance to act uponLioncash2018-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | svc: Reorganize svcGetInfo, handle more error cases for existing implemented info categoriesLioncash2018-12-021-50/+99
| | |/ | |/| | | | | | | | | | | | | Our implementation of svcGetInfo was slightly incorrect in that we weren't doing proper error checking everywhere. Instead, reorganize it to be similar to how the kernel seems to do it.
* | | Merge pull request #1803 from DarkLordZach/k-able-eventbunnei2018-12-031-3/+4
|\ \ \ | |/ / |/| | kernel: Divide Event into ReadableEvent and WritableEvent
| * | kernel/event: Reference ReadableEvent from WritableEventZach Hilman2018-11-291-2/+2
| | |
| * | core: Port all current usages of Event to Readable/WritableEventZach Hilman2018-11-291-5/+6
| | |
* | | Fix debug buildLioncash2018-12-011-1/+1
|/ / | | | | | | | | A non-existent parameter was left in some formatting calls (the logging macro for which only does anything meaningful on debug builds)
* | Merge pull request #1801 from ogniK5377/log-before-executebunnei2018-11-291-24/+206
|\ \ | | | | | | Changed logging to be "Log before execution", Added more error logging, all services/svc should now log on some level
| * | Added comment on Main memory size for more clarityDavid Marcec2018-11-271-0/+1
| | |
| * | Made svcSetHeapSize and svcCreateSharedMemory more readableDavid Marcec2018-11-271-4/+4
| | |
| * | Reworked svcs slightly, improved error messages in AM and fsp_srvDavid Marcec2018-11-271-12/+20
| | |
| * | Improved error messages for SVCsDavid Marcec2018-11-261-76/+170
| | |
| * | Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec2018-11-261-11/+90
| | |
* | | svc: Implement svcSetResourceLimitLimitValue()Lioncash2018-11-271-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The opposite of the getter functions, this function sets the limit value for a particular ResourceLimit resource category, with the restriction that the new limit value must be equal to or greater than the current resource value. If this is violated, then ERR_INVALID_STATE is returned. e.g. Assume: current[Events] = 10; limit[Events] = 20; a call to this service function lowering the limit value to 10 would be fine, however, attempting to lower it to 9 in this case would cause an invalid state error.
* | | svc: Implement svcGetResourceLimitCurrentValue()Lioncash2018-11-271-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This kernel service function is essentially the exact same as svcGetResourceLimitLimitValue(), with the only difference being that it retrieves the current value for a given resource category using the provided resource limit handle, rather than retrieving the limiting value of that resource limit instance. Given these are exactly the same and only differ on returned values, we can extract the existing code for svcGetResourceLimitLimitValue() to handle both values.
* | | svc: Implement svcGetResourceLimitLimitValue()Lioncash2018-11-271-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This kernel service function retrieves the maximum allowable value for a provided resource category for a given resource limit instance. Given we already have the functionality added to the resource limit instance itself, it's sufficient to just hook it up. The error scenarios for this are: 1. If an invalid resource category type is provided, then ERR_INVALID_ENUM is returned. 2. If an invalid handle is provided, then ERR_INVALID_HANDLE is returned (bad thing goes in, bad thing goes out, as one would expect). If neither of the above error cases occur, then the out parameter is provided with the maximum limit value for the given category and success is returned.
* | | svc: Implement svcCreateResourceLimit()Lioncash2018-11-271-1/+19
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | svc: Return ERR_INVALID_ENUM_VALUE from svcGetInfoLuke Street2018-11-251-1/+2
| |
* | Merge pull request #1734 from lioncash/sharedbunnei2018-11-211-2/+2
|\ \ | | | | | | kernel/shared_memory: Make data members private, plus minor interface changes
| * | kernel/shared_memory: Make Map() and Unmap() take the target process by reference rather than as a pointerLioncash2018-11-191-2/+2
| |/ | | | | | | | | | | 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.
* | Merge pull request #1667 from DarkLordZach/swkbdbunnei2018-11-201-3/+33
|\ \ | | | | | | am: Implement HLE software keyboard applet
| * | am: Deglobalize software keyboard appletZach Hilman2018-11-181-4/+4
| | |
| * | svc: Implement svcCreateTransferMemoryZach Hilman2018-11-181-3/+33
| | | | | | | | | Seems to be used and created identically to SharedMemory, so just reuse that.
* | | kernel/resource_limit: Clean up interfaceLioncash2018-11-201-11/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #1728 from FearlessTobi/reset-signalMat M2018-11-181-1/+1
|\ \ | |/ |/| svc: ResetSignal is not stubbed
| * svc: ResetSignal is not stubbedTobias2018-11-181-1/+1
| | | | | | https://user-images.githubusercontent.com/20753089/48677874-b8e01c80-eb7b-11e8-8043-b99faa29022c.PNG
* | kernel/errors: Clean up error codesLioncash2018-11-161-10/+10
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #1638 from FreddyFunk/SetMemoryPermission-StubbedMat M2018-11-161-1/+43
|\ \ | | | | | | Implement SetMemoryPermission
| * | Implement SetMemoryPermissionFrederic Laing2018-11-061-3/+39
| | |
| * | Stubbed SetMemoryPermissionFrederic Laing2018-11-031-1/+7
| | |
* | | svc: Use proper random entropy generation algorithmZach Hilman2018-11-131-1/+10
| | |
* | | svc: Return random seed for svcGetInfo RandomEntropyZach Hilman2018-11-131-1/+2
| | |
* | | svcBreak now dumps information from the debug buffer passed (#1646)David2018-11-081-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
* / core: Make System references const where applicableLioncash2018-10-281-1/+1
|/
* svc: Localize the GetInfo enum class to the function itselfLioncash2018-10-261-0/+31
| | | | Nothing from this enum is intended to be used outside of this function.
* svc: Implement svcGetInfo command 0xF0000002Lioncash2018-10-261-0/+30
| | | | | | | | | | 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; }
* 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 priorities in SetThreadPriority()Lioncash2018-10-241-5/+6
| | | | | | 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.
* Merge pull request #1551 from ogniK5377/improved-svcbreakbunnei2018-10-241-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-241-60/+60
|\ \ | |/ |/| kernel/process: Make the handle table per-process
| * kernel/process: Make the handle table per-processLioncash2018-10-201-60/+60
| | | | | | | | | | | | | | | | 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-201-3/+27
|\ | | | | svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemory
| * svc: Add missing sanitizing checks for MapSharedMemory/UnmapSharedMemoryLioncash2018-10-181-3/+27
| | | | | | | | | | | | | | | | 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 svcArbitrateLock/svcArbitrateUnlockLioncash2018-10-181-0/+8
| | | | | | | | | | 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-181-17/+4
|\ | | | | svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()
| * svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo()Lioncash2018-10-151-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-1/+1
|/
* Merge pull request #1492 from lioncash/procbunnei2018-10-141-1/+24
|\ | | | | svc: Implement svcGetProcessInfo
| * svc: Implement svcGetProcessInfoLioncash2018-10-131-1/+24
| | | | | | | | | | | | | | 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 #1481 from lioncash/typobunnei2018-10-131-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-121-4/+4
|\ \ | |/ |/| Fixed incorrect types for svcBreak
| * Use a better name than "dont_kill_application"David Marcec2018-10-101-2/+2
| | | | | | | | signal_debugger seems like a more fitting name
| * Fixed incorrect types for svcBreakDavid Marcec2018-10-101-3/+3
| | | | | | | | svcBreak reason should be a u32, not a u64.
* | svc: Add missing address range sanitizing checks to MapMemory/UnmapMemoryLioncash2018-10-111-12/+79
| | | | | | | | | | | | | | | | 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.
* | kernel/thread: Use a regular pointer for the owner/current processLioncash2018-10-101-6/+6
|/ | | | | | | | | | | 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).
* Added bitfield instead of manually checking if the bit is setDavid Marcec2018-10-091-4/+12
|
* Actual kill execution when the bit isn't set, not the other way aroundDavid Marcec2018-10-091-1/+1
|
* svcBreak, Signalling to the debugger should not kill executionDavid Marcec2018-10-091-5/+12
| | | | 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.
* kernel/thread: Make all instance variables privateLioncash2018-10-041-57/+64
| | | | | | | | | | | | | | | | | | | | Many of the member variables of the thread class aren't even used outside of the class itself, so there's no need to make those variables public. This change follows in the steps of the previous changes that made other kernel types' members private. The main motivation behind this is that the Thread class will likely change in the future as emulation becomes more accurate, and letting random bits of the emulator access data members of the Thread class directly makes it a pain to shuffle around and/or modify internals. Having all data members public like this also makes it difficult to reason about certain bits of behavior without first verifying what parts of the core actually use them. Everything being public also generally follows the tendency for changes to be introduced in completely different translation units that would otherwise be better introduced as an addition to the Thread class' public interface.
* kernel/svc: Implement svcGetThreadContext()Lioncash2018-09-301-2/+30
| | | | | | | | | 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).
* kernel/process: Make data member variables privateLioncash2018-09-301-15/+15
| | | | | | | Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
* Merge pull request #1395 from lioncash/vmbunnei2018-09-291-15/+30
|\ | | | | process/vm_manager: Initial modifications to load NPDM metadata
| * memory: Dehardcode the use of fixed memory range constantsLioncash2018-09-251-1/+2
| | | | | | | | | | | | | | | | The locations of these can actually vary depending on the address space layout, so we shouldn't be using these when determining where to map memory or be using them as offsets for calculations. This keeps all the memory ranges flexible and malleable based off of the virtual memory manager instance state.
| * svc: Report correct memory-related values within some of the cases in svcGetInfo()Lioncash2018-09-251-14/+28
| | | | | | | | | | | | Previously, these were reporting hardcoded values, but given the regions can change depending on the requested address spaces, these need to report the values that the memory manager contains.
* | Merge pull request #1393 from tech4me/svcbunnei2018-09-251-7/+7
|\ \ | |/ |/| svc: Updated svc names
| * svc: Updated svc namestech4me2018-09-241-7/+7
| |
* | svc: Move most process termination code to its own function within ProcessLioncash2018-09-211-27/+5
|/ | | | | Reduces the use of Process class members externally and keeps most code related to tearing down a process with the rest of the process code.
* kernel/svc: Handle error cases for svcArbitrateLock() and svcArbitrateUnlock()Lioncash2018-09-181-0/+8
| | | | | | | | | | | | | | | The kernel does the equivalent of the following check before proceeding: if (address + 0x8000000000 < 0x7FFFE00000) { return ERR_INVALID_MEMORY_STATE; } which is essentially what our IsKernelVirtualAddress() function does. So we should also be checking for this. The kernel also checks if the given input addresses are 4-byte aligned, however our Mutex::TryAcquire() and Mutex::Release() functions already handle this, so we don't need to add code for this case.
* Merge pull request #1315 from lioncash/sizebunnei2018-09-171-19/+72
|\ | | | | kernel/svc: Handle a few error cases within memory-related functions
| * kernel/svc: Sanitize creation of shared memory via svcCreateSharedMemory()Lioncash2018-09-141-2/+18
| | | | | | | | | | | | | | | | | | | | The kernel caps the size limit of shared memory to 8589930496 bytes (or (1GB - 512 bytes) * 8), so approximately 8GB, where every GB has a 512 byte sector taken off of it. It also ensures the shared memory is created with either read or read/write permissions for both permission types passed in, allowing the remote permissions to also be set as "don't care".
| * kernel/svc: Sanitize addresses, permissions, and sizes within svcMapSharedMemory() and svcUnmapSharedMemory()Lioncash2018-09-141-17/+25
| | | | | | | | | | | | | | | | Part of the checking done by the kernel is to check if the given address and size are 4KB aligned, as well as checking if the size isn't zero. It also only allows mapping shared memory as readable or read/write, but nothing else, and so we shouldn't allow mapping as anything else either.
| * kernel/svc: Sanitize addresses and sizes within svcMapMemory() and svcUnmapMemory()Lioncash2018-09-141-0/+23
| | | | | | | | | | The kernel checks if the addresses and given size is 4KB aligned before continuing onwards to map the memory.
| * kernel/svc: Sanitize heap sizes within svcSetHeapSize()Lioncash2018-09-141-0/+6
| | | | | | | | | | The kernel checks if the given size is a multiple of 2MB and <= to 4GB before going ahead and attempting to allocate that much memory.
* | Merge pull request #1328 from FearlessTobi/port-4192bunnei2018-09-171-1/+1
|\ \ | | | | | | Port #4192 from Citra: "svc: change unknown to thread in CreateThread"
| * | Port # #4192 from Citra: "svc: change unknown to thread in CreateThread"Valentin Vanelslande2018-09-151-1/+1
| |/
* / Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-13/+14
|/
* Merge pull request #1303 from lioncash/errorbunnei2018-09-121-4/+4
|\ | | | | kernel/errors: Amend invalid thread priority and invalid processor ID error codes
| * svc: Return ERR_INVALID_PROCESSOR_ID in CreateThread() if an invalid processor ID is givenLioncash2018-09-121-2/+2
| | | | | | | | This is what the kernel does for an out-of-range processor ID.
| * kernel/errors: Correct error codes for invalid thread priority and invalid processor IDLioncash2018-09-121-2/+2
| |
* | svc: Do nothing if svcOutputDebugString() is given a length of zeroLioncash2018-09-121-0/+4
| | | | | | | | | | | | While unlikely, it does avoid constructing a std::string and unnecessarily calling into the memory code if a game or executable decides to be really silly about their logging.
* | svc: Correct parameter type for OutputDebugString()Lioncash2018-09-121-1/+1
|/ | | | This should be a u64 to represent size.
* service: Migrate global named port map to the KernelCore classLioncash2018-09-021-5/+7
| | | | | | Now that we have a class representing the kernel in some capacity, we now have a place to put the named port map, so we move it over and get rid of another piece of global state within the core.
* core/core: Replace includes with forward declarations where applicableLioncash2018-08-311-0/+4
| | | | | | | | | | | The follow-up to e2457418dae19b889b2ad85255bb95d4cd0e4bff, which replaces most of the includes in the core header with forward declarations. This makes it so that if any of the headers the core header was previously including change, then no one will need to rebuild the bulk of the core, due to core.h being quite a prevalent inclusion. This should make turnaround for changes much faster for developers.
* kernel: Eliminate kernel global stateLioncash2018-08-291-25/+55
| | | | | | | | | | | | | | | | | | | | | | As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
* svc: Return process title ID if queried in GetInfo()Lioncash2018-08-251-2/+1
| | | | | | We already have the variable itself set up to perform this task, so we can just return its value from the currently executing process instead of always stubbing it to zero.
* kernel/svc: Log svcBreak parametersLioncash2018-08-151-2/+5
| | | | | | Given if we hit here all is lost, we should probably be logging the break reason code and associated information to distinguish between the causes.
* Merge pull request #1043 from Subv/timingbunnei2018-08-131-1/+0
|\ | | | | Use an approximated amortized amount of ticks when advancing timing.
| * Kernel/SVC: Don't reschedule the current core when creating a new thread.Subv2018-08-131-1/+0
| | | | | | | | The current core may have nothing to do with the core where the new thread was scheduled to run. In case it's the same core, then the following PrepareReshedule call will take care of that.
* | Kernel/Mutex: Don't duplicate threads in the mutex waiter list.Subv2018-08-121-2/+1
|/ | | | | | | | | | Exit from AddMutexWaiter early if the thread is already waiting for a mutex owned by the owner thread. This accounts for the possibility of a thread that is waiting on a condition variable being awakened twice in a row. Also added more validation asserts. This should fix one of the random crashes in Breath Of The Wild.
* kernel/vm_manager: Use const where applicableLioncash2018-08-021-1/+1
| | | | Makes our immutable state explicit.
* Merge pull request #877 from lioncash/removebunnei2018-08-011-1/+0
|\ | | | | kernel: Remove unused object_address_table.cpp/.h
| * kernel: Remove unused object_address_table.cpp/.hLioncash2018-07-311-1/+0
| | | | | | | | | | | | These source files were entirely unused throughout the rest of the codebase. This also has the benefit of getting rid of a global variable as well.
* | kernel: Remove unnecessary includesLioncash2018-07-311-0/+3
|/ | | | | Removes unnecessary direct dependencies in some headers and also gets rid of indirect dependencies that were being relied on to be included.
* Merge pull request #804 from lioncash/logMat M2018-07-251-1/+3
|\ | | | | svc: Log parameters in SetMemoryAttribute()
| * svc: Log parameters in SetMemoryAttribute()Lioncash2018-07-241-1/+3
| | | | | | | | Provides slightly more context than only logging out the address value.
* | svc: Resolve sign comparison warnings in WaitSynchronization()Lioncash2018-07-241-4/+7
|/ | | | | The loop's induction variable was signed, but we were comparing against an unsigned variable.
* Kernel/SVC: Perform atomic accesses in SignalProcessWideKey as per the real kernel.Subv2018-07-221-7/+31
|
* thread: Convert ThreadStatus into an enum classLioncash2018-07-201-10/+10
| | | | | Makes the thread status strongly typed, so implicit conversions can't happen. It also makes it easier to catch mistakes at compile time.
* svc: Correct always true assertion case in SetThreadCoreMaskLioncash2018-07-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reason this would never be true is that ideal_processor is a u8 and THREADPROCESSORID_DEFAULT is an s32. In this case, it boils down to how arithmetic conversions are performed before performing the comparison. If an unsigned value has a lesser conversion rank (aka smaller size) than the signed type being compared, then the unsigned value is promoted to the signed value (i.e. u8 -> s32 happens before the comparison). No sign-extension occurs here either. An alternative phrasing: Say we have a variable named core and it's given a value of -2. u8 core = -2; This becomes 254 due to the lack of sign. During integral promotion to the signed type, this still remains as 254, and therefore the condition will always be true, because no matter what value the u8 is given it will never be -2 in terms of 32 bits. Now, if one type was a s32 and one was a u32, this would be entirely different, since they have the same bit width (and the signed type would be converted to unsigned instead of the other way around) but would still have its representation preserved in terms of bits, allowing the comparison to be false in some cases, as opposed to being true all the time. --- We also get rid of two signed/unsigned comparison warnings while we're at it.
* Update clang formatJames Rowe2018-07-031-28/+25
|
* Rename logging macro back to LOG_*James Rowe2018-07-031-47/+47
|
* Kernel/Arbiters: Fix casts, cleanup comments/magic numbersMichael Scire2018-06-221-4/+4
|
* Add additional missing format.Michael Scire2018-06-221-19/+21
|
* Kernel/Arbiters: Initialize arb_wait_address in thread struct.Michael Scire2018-06-211-0/+4
|
* Kernel/Arbiters: Mostly implement SignalToAddressMichael Scire2018-06-211-1/+1
|
* Kernel/Arbiters: Add stubs for 4.x SignalToAddress/WaitForAddres SVCs.Michael Scire2018-06-211-3/+50
|
* Build: Fixed some MSVC warnings in various parts of the code.Subv2018-06-201-2/+2
|
* Merge pull request #572 from Armada651/user-except-stubbunnei2018-06-181-0/+5
|\ | | | | svc: Add a stub for UserExceptionContextAddr.
| * svc: Add a stub for UserExceptionContextAddr.Jules Blok2018-06-181-0/+5
| |
* | Kernel/SVC: Support special core values -2 and -3 in svcSetThreadCoreMask.Subv2018-05-311-1/+26
| | | | | | | | Also added some proper error handling.
* | Kernel/SVC: Signal the highest priority threads first in svcSignalProcessWideKey.Subv2018-05-191-51/+68
| |
* | Kernel/Threads: Reschedule the proper core when operating on that core's threads.Subv2018-05-191-2/+6
| |
* | SVC: Removed unused WaitSynchronization1 functionSubv2018-05-191-30/+0
| |
* | thread: Rename mask to affinity_masks.bunnei2018-05-111-1/+1
| |
* | threading: Reschedule only on cores that are necessary.bunnei2018-05-111-2/+2
| |
* | svc: Implement GetThreadCoreMask and SetThreadCoreMask.bunnei2018-05-111-7/+22
| |
* | svc: SignalProcessWideKey should apply to all cores.bunnei2018-05-111-43/+50
| |
* | svc: Implement GetCurrentProcessorNumber.bunnei2018-05-111-2/+2
| |
* | core: Implement multicore support.bunnei2018-05-111-21/+22
| |
* | general: Make formatting of logged hex values more straightforwardLioncash2018-05-021-38/+39
| | | | | | | | | | | | This makes the formatting expectations more obvious (e.g. any zero padding specified is padding that's entirely dedicated to the value being printed, not any pretty-printing that also gets tacked on).
* | string_util: Remove StringFromFormat() and related functionsLioncash2018-04-301-1/+1
| | | | | | | | Given we utilize fmt, we don't need to provide our own functions for formatting anymore
* | general: Convert assertion macros over to be fmt-compatibleLioncash2018-04-271-1/+1
| |
* | kernel: Migrate logging macros to fmt-compatible onesLioncash2018-04-261-69/+69
| |
* | Merge pull request #370 from Subv/sync_primitivesbunnei2018-04-231-107/+55
|\ \ | | | | | | Kernel: Reworked the new kernel synchronization primitives.
| * | Kernel: Implemented mutex priority inheritance.Subv2018-04-231-0/+9
| | | | | | | | | | | | | | | | | | | | | Verified with a hwtest and implemented based on reverse engineering. Thread A's priority will get bumped to the highest priority among all the threads that are waiting for a mutex that A holds. Once A releases the mutex and ownership is transferred to B, A's priority will return to normal and B's priority will be bumped.
| * | Kernel: Remove unused ConditionVariable class.Subv2018-04-211-6/+0
| | |
| * | Kernel: Properly implemented svcWaitProcessWideKey and svcSignalProcessWideKeySubv2018-04-211-83/+46
| | | | | | | | | | | | They work in tandem with guest code to provide synchronization primitives along with svcArbitrateLock/Unlock
| * | Kernel: Corrected the implementation of svcArbitrateLock and svcArbitrateUnlock.Subv2018-04-211-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch mutexes are no longer kernel objects, they are managed in userland and only use the kernel to handle the contention case. Mutex addresses store a special flag value (0x40000000) to notify the guest code that there are still some threads waiting for the mutex to be released. This flag is updated when a thread calls ArbitrateUnlock. TODO: * Fix svcWaitProcessWideKey * Fix svcSignalProcessWideKey * Remove the Mutex class.
* | | resource_limit: Make ResourceTypes an enum classLioncash2018-04-211-2/+2
|/ / | | | | | | Prevents enum identifiers from leaking into the surrounding scope.
* | common_funcs: Remove ARRAY_SIZE macroLioncash2018-04-201-1/+2
| | | | | | | | C++17 has non-member size() which we can just call where necessary.
* | Various service name fixes - part 2 (rebased) (#322)Hexagon122018-04-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updated ACC with more service names * Updated SVC with more service names * Updated set with more service names * Updated sockets with more service names * Updated SPL with more service names * Updated time with more service names * Updated vi with more service names
* | svc: Stub out SetThreadActivity, GetThreadContext.bunnei2018-04-031-2/+14
| |
* | svc: Stub GetThreadCoreMask.bunnei2018-03-301-3/+11
| |
* | More Warning cleanupsN00byKing2018-03-191-1/+1
| |
* | Clean Warnings (?)N00byKing2018-03-191-1/+1
| |
* | svc: Use more correct values for GetInfo MapRegion and NewMapRegion.bunnei2018-03-161-5/+5
| |
* | MemoryState: Add additional memory states and improve naming.bunnei2018-03-161-1/+1
| |
* | core: Move process creation out of global state.bunnei2018-03-141-18/+20
|/
* Merge pull request #215 from N00byKing/umapsharedmmrybunnei2018-02-261-1/+12
|\ | | | | UnmapSharedMemory
| * (Hopefully) Fix MinGW BuildN00byKing2018-02-251-1/+1
| |
| * Add UnmapSharedMemoryN00byKing2018-02-251-1/+12
| | | | | | | | | | | | | | | | C++11 requires spaces on the Identifier Add inttypes include clang
* | Stub more functionsmailwl2018-02-221-1/+11
|/
* kernel: Use Scheduler class for threading.bunnei2018-02-181-2/+2
|
* GetInfo: Implement IsCurrentProcessBeingDebugged.bunnei2018-02-041-0/+3
|
* WaitProcessWideKeyAtomic: Handle case where condition variable was already created.bunnei2018-02-041-8/+15
|
* svc: SharedMemory size should be 64-bits and cleanup.bunnei2018-02-031-8/+8
|
* ArbitrateLock: Assert that requesting_thread is current_thread.bunnei2018-02-031-0/+1
|
* hle: Remove Domain and SyncObject kernel objects.bunnei2018-01-251-2/+1
|
* Format: Run the new clang format on everythingJames Rowe2018-01-211-4/+6
|
* Added CreateSharedMemory & UNIMPLEMENTED() for non existent services. (#113)David2018-01-201-1/+13
| | | | | | | | | | | | * Added svcCreateSharedMemory * Services which are not implemented now throw UNIMPLEMENTED() * clang-format * changed perms to u32 * removed camelcase
* svc: Fix svcGetInfo MapRegionBaseAddr.bunnei2018-01-191-1/+1
|
* svc: Rename some entries to match their analogue on SwitchBrewLioncash2018-01-181-7/+7
| | | | Makes the codebase a little more consistent with regards to available documentation. Also amends the duplicate case where there was a similar entry at 0x72 named ConnectToPort.
* svc: Add CreateJitMemory and MapJitMemory svc stringsLioncash2018-01-181-2/+2
| | | | Makes the table match SwitchBrew for these entries
* svc: Clang-format fix.bunnei2018-01-171-6/+4
|
* SVC: Correct some return values in svcGetInfo and added TitleId and PrivilegedProcessId stubs.Subv2018-01-171-6/+21
| | | | | # Conflicts: # src/core/hle/kernel/svc.cpp
* Merge pull request #52 from ogniK5377/fspbunnei2018-01-171-1/+18
|\ | | | | added more svcGetInfo pairs for 3.0.0+ support, Changed HEAP_SIZE and TLS_AREA_VADDR. changed mem usage & heap usage stub added, ISelfController, IApplication function stubs. Added SetThreadCoreMask
| * SetThreadCoreMask stub, time to implement fspDavid Marcec2018-01-161-1/+6
| |
| * Added more svcGetInfo pairsDavid Marcec2018-01-161-0/+12
| |
* | clang-formatMerryMage2018-01-161-6/+4
|/
* svc: Implement svcMapSharedMemory.bunnei2018-01-141-1/+33
|
* yuzu: Update license text to be consistent across project.bunnei2018-01-131-1/+1
|
* core: Include <algorithm> where used.bunnei2018-01-121-0/+2
|
* svc: Implement GetSystemTick.bunnei2018-01-121-2/+13
|
* svc: Stub ResetSignal and CreateTransferMemorySubv2018-01-111-3/+20
|
* svc: Stub SetMemoryAttributeSubv2018-01-111-0/+5
|
* Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask)Subv2018-01-101-6/+11
|
* SVC: Fixed WaitSynchronization with multiple handles when none is immediately ready.Subv2018-01-091-7/+18
|
* SVC: Implemented CancelSynchronization.Subv2018-01-091-1/+17
|
* SVC: Fixed WaitSynchronization with multiple handles when at least one of them is ready.Subv2018-01-091-1/+24
|
* kernel: Rename Semaphore to ConditionVariable.bunnei2018-01-091-25/+33
|
* Kernel: Actually wake up the requested number of threads in Semaphore::Release.Subv2018-01-091-1/+1
| | | | | | Also properly keep track of data in guest memory, this fixes managing the semaphore from userland. It was found that Semaphores are actually Condition Variables, with Release(1) and Release(-1) being equivalent to notify_one and notify_all. We should change the name of the class to reflect this.
* Kernel: Properly keep track of mutex lock data in the guest memory. This fixes userland locking/unlocking.Subv2018-01-091-1/+4
|
* Kernel: Allow chaining WaitSynchronization calls inside a wakeup callback.Subv2018-01-091-15/+41
|
* svc: Implement svcSignalProcessWideKey.bunnei2018-01-071-2/+21
|
* svc: Implement svcWaitProcessWideKeyAtomic.bunnei2018-01-061-1/+49
|
* svc: Implement WaitSynchronization for a single handle.bunnei2018-01-061-4/+24
|
* svc: Refactor LockMutex code to use WaitSynchronization1.bunnei2018-01-061-13/+45
|
* svc: Add missing string_util include.bunnei2018-01-051-0/+1
|
* arm: Remove SkyEye/Dyncom code that is ARMv6-only.bunnei2018-01-031-19/+9
|
* svc: Remove unnecessary "svc" prefix to naming scheme.bunnei2018-01-031-106/+106
|
* hle: Move SVC code to kernel namespace.bunnei2018-01-031-0/+612