summaryrefslogtreecommitdiffstats
path: root/src/core/core_timing.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-01-24Rework time service to fix time passing offline.Kelebek11-1/+1
2023-12-23core_timing: block advance thread while clearing and signal afterLiam1-1/+2
2023-12-23core_timing: handle concurrent unscheduling of looping eventsLiam1-3/+11
2023-12-23core_timing: use static typing for no-wait unscheduleLiam1-2/+3
2023-12-23core_timing: remove user data valueLiam1-21/+11
2023-11-14core_timing: lock event queue accessLiam1-0/+2
2023-09-16core_timing: Attempt to reduce heap siftingMerry1-11/+22
2023-09-16core_timing: Use a fibonacci heapMerry1-27/+29
2023-07-03Use spans over guest memory where possible instead of copying data.Kelebek11-2/+1
2023-07-02core_timing: Remove GetCurrentTimerResolution in CoreTiming loopMorph1-3/+6
Other programs may change this value, but if thousands of syscalls in this loop is undesirable, then we can just set this once.
2023-06-08core_timing: Fix SingleCore cycle timerMorph1-17/+9
2023-06-08(wall, native)_clock: Add GetGPUTickMorph1-0/+7
Allows us to directly calculate the GPU tick without double conversion to and from the host clock tick.
2023-06-08core_timing: Use CNTPCT as the guest CPU tickMorph1-27/+8
Previously, we were mixing the raw CPU frequency and CNTFRQ. The raw CPU frequency (1020 MHz) should've never been used as CNTPCT (whose frequency is CNTFRQ) is the only counter available.
2023-03-27core_timing: Make use of MicroSleep for x64 CPUsMorph1-0/+8
For CPUs that support tpause, this should result in significant CPU power savings over thread yield in this spin wait.
2023-03-08core: Promote CPU/GPU threads to time criticalMorph1-1/+1
And also demote Audren and CoreTiming to High thread priority.
2023-03-05core_timing: Use higher precision sleeps on WindowsMorph1-22/+33
The precision of sleep_for and wait_for is limited to 1-1.5ms on Windows. Using SleepForOneTick() allows us to sleep for exactly one interval of the current timer resolution. This allows us to take advantage of systems that have a timer resolution of 0.5ms to reduce CPU overhead in the event loop.
2023-02-14remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistencyarades791-1/+1
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14add static lifetime to constexpr values to force compile time evaluation where possiblearades791-1/+1
Signed-off-by: arades79 <scravers@protonmail.com>
2023-01-14timing: wait for completion on unregisterLiam1-24/+18
2022-10-19core: core_timing: Re-initialize if single/multicore state changes.bunnei1-9/+14
2022-10-19core: Partially persist emulation state across game boots.bunnei1-16/+13
2022-10-09core_timing: use high-precision sleeps on non-Windows targetsLiam1-0/+4
2022-10-04common: remove "yuzu:" prefix from thread namesLiam1-1/+1
2022-09-13Remove pause callbacks from coretimingKelebek11-14/+0
2022-08-02core_timing: Sleep in discrete intervals, yield during spinMorph1-12/+13
2022-08-02Add missing looping event schedule signalKelebek11-5/+9
2022-08-02Make coretiming waiting more accurateKelebek11-11/+27
2022-07-28Revert Coretiming PRs 8531 and 7454 (#8591)Maide1-95/+56
2022-07-10Rework CoreTimingKelebek11-8/+67
2022-07-02Core timing: use only one thread.Fernando Sahmkow1-10/+2
2022-06-30Adress Feedback.Fernando Sahmkow1-17/+26
2022-06-28Address feedback.Fernando Sahmkow1-13/+13
2022-06-28Core: Protect each event from race conditions within it.Fernando Sahmkow1-0/+1
2022-06-28Core/Common: Corrections to core timing and add critical priority.Fernando Sahmkow1-1/+1
2022-06-28Core: Reimplement Core Timing.Fernando Sahmkow1-44/+82
2022-04-23general: Convert source file copyright comments over to SPDXMorph1-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.
2021-05-03core: Resolve misc cases of variable shadowingLioncash1-2/+2
Resolves shadowing warnings that aren't in a particularly large subsection of core. Brings us closer to turning -Wshadow into an error. All that remains now is for cases in the kernel (left untouched for now since a big change by bunnei is pending), and a few left over in the service code (will be tackled next).
2021-01-11core: hle: Add missing calls to MicroProfileOnThreadExit.bunnei1-0/+1
2020-10-21Revert "core: Fix clang build"bunnei1-7/+6
2020-10-18core: Fix clang buildLioncash1-6/+7
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-08-23core_timing: Remove unused headerLioncash1-1/+1
2020-08-23core_timing: Move clock initializer into constructor initializer listLioncash1-4/+2
Same behavior, minus unnecessary zeroing out of the pointer.
2020-08-23core_timing: Resolve sign conversion warningLioncash1-2/+2
This constant is only ever assigned to downcount, which is a s64, not a u64.
2020-07-28core_timing: Make use of uintptr_t to represent user_dataLioncash1-7/+9
Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
2020-07-16core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash1-3/+4
Enforces our desired time units directly with a concrete type.
2020-07-16core_timing: Make use of std::chrono with ScheduleEventLioncash1-4/+4
2020-06-29core_timing,scheduler: Use std::scoped_lock when possibleReinUsesLisp1-4/+2
Simplifies the cognitive load of procedures using locks and makes locks safe against exceptions.
2020-06-28Core/Common: Address Feedback.Fernando Sahmkow1-16/+12
2020-06-27CoreTiming: Correct rebase bugs and other miscellaneous things.Fernando Sahmkow1-0/+2
2020-06-27General: Tune the priority of main emulation threads so they have higher priority than less important helper threads.Fernando Sahmkow1-0/+1
2020-06-27CoreTiming/CycleTimer: Correct Idling.Fernando Sahmkow1-2/+5
2020-06-27SingleCore: Use Cycle Timing instead of Host Timing.Fernando Sahmkow1-8/+33
2020-06-27SingleCore: Move Host Timing from a sepparate thread to main cpu thread.Fernando Sahmkow1-7/+13
2020-06-27General: Fix Stop functionFernando Sahmkow1-0/+1
2020-06-27Kernel: Corrections to Scheduling.Fernando Sahmkow1-4/+7
2020-06-27HostTiming: Pause the hardware clock on pause.Fernando Sahmkow1-0/+6
2020-06-27General: Setup yuzu threads' microprofile, naming and registry.Fernando Sahmkow1-2/+3
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow1-112/+96
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.
2020-02-12Core: Set all hardware emulation constants in a single file.Fernando Sahmkow1-1/+2
2019-11-27core_timing: Use better reference tracking for EventType. (#3159)bunnei1-31/+22
* core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
2019-10-12Core_Timing: Address Remaining feedback.Fernando Sahmkow1-5/+4
2019-10-11Core_Timing: Address Feedback and suppress warnings.Fernando Sahmkow1-8/+7
2019-10-09Core Timing: Correct Idle and remove lefting pragmaFernando Sahmkow1-2/+1
2019-10-09Core Timing: General corrections and added tests.Fernando Sahmkow1-4/+11
2019-10-09Core Timing: Rework Core Timing to run all cores evenly.Fernando Sahmkow1-16/+50
2019-06-16Core_Timing: Make core_timing threadsafe by default.Fernando Sahmkow1-27/+7
The old implementation had faulty Threadsafe methods where events could be missing. This implementation unifies unsafe/safe methods and makes core timing thread safe overall.
2019-03-24core/core_timing: Make callback parameters consistentLioncash1-1/+1
In some cases, our callbacks were using s64 as a parameter, and in other cases, they were using an int, which is inconsistent. To make all callbacks consistent, we can just use an s64 as the type for late cycles, given it gets rid of the need to cast internally. While we're at it, also resolve some signed/unsigned conversions that were occurring related to the callback registration.
2019-02-16core_timing: Convert core timing into a classLioncash1-109/+80
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.
2019-02-13threadsafe_queue: Remove NeedSize template parameterLioncash1-2/+2
The necessity of this parameter is dubious at best, and in 2019 probably offers completely negligible savings as opposed to just leaving this enabled. This removes it and simplifies the overall interface.
2019-02-13core_timing: Make EmptyTimedCallback a local variableLioncash1-3/+3
Given this is only used in one place, it can be moved closest to its usage site.
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash1-2/+2
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.
2018-08-13Core::CoreTiming: add UnscheduleEventThreadsafeB3n301-0/+10
2018-08-13Kernel/Thread: Always use the threadsafe option when scheduling wakeups.Subv1-2/+0
WakeAfterDelay might be called from any host thread, so err on the side of caution and use the thread-safe CoreTiming::ScheduleEventThreadsafe. Note that CoreTiming is still far from thread-safe, there may be more things we have to work on for it to be up to par with what we want.
2018-08-06core_timing: Make GetGlobalTimeUs() return std::chrono::microsecondsLioncash1-2/+2
Enforces the time unit being returned and also allows using the standard time utilities to manipulate it.
2018-08-06core_timing: Use transparent functors where applicableLioncash1-5/+5
Gets rid of the need to hardcode the type in multiple places. This will now be deduced automatically, based off the elements in the container being provided to the algorithm.
2018-07-24core_timing: Split off utility functions into core_timing_utilMerryMage1-52/+1
2018-07-03Rename logging macro back to LOG_*James Rowe1-8/+8
2018-05-03core_timing: Don't include the log header in core timing's headerLioncash1-1/+51
Avoids propagating logging macros and facilities to files that may not need them. This also allows hiding an internal constant.
2018-04-27general: Convert assertion macros over to be fmt-compatibleLioncash1-1/+1
2018-01-20Fixes some cast warnings, partial port of citra #3064 (#106)River City Ransomware1-2/+2
* Fixes some cast warnings, partially fixes citra #3064 * Converted casts to uint32_t to u32 * Ran clang-format
2018-01-09CoreTiming: Reworked CoreTiming (cherry-picked from Citra #3119)B3n301-467/+143
* CoreTiming: New CoreTiming; Add Test for CoreTiming
2018-01-07core_timing: Increase clock speed for Switch docked.bunnei1-1/+1
2017-09-30Moved down_count to CoreTimingHuw Pascoe1-13/+23
2017-01-16CoreTiming: use named constant for ARM11 clock ratewwylele1-1/+1
2016-12-22core: Replace "AppCore" nomenclature with just "CPU".bunnei1-13/+13
2016-12-22core: Consolidate core and system state, remove system module & cleanups.bunnei1-14/+13
2016-09-21Use negative priorities to avoid special-casing the self-includeYuri Kunde Schlesner1-1/+1
2016-09-21Remove empty newlines in #include blocks.Emmanuel Gil Peyrot1-3/+1
This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation.
2016-09-19Manually tweak source formatting and then re-run clang-formatYuri Kunde Schlesner1-4/+2
2016-09-18Sources: Run clang-format on everything.Emmanuel Gil Peyrot1-19/+16
2015-09-16general: Silence some warnings when using clangLioncash1-1/+2
2015-09-12general: Replace 0 literals with nullptr where applicableLioncash1-1/+1
2015-07-19Core : Fix Conversion Warningszawata1-1/+1
2015-06-28Core: Cleanup core includes.Emmanuel Gil Peyrot1-2/+1
2015-06-28Common: Fix FileUtil includes, and everything relying on those.Emmanuel Gil Peyrot1-0/+1
2015-05-29Remove every trailing whitespace from the project (but externals).Emmanuel Gil Peyrot1-1/+1
2015-05-02CoreTiming: Initialize static variables at bootup.bunnei1-0/+10
2015-02-19Remove the useless msg_handler compilation unit that was left over from Dolphinarchshift1-2/+2
2015-02-17core/video_core: Use in-place construction where possibleLioncash1-1/+1
2015-02-13core: Apply static to local functionsLioncash1-7/+7
2015-02-12Build: Fixed some warningsSubv1-5/+5
2015-02-11Asserts: break/crash program, fit to style guide; log.h->assert.harchshift1-1/+1
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time) As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing) Also removed some GEKKO cruft.
2015-01-20core_timing: Mark several variables as staticLioncash1-14/+14
These are only used in this translation unit.
2015-01-09Move ThreadContext to core/core.h and deal with the falloutYuri Kunde Schlesner1-0/+2
2015-01-07CoreTiming: Ported the CoreTiming namespace from PPSSPPSubv1-394/+315
Implemented the required calls to make it work. CoreTiming: Added a new logging class Core_Timing.
2014-12-21License changepurpasmart961-2/+2
2014-12-13Convert old logging calls to new logging macrosYuri Kunde Schlesner1-4/+4
2014-12-03Change NULLs to nullptrs.Rohit Nirmal1-6/+6
2014-11-19Remove tabs in all files except in skyeye imports and in generated GL codeEmmanuel Gil Peyrot1-24/+24
2014-11-19Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generatedEmmanuel Gil Peyrot1-2/+2
2014-09-13Core: Replace a sprintf in core_timing with StringFromFormatLioncash1-5/+7
2014-09-07Removed common/std_xyz, instead using the std headerarchshift1-1/+1
2014-09-03Removed common/atomic, instead using std::atomicarchshift1-4/+4
2014-04-09fixed project includes to use new directory structurebunnei1-6/+7
2014-04-09got rid of 'src' folders in each sub-projectbunnei1-0/+0
2014-04-09fixed licensing issue with core_timing being GPL v2+ instead of Dolphin's GPL v2bunnei1-421/+405
2013-10-02added core_timing and system modules to core vcprojShizZy1-0/+639