Commit Graph

96 Commits

Author SHA1 Message Date
ReinUsesLisp a02cc7e039 common/cityhash: Use common types
Allow sharing return types with the rest of the code base. For example,
we use 'u128 = std::array<u64, 2>', meanwhile Google's code uses
'uint128 = std::pair<u64, u64>'.

While we are at it, use size_t instead of std::size_t.
2021-02-18 00:45:17 -03:00
ReinUsesLisp 58ed3fa9f5 tests: Add tests for CityHash 2021-02-18 00:44:57 -03:00
ReinUsesLisp 3dac956230 tests/buffer_base: Add cached CPU writes tests
Ensure the behavior of the previous commit in tests.
2021-02-13 02:15:29 -03:00
MerryMage 46ea7034cc ring_buffer: Remove granularity template argument
Non-obvious bug in RingBuffer::Push(std::vector<T>&) when granularity != 1

Just remove it altogether because we do not have a use for granularity != 1
2021-02-06 19:16:00 +00:00
Rodrigo Locatti 2fccc35fa8 Merge pull request #5262 from ReinUsesLisp/buffer-base
buffer_cache/buffer_base: Add a range tracking buffer container and tests
2021-01-16 19:48:26 -03:00
Lioncash d5bff783bd common/bit_util: Replace CLZ/CTZ operations with standardized ones
Makes for less code that we need to maintain.
2021-01-15 02:15:32 -05:00
ReinUsesLisp e482ac4786 tests: Add unit tests for the GPU range tracking buffer container
Due to how error prone the container design is, this commit adds unit
tests for it.

Some tests taken from here are based on bugs from using this buffer
container in games, so if we ever break it in the future in a way that
might harm games, the tests should fail.
2021-01-13 04:31:40 -03:00
ReinUsesLisp 148a3c173a tests/ring_buffer: Silence signed/unsigned mismatch warnings 2021-01-08 23:14:38 -03:00
Morph 23413c0d44 general: Fix various spelling errors 2021-01-02 10:23:41 -05:00
MerryMage e3490b55c1 memory: Remove MemoryHook 2021-01-01 11:34:38 +00:00
bunnei 4f16c961c9 hle: kernel: Separate KScheduler from GlobalSchedulerContext class. 2020-12-06 00:03:24 -08:00
comex f2a06c61d6 tests: Fix warning about comparison between signed and unsigned 2020-11-27 17:41:20 -05:00
ReinUsesLisp 08ad5c4e42 tests: Fix data race in fibers test
Previous to this commit, the tests were using operator[] from
unordered_map to query elements but this silently inserts empty elements
when they don't exist. If all threads were executed without concurrency,
this wouldn't be an issue, but the same unordered_map could be written
from two threads at the same time. This is a data race and makes some
previously inserted elements invisible for a short period of time,
causing them to insert and return an empty element. This default
constructed element (a zero) was used to index an array of fibers that
asserted when one of them was nullptr, shutting the test session off.

To address this issue, lock on thread id reads and writes. This could be
a shared mutex to allow concurrent reads, but the definition of
std::this_thread::get_id is fuzzy when using non-standard techniques
like fibers. I opted to use a standard mutex.

While we are at it, fix the included headers.
2020-10-28 01:41:24 -03:00
Lioncash 2745697bcc tests/core_timing: Remove pragma optimize(off)
I made a review comment about this in the PR that this was introduced
in (#3955, commit 4df46e0525), but it
seems to have been missed.

We shouldn't be using this pragma here because it's MSVC specific. This
causes warnings on other compilers.

The test it's surrounding is *extremely* dubious, but for the sake of
silencing warnings on other compilers, we can mark "placebo" as volatile
and be on with it.
2020-08-03 11:12:55 -04:00
Lioncash 7decda6bc2 core_timing: Make use of uintptr_t to represent user_data
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-27 21:21:01 -04:00
Lioncash 56054fe86d core_timing: Make TimedCallback take std::chrono::nanoseconds
Enforces our desired time units directly with a concrete type.
2020-07-15 19:41:22 -04:00
Lioncash 9e113a2b67 core_timing: Make use of std::chrono with ScheduleEvent 2020-07-15 18:54:15 -04:00
Fernando Sahmkow 94a51e6b21 Core/Common: Address Feedback. 2020-06-27 18:20:06 -04:00
Fernando Sahmkow 4df46e0525 Tests/CoreTiming: Correct host timing tests. 2020-06-27 11:36:17 -04:00
Fernando Sahmkow a4e7d0b106 CoreTiming: Correct rebase bugs and other miscellaneous things. 2020-06-27 11:36:11 -04:00
Fernando Sahmkow 6f0c873d48 General: Cleanup legacy code. 2020-06-27 11:36:05 -04:00
Fernando Sahmkow 7ee76003ad General: Recover Prometheus project from harddrive failure
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-06-27 11:35:06 -04:00
Fernando Sahmkow 02fe399e26 Tests/HostTiming: Correct GCC Compile error. 2020-06-18 16:29:28 -04:00
Fernando Sahmkow 1460bdc5ab Common/Fiber: Implement Rewinding. 2020-06-18 16:29:25 -04:00
Fernando Sahmkow 564713fb46 Common/Tests: Address Feedback 2020-06-18 16:29:21 -04:00
Fernando Sahmkow 09d2ffa663 Common/Tests: Clang Format. 2020-06-18 16:29:19 -04:00
Fernando Sahmkow ee32067b10 Common: Implement WallClock Interface and implement a native clock for x64 2020-06-18 16:29:17 -04:00
Fernando Sahmkow ab76c0e296 Tests: Add base tests to host timing 2020-06-18 16:29:17 -04:00
Fernando Sahmkow a1e7931d20 Common: Polish Fiber class, add comments, asserts and more tests. 2020-06-18 16:29:15 -04:00
Fernando Sahmkow 279ff1c0ff Tests: Add tests for fibers and refactor/fix Fiber class 2020-06-18 16:29:15 -04:00
bunnei 9c753735c5 Merge pull request #3697 from lioncash/declarations
CMakeLists: Enable -Wmissing-declarations on Linux builds
2020-04-23 02:18:52 -04:00
bunnei 27ec77ef89 arm_test_common: Updates for new VMM. 2020-04-17 00:59:33 -04:00
Lioncash eaeb4520f7 General: Resolve warnings related to missing declarations 2020-04-16 23:43:34 -04:00
Lioncash 1d9be65e26 core/memory: Migrate over memory mapping functions to the new Memory class
Migrates all of the direct mapping facilities over to the new memory
class. In the process, this also obsoletes the need for memory_setup.h,
so we can remove it entirely from the project.
2019-11-26 21:53:34 -05:00
bunnei 8b35acbd29 core_timing: Use better reference tracking for EventType. (#3159)
* 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-11-26 21:48:56 -05:00
Fernando Sahmkow c057ce204e Core_Timing: Fix tests. 2019-10-12 07:23:08 -04:00
Fernando Sahmkow e96ac0e2a3 Core Timing: General corrections and added tests. 2019-10-09 12:30:33 -04:00
Fernando Sahmkow eb2ffec5a4 Tests: Eliminate old Core Timing Tests 2019-10-09 12:30:32 -04:00
bunnei 35c44f37f2 Merge pull request #2583 from FernandoS27/core-timing-safe
Core_Timing: Make core_timing threadsafe by default.
2019-06-30 12:54:00 -04:00
Fernando Sahmkow 16ee1b7006 Core_Timing: Make core_timing threadsafe by default.
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-06-16 14:14:35 -04:00
Zach Hilman 3f221f8e3f kernel: Differentiate kernel and user processes when picking ID
This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
2019-06-10 00:28:33 -04:00
Lioncash 6a929c3a2c kernel: Handle page table switching within MakeCurrentProcess()
Centralizes the page table switching to one spot, rather than making
calling code deal with it everywhere.
2019-04-07 01:12:54 -04:00
Fernando Sahmkow 1e7fd04059 Fixes and corrections on formatting. 2019-03-27 14:49:43 -04:00
Fernando Sahmkow 8fd9babe62 Add MultiLevelQueue Tests 2019-03-27 14:34:31 -04:00
Fernando Sahmkow 10cedd8bd7 Implement intrinsics CountTrailingZeroes and test it. 2019-03-27 14:34:29 -04:00
bunnei 2d7e3fe364 Merge pull request #2090 from FearlessTobi/port-4599
Port citra-emu/citra#4244 and citra-emu/citra#4599: Changes to BitField
2019-03-20 23:44:20 -04:00
bunnei 5840ce2950 core: Move PageTable struct into Common. 2019-03-16 22:05:40 -04:00
Lioncash 1f5cd8cac7 kernel: Make the address arbiter instance per-process
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.
2019-03-07 23:27:51 -05:00
Lioncash b46942d789 kernel/address_arbiter: Pass in system instance to constructor
Allows getting rid of reliance on the global accessor functions and
instead operating on the provided system instance.
2019-03-05 15:47:03 -05:00
Lioncash 1c3371c921 core_timing: Convert core timing into a class
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-15 21:50:25 -05:00