aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_timing.h
Commit message (Collapse)AuthorAgeFilesLines
* [core/core_timing] better MWAITX and WAITPKG delays (#3984)lizzie2026-05-301-18/+9
| | | | | | | | | | | | | This implements MWAITX and WAITPKG extensions (umonitor, mwait) for CPUs that support them. Reduces wait times and bypasses the timing stuff from the OS that is slow (windows notably). generally it should answer within 0.2 to 0.5 microsecs (since most requests wait for that long). Also does a general rework of static ctors and stuff Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3984 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [common] remove ptr indirection on WallClock (#3864)lizzie2026-05-151-12/+6
| | | | | | | | | also devirtualizes manually since compiler doesn't do it with LTO Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3864 Reviewed-by: crueter <crueter@eden-emu.dev>
* [common, core] remove uneeded memory indirection overhead at startup (#3306)lizzie2026-01-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for core stuff: just remove unique ptrs that dont need any pointer stability at all (afterall its an allocation within an allocation so yeah) for fibers: Main reasoning behind this is because virtualBuffer<> is stupidly fucking expensive and it also clutters my fstat view ALSO mmap is a syscall, syscalls are bad for performance or whatever ALSO std::vector<> is better suited for handling this kind of "fixed size thing where its like big but not THAT big" (512 KiB isn't going to kill your memory usage for each fiber...) for core.cpp stuff - inlines stuff into std::optional<> as opposed to std::unique_ptr<> (because yknow, we are making the Impl from an unique_ptr, allocating within an allocation is unnecessary) - reorganizes the structures a bit so padding doesnt screw us up (it's not perfect but eh saves a measly 44 bytes) - removes unused/dead code - uses std::vector<> instead of std::deque<> no perf impact expected, maybe some initialisation boost but very minimal impact nonethless lto gets rid of most calls anyways - the heavy issue is with shared_ptr and the cache coherency from the atomics... but i clumped them together because well, they kinda do not suffer from cache coherency - hopefully not a mistake this balloons the size of Impl to about 1.67 MB - which is fine because we throw it in the stack anyways REST OF INTERFACES: most of them ballooned in size as well, but overhead is ok since its an allocation within an alloc, no stack is used (when it comes to storing these i mean) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3306 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* core_timing: handle concurrent unscheduling of looping eventsLiam2023-12-231-1/+4
|
* core_timing: use static typing for no-wait unscheduleLiam2023-12-231-5/+7
|
* core_timing: remove user data valueLiam2023-12-231-10/+6
|
* core_timing: lock event queue accessLiam2023-11-141-1/+1
|
* core_timing: Use a fibonacci heapMerry2023-09-161-6/+6
|
* Use spans over guest memory where possible instead of copying data.Kelebek12023-07-021-1/+1
|
* core_timing: Remove GetCurrentTimerResolution in CoreTiming loopMorph2023-07-021-0/+8
| | | | Other programs may change this value, but if thousands of syscalls in this loop is undesirable, then we can just set this once.
* core_timing: Fix SingleCore cycle timerMorph2023-06-071-1/+1
|
* (wall, native)_clock: Add GetGPUTickMorph2023-06-071-0/+3
| | | | Allows us to directly calculate the GPU tick without double conversion to and from the host clock tick.
* core_timing: Use CNTPCT as the guest CPU tickMorph2023-06-071-9/+2
| | | | | 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.
* general: fix spelling mistakesLiam2023-03-121-1/+1
|
* core_timing: Use higher precision sleeps on WindowsMorph2023-03-051-1/+5
| | | | | | 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.
* timing: wait for completion on unregisterLiam2023-01-141-3/+6
|
* core: core_timing: Re-initialize if single/multicore state changes.bunnei2022-10-181-0/+2
|
* core: core_timing: Remove unused IsHostTiming.bunnei2022-10-181-5/+0
|
* core: Partially persist emulation state across game boots.bunnei2022-10-181-5/+2
|
* Remove pause callbacks from coretimingKelebek12022-09-131-6/+0
|
* Revert Coretiming PRs 8531 and 7454 (#8591)Maide2022-07-271-14/+11
|
* Rework CoreTimingKelebek12022-07-101-4/+19
|
* Core timing: use only one thread.Fernando Sahmkow2022-07-021-2/+0
|
* Adress Feedback.Fernando Sahmkow2022-06-301-1/+3
|
* Core: Protect each event from race conditions within it.Fernando Sahmkow2022-06-281-0/+1
|
* Core: add missing include.Fernando Sahmkow2022-06-281-0/+1
|
* Core: Reimplement Core Timing.Fernando Sahmkow2022-06-281-10/+11
|
* 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: Use std::mutex instead of spin locks for most kernel locking.bunnei2022-04-111-3/+3
|
* core: Remove unused includesameerj2021-11-031-1/+0
|
* core: Resolve misc cases of variable shadowingLioncash2021-05-031-1/+1
| | | | | | | | | 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).
* audio_core: Make shadowing and unused parameters errorsLioncash2020-12-031-4/+4
| | | | Moves the audio code closer to enabling warnings as errors in general.
* core_timing: Make use of uintptr_t to represent user_dataLioncash2020-07-271-3/+4
| | | | 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.
* core_timing: Remove unused data memberLioncash2020-07-151-2/+0
| | | | Shrinks the size of the CoreTiming class by 8 bytes.
* core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash2020-07-151-6/+4
| | | | Enforces our desired time units directly with a concrete type.
* core_timing: Make use of std::chrono with ScheduleEventLioncash2020-07-151-4/+4
|
* Audio: Correct buffer release for host timing.Fernando Sahmkow2020-06-271-0/+5
|
* SingleCore: Use Cycle Timing instead of Host Timing.Fernando Sahmkow2020-06-271-3/+11
|
* SingleCore: Move Host Timing from a sepparate thread to main cpu thread.Fernando Sahmkow2020-06-271-0/+7
|
* Kernel: Corrections to Scheduling.Fernando Sahmkow2020-06-271-1/+1
|
* HostTiming: Pause the hardware clock on pause.Fernando Sahmkow2020-06-271-0/+1
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-271-51/+57
| | | | | | | 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.
* core_timing: Use better reference tracking for EventType. (#3159)bunnei2019-11-261-25/+20
| | | | | | | * 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.
* Core_Timing: Address Feedback and suppress warnings.Fernando Sahmkow2019-10-111-1/+1
|
* Core Timing: General corrections and added tests.Fernando Sahmkow2019-10-091-0/+1
|
* Core Timing: Rework Core Timing to run all cores evenly.Fernando Sahmkow2019-10-091-3/+21
|
* Core_Timing: Make core_timing threadsafe by default.Fernando Sahmkow2019-06-161-19/+4
| | | | | | 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.
* core/core_timing: Make callback parameters consistentLioncash2019-03-241-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.
* core_timing: Convert core timing into a classLioncash2019-02-151-75/+136
| | | | | | | | | | | 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-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.