aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* core: hle: Implement separate A32/A64 SVC interfaces.bunnei2020-03-021-65/+264
|
* Core: Address FeedbackFernando Sahmkow2020-02-131-1/+1
|
* Kernel: Refactor synchronization to better match REFernando Sahmkow2020-02-111-60/+7
|
* Kernel: Change WaitObject to Synchronization object. In order to better ↵Fernando Sahmkow2020-02-111-6/+7
| | | | reflect RE.
* kernel: transfer_memory: Properly reserve and reset memory region.bunnei2020-02-051-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-071-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-261-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-261-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-261-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-261-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-261-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 ↵bunnei2019-11-241-26/+26
| | | | | | | | kernel objects. (#3154) * 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 ↵Fernando Sahmkow2019-11-211-15/+5
| | | | | | | | | | | | | | | | | | hardware. 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-171-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 ↵Lioncash2019-06-091-2/+15
| | | | | | | | | | | | | | | | | | | | | | TotalMemoryUsedWithoutMmHeap/TotalMemoryAvailableWithoutMmHeap 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-091-4/+4
| | | | | | | | | | Disambiguates and makes the name a little more consistent with TotalPhysicalMemoryUsed.
* | kernel/svc: Remove duplicate enum entry in svcGetInfo()Lioncash2019-06-091-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 ↵Lioncash2019-04-291-4/+4
| | | | | | | | | | | | | | | | calls show up in the debug log 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