diff options
Diffstat (limited to 'src/core/hardware_properties.h')
| -rw-r--r-- | src/core/hardware_properties.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/core/hardware_properties.h b/src/core/hardware_properties.h index 62cdf9ef0..947140efb 100644 --- a/src/core/hardware_properties.h +++ b/src/core/hardware_properties.h | |||
| @@ -8,14 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | namespace Core { | 9 | namespace Core { |
| 10 | 10 | ||
| 11 | union EmuThreadHandle { | ||
| 12 | u64 raw; | ||
| 13 | struct { | ||
| 14 | u32 host_handle; | ||
| 15 | u32 guest_handle; | ||
| 16 | }; | ||
| 17 | }; | ||
| 18 | |||
| 19 | namespace Hardware { | 11 | namespace Hardware { |
| 20 | 12 | ||
| 21 | // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz | 13 | // The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz |
| @@ -23,6 +15,29 @@ namespace Hardware { | |||
| 23 | constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch cpu frequency is 1020MHz un/docked | 15 | constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch cpu frequency is 1020MHz un/docked |
| 24 | constexpr u64 CNTFREQ = 19200000; // Switch's hardware clock speed | 16 | constexpr u64 CNTFREQ = 19200000; // Switch's hardware clock speed |
| 25 | constexpr u32 NUM_CPU_CORES = 4; // Number of CPU Cores | 17 | constexpr u32 NUM_CPU_CORES = 4; // Number of CPU Cores |
| 18 | |||
| 26 | } // namespace Hardware | 19 | } // namespace Hardware |
| 27 | 20 | ||
| 21 | struct EmuThreadHandle { | ||
| 22 | u32 host_handle; | ||
| 23 | u32 guest_handle; | ||
| 24 | |||
| 25 | u64 GetRaw() const { | ||
| 26 | return (static_cast<u64>(host_handle) << 32) | guest_handle; | ||
| 27 | } | ||
| 28 | |||
| 29 | bool operator==(const EmuThreadHandle& rhs) const { | ||
| 30 | return std::tie(host_handle, guest_handle) == std::tie(rhs.host_handle, rhs.guest_handle); | ||
| 31 | } | ||
| 32 | |||
| 33 | bool operator!=(const EmuThreadHandle& rhs) const { | ||
| 34 | return !operator==(rhs); | ||
| 35 | } | ||
| 36 | |||
| 37 | static constexpr EmuThreadHandle InvalidHandle() { | ||
| 38 | constexpr u32 invalid_handle = 0xFFFFFFFF; | ||
| 39 | return {invalid_handle, invalid_handle}; | ||
| 40 | } | ||
| 41 | }; | ||
| 42 | |||
| 28 | } // namespace Core | 43 | } // namespace Core |