aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
AgeCommit message (Collapse)Author
2020-02-11Kernel: Refactor synchronization to better match REFernando Sahmkow
2020-02-11Kernel: Change WaitObject to Synchronization object. In order to better ↵Fernando Sahmkow
reflect RE.
2020-02-05kernel: transfer_memory: Properly reserve and reset memory region.bunnei
2020-01-26Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow
This commit instends on better naming the new purpose of this classes.
2019-12-11kernel/svc: Correct function signature of SignalProcessWideKeyLioncash
This function doesn't actually return a result code, so we can amend the signature of it to match.
2019-12-07kernel/svc: Provide implementations for svcDumpInfo/svcDumpInfoNewLioncash
These are fairly trivial to implement, we can just do nothing. This also provides a spot for us to potentially dump out any relevant info in the future (e.g. for debugging purposes with homebrew, etc). While we're at it, we can also correct the names of both of these supervisor calls.
2019-11-28kernel: Implement a more accurate IPC dispatch.bunnei
2019-11-26core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash
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.
2019-11-26core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash
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.
2019-11-26core/memory: Migrate over ReadCString() to the Memory classLioncash
This only had one usage spot, so this is fairly straightforward to convert over.
2019-11-26core: Prepare various classes for memory read/write migrationLioncash
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.
2019-11-26core/memory: Migrate over address checking functions to the new Memory classLioncash
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.
2019-11-24kernel: Replace usage of boost::intrusive_ptr with std::shared_ptr for ↵bunnei
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.
2019-11-23Update svc.cppbunnei
2019-11-23svc: GetSystemTick should return cntpct_el0, not core ticks.bunnei
2019-11-23Merge pull request #3114 from FernandoS27/cond-varbunnei
Kernel: Correct behavior of Condition Variables to be more similar to real hardware.
2019-11-21Kernel: Optimize condition variable threads management.Fernando Sahmkow
2019-11-21Kernel: Correct SignalProcessWideKeyFernando Sahmkow
When the target is 0, all threads must be processed.
2019-11-21Kernel: Correct behavior of Condition Variables to be more similar to real ↵Fernando Sahmkow
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.
2019-11-16Kernel: Correct Cancel Synchronization.Fernando Sahmkow
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.
2019-11-03kernel: events: Remove ResetType::Automatic.bunnei
- 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
2019-10-15Kernel: Address Feedback.Fernando Sahmkow
2019-10-15KernelSVC: Assert that condition variable address is aligned to 4 bytes.Fernando Sahmkow
2019-10-15Kernel: Correct redundant yields to only advance time forward.Fernando Sahmkow
2019-10-15Kernel: Correct Results in Condition Variables and MutexesFernando Sahmkow
2019-10-15Scheduler: Add protections for Yield bombingFernando Sahmkow
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.
2019-10-15Kernel: Style and CorrectionsFernando Sahmkow
2019-10-15Correct PrepareRescheduleFernando Sahmkow
2019-10-15Correct Supervisor Calls to work with the new scheduler,Fernando Sahmkow
2019-07-18Merge pull request #2687 from lioncash/tls-processbunnei
kernel/process: Allocate the process' TLS region during initialization
2019-07-17Kernel: Downgrade WaitForAddress and SignalToAddress messages to Trace.Fernando Sahmkow
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.
2019-07-14Merge pull request #2690 from SciresM/physmem_fixesFernando Sahmkow
Implement MapPhysicalMemory/UnmapPhysicalMemory
2019-07-11Restore memory perms on svcUnmapMemory/UnloadNroMichael Scire
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.
2019-07-07clang-format fixesMichael Scire
2019-07-07address review commentaryMichael Scire
2019-07-07Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
2019-07-07kernel/process: Allocate the process' TLS region during initializationLioncash
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.
2019-07-06kernel/vm_manager: Rename 'new map' to 'stack'Lioncash
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.
2019-06-21Merge pull request #2482 from DarkLordZach/prepobunnei
core: Add detailed local reporting feature for development
2019-06-09kernel/svc: Implement ↵Lioncash
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.
2019-06-09kernel/svc: Amend naming for TotalMemoryUsage in svcGetInfo()Lioncash
Disambiguates and makes the name a little more consistent with TotalPhysicalMemoryUsed.
2019-06-09kernel/svc: Remove duplicate enum entry in svcGetInfo()Lioncash
2019-05-25svc: Save report on call to svcBreakZach Hilman
2019-05-19Merge pull request #2410 from lioncash/affinitybunnei
kernel/svc: Reorganize and fix up the initial handling of svcSetThreadCoreMask()
2019-05-19Merge pull request #2486 from lioncash/resetnameSebastian Valle
core/kernel/object: Rename ResetType enum members for clarity
2019-05-18kernel/svc: Mark GetThreadList() and UnmapProcessCodeMemory() as internally ↵Lioncash
linked 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.
2019-05-18core/kernel/object: Rename ResetType enum membersLioncash
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.
2019-04-29kernel/svc: Make svcCreateThread/svcStartThread/svcSleepThread/svcExitThread ↵Lioncash
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.
2019-04-29kernel/svc: Reorganize svcSetThreadCoreMask()Lioncash
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.
2019-04-29kernel/thread: Update thread processor ID flagsLioncash
Adds the missing flags to the enum and documents them.