diff options
| author | 2022-10-23 17:25:18 -0700 | |
|---|---|---|
| committer | 2022-10-23 17:25:18 -0700 | |
| commit | 0313ee77936a696f9135a31ac0b644e6ffe49ae8 (patch) | |
| tree | b9e4a934447468338c60add33375409341f5bc7d /src/core | |
| parent | Merge pull request #9095 from FernandoS27/meat-good-vegetable-bad (diff) | |
| parent | CMakeLists: Disable -Wbraced-scalar-init on Clang (diff) | |
| download | yuzu-0313ee77936a696f9135a31ac0b644e6ffe49ae8.tar.gz yuzu-0313ee77936a696f9135a31ac0b644e6ffe49ae8.tar.xz yuzu-0313ee77936a696f9135a31ac0b644e6ffe49ae8.zip | |
Merge pull request #9105 from Morph1984/warnings
general: Treat more warnings as errors
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/program_metadata.cpp | 2 | ||||
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 22 | ||||
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applets.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 20 | ||||
| -rw-r--r-- | src/core/memory.cpp | 37 |
9 files changed, 47 insertions, 56 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 055bea641..113e663b5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -774,19 +774,15 @@ if (MSVC) | |||
| 774 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data | 774 | /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data |
| 775 | /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch | 775 | /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch |
| 776 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data | 776 | /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data |
| 777 | /we4800 # Implicit conversion from 'type' to bool. Possible information loss | ||
| 777 | ) | 778 | ) |
| 778 | else() | 779 | else() |
| 779 | target_compile_options(core PRIVATE | 780 | target_compile_options(core PRIVATE |
| 780 | -Werror=conversion | 781 | -Werror=conversion |
| 781 | -Werror=ignored-qualifiers | ||
| 782 | 782 | ||
| 783 | $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> | 783 | -Wno-sign-conversion |
| 784 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | ||
| 785 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable> | ||
| 786 | 784 | ||
| 787 | $<$<CXX_COMPILER_ID:Clang>:-fsized-deallocation> | 785 | $<$<CXX_COMPILER_ID:Clang>:-fsized-deallocation> |
| 788 | |||
| 789 | -Wno-sign-conversion | ||
| 790 | ) | 786 | ) |
| 791 | endif() | 787 | endif() |
| 792 | 788 | ||
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index f23d9373b..5d02865f4 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -232,8 +232,8 @@ const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const { | |||
| 232 | 232 | ||
| 233 | std::shared_ptr<NCA> XCI::GetNCAByType(NCAContentType type) const { | 233 | std::shared_ptr<NCA> XCI::GetNCAByType(NCAContentType type) const { |
| 234 | const auto program_id = secure_partition->GetProgramTitleID(); | 234 | const auto program_id = secure_partition->GetProgramTitleID(); |
| 235 | const auto iter = std::find_if( | 235 | const auto iter = |
| 236 | ncas.begin(), ncas.end(), [this, type, program_id](const std::shared_ptr<NCA>& nca) { | 236 | std::find_if(ncas.begin(), ncas.end(), [type, program_id](const std::shared_ptr<NCA>& nca) { |
| 237 | return nca->GetType() == type && nca->GetTitleId() == program_id; | 237 | return nca->GetType() == type && nca->GetTitleId() == program_id; |
| 238 | }); | 238 | }); |
| 239 | return iter == ncas.end() ? nullptr : *iter; | 239 | return iter == ncas.end() ? nullptr : *iter; |
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 08d489eab..f00479bd3 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp | |||
| @@ -127,7 +127,7 @@ void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | bool ProgramMetadata::Is64BitProgram() const { | 129 | bool ProgramMetadata::Is64BitProgram() const { |
| 130 | return npdm_header.has_64_bit_instructions; | 130 | return npdm_header.has_64_bit_instructions.As<bool>(); |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | ProgramAddressSpaceType ProgramMetadata::GetAddressSpaceType() const { | 133 | ProgramAddressSpaceType ProgramMetadata::GetAddressSpaceType() const { |
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 025f1c78e..57eff72fe 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -1158,27 +1158,27 @@ bool EmulatedController::IsControllerSupported(bool use_temporary_value) const { | |||
| 1158 | const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; | 1158 | const auto type = is_configuring && use_temporary_value ? tmp_npad_type : npad_type; |
| 1159 | switch (type) { | 1159 | switch (type) { |
| 1160 | case NpadStyleIndex::ProController: | 1160 | case NpadStyleIndex::ProController: |
| 1161 | return supported_style_tag.fullkey; | 1161 | return supported_style_tag.fullkey.As<bool>(); |
| 1162 | case NpadStyleIndex::Handheld: | 1162 | case NpadStyleIndex::Handheld: |
| 1163 | return supported_style_tag.handheld; | 1163 | return supported_style_tag.handheld.As<bool>(); |
| 1164 | case NpadStyleIndex::JoyconDual: | 1164 | case NpadStyleIndex::JoyconDual: |
| 1165 | return supported_style_tag.joycon_dual; | 1165 | return supported_style_tag.joycon_dual.As<bool>(); |
| 1166 | case NpadStyleIndex::JoyconLeft: | 1166 | case NpadStyleIndex::JoyconLeft: |
| 1167 | return supported_style_tag.joycon_left; | 1167 | return supported_style_tag.joycon_left.As<bool>(); |
| 1168 | case NpadStyleIndex::JoyconRight: | 1168 | case NpadStyleIndex::JoyconRight: |
| 1169 | return supported_style_tag.joycon_right; | 1169 | return supported_style_tag.joycon_right.As<bool>(); |
| 1170 | case NpadStyleIndex::GameCube: | 1170 | case NpadStyleIndex::GameCube: |
| 1171 | return supported_style_tag.gamecube; | 1171 | return supported_style_tag.gamecube.As<bool>(); |
| 1172 | case NpadStyleIndex::Pokeball: | 1172 | case NpadStyleIndex::Pokeball: |
| 1173 | return supported_style_tag.palma; | 1173 | return supported_style_tag.palma.As<bool>(); |
| 1174 | case NpadStyleIndex::NES: | 1174 | case NpadStyleIndex::NES: |
| 1175 | return supported_style_tag.lark; | 1175 | return supported_style_tag.lark.As<bool>(); |
| 1176 | case NpadStyleIndex::SNES: | 1176 | case NpadStyleIndex::SNES: |
| 1177 | return supported_style_tag.lucia; | 1177 | return supported_style_tag.lucia.As<bool>(); |
| 1178 | case NpadStyleIndex::N64: | 1178 | case NpadStyleIndex::N64: |
| 1179 | return supported_style_tag.lagoon; | 1179 | return supported_style_tag.lagoon.As<bool>(); |
| 1180 | case NpadStyleIndex::SegaGenesis: | 1180 | case NpadStyleIndex::SegaGenesis: |
| 1181 | return supported_style_tag.lager; | 1181 | return supported_style_tag.lager.As<bool>(); |
| 1182 | default: | 1182 | default: |
| 1183 | return false; | 1183 | return false; |
| 1184 | } | 1184 | } |
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index aa27be767..18fde8bd6 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h | |||
| @@ -406,7 +406,7 @@ inline s32 RequestParser::Pop() { | |||
| 406 | } | 406 | } |
| 407 | 407 | ||
| 408 | // Ignore the -Wclass-memaccess warning on memcpy for non-trivially default constructible objects. | 408 | // Ignore the -Wclass-memaccess warning on memcpy for non-trivially default constructible objects. |
| 409 | #if defined(__GNUC__) | 409 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) |
| 410 | #pragma GCC diagnostic push | 410 | #pragma GCC diagnostic push |
| 411 | #pragma GCC diagnostic ignored "-Wclass-memaccess" | 411 | #pragma GCC diagnostic ignored "-Wclass-memaccess" |
| 412 | #endif | 412 | #endif |
| @@ -417,7 +417,7 @@ void RequestParser::PopRaw(T& value) { | |||
| 417 | std::memcpy(&value, cmdbuf + index, sizeof(T)); | 417 | std::memcpy(&value, cmdbuf + index, sizeof(T)); |
| 418 | index += (sizeof(T) + 3) / 4; // round up to word length | 418 | index += (sizeof(T) + 3) / 4; // round up to word length |
| 419 | } | 419 | } |
| 420 | #if defined(__GNUC__) | 420 | #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) |
| 421 | #pragma GCC diagnostic pop | 421 | #pragma GCC diagnostic pop |
| 422 | #endif | 422 | #endif |
| 423 | 423 | ||
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index b07ae3f02..4aca5b27d 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -751,8 +751,8 @@ static void Break(Core::System& system, u32 reason, u64 info1, u64 info2) { | |||
| 751 | } | 751 | } |
| 752 | 752 | ||
| 753 | system.GetReporter().SaveSvcBreakReport( | 753 | system.GetReporter().SaveSvcBreakReport( |
| 754 | static_cast<u32>(break_reason.break_type.Value()), break_reason.signal_debugger, info1, | 754 | static_cast<u32>(break_reason.break_type.Value()), break_reason.signal_debugger.As<bool>(), |
| 755 | info2, has_dumped_buffer ? std::make_optional(debug_buffer) : std::nullopt); | 755 | info1, info2, has_dumped_buffer ? std::make_optional(debug_buffer) : std::nullopt); |
| 756 | 756 | ||
| 757 | if (!break_reason.signal_debugger) { | 757 | if (!break_reason.signal_debugger) { |
| 758 | LOG_CRITICAL( | 758 | LOG_CRITICAL( |
diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index e78a57657..12c6a5b1a 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h | |||
| @@ -164,7 +164,7 @@ protected: | |||
| 164 | u32_le size; | 164 | u32_le size; |
| 165 | u32_le library_version; | 165 | u32_le library_version; |
| 166 | u32_le theme_color; | 166 | u32_le theme_color; |
| 167 | u8 play_startup_sound; | 167 | bool play_startup_sound; |
| 168 | u64_le system_tick; | 168 | u64_le system_tick; |
| 169 | }; | 169 | }; |
| 170 | static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size."); | 170 | static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size."); |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index ba8a1f786..3b26e96de 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -1502,25 +1502,25 @@ bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller | |||
| 1502 | Core::HID::NpadStyleTag style = GetSupportedStyleSet(); | 1502 | Core::HID::NpadStyleTag style = GetSupportedStyleSet(); |
| 1503 | switch (controller) { | 1503 | switch (controller) { |
| 1504 | case Core::HID::NpadStyleIndex::ProController: | 1504 | case Core::HID::NpadStyleIndex::ProController: |
| 1505 | return style.fullkey; | 1505 | return style.fullkey.As<bool>(); |
| 1506 | case Core::HID::NpadStyleIndex::JoyconDual: | 1506 | case Core::HID::NpadStyleIndex::JoyconDual: |
| 1507 | return style.joycon_dual; | 1507 | return style.joycon_dual.As<bool>(); |
| 1508 | case Core::HID::NpadStyleIndex::JoyconLeft: | 1508 | case Core::HID::NpadStyleIndex::JoyconLeft: |
| 1509 | return style.joycon_left; | 1509 | return style.joycon_left.As<bool>(); |
| 1510 | case Core::HID::NpadStyleIndex::JoyconRight: | 1510 | case Core::HID::NpadStyleIndex::JoyconRight: |
| 1511 | return style.joycon_right; | 1511 | return style.joycon_right.As<bool>(); |
| 1512 | case Core::HID::NpadStyleIndex::GameCube: | 1512 | case Core::HID::NpadStyleIndex::GameCube: |
| 1513 | return style.gamecube; | 1513 | return style.gamecube.As<bool>(); |
| 1514 | case Core::HID::NpadStyleIndex::Pokeball: | 1514 | case Core::HID::NpadStyleIndex::Pokeball: |
| 1515 | return style.palma; | 1515 | return style.palma.As<bool>(); |
| 1516 | case Core::HID::NpadStyleIndex::NES: | 1516 | case Core::HID::NpadStyleIndex::NES: |
| 1517 | return style.lark; | 1517 | return style.lark.As<bool>(); |
| 1518 | case Core::HID::NpadStyleIndex::SNES: | 1518 | case Core::HID::NpadStyleIndex::SNES: |
| 1519 | return style.lucia; | 1519 | return style.lucia.As<bool>(); |
| 1520 | case Core::HID::NpadStyleIndex::N64: | 1520 | case Core::HID::NpadStyleIndex::N64: |
| 1521 | return style.lagoon; | 1521 | return style.lagoon.As<bool>(); |
| 1522 | case Core::HID::NpadStyleIndex::SegaGenesis: | 1522 | case Core::HID::NpadStyleIndex::SegaGenesis: |
| 1523 | return style.lager; | 1523 | return style.lager.As<bool>(); |
| 1524 | default: | 1524 | default: |
| 1525 | return false; | 1525 | return false; |
| 1526 | } | 1526 | } |
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 9637cb5b1..3ca80c8ff 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -233,18 +233,17 @@ struct Memory::Impl { | |||
| 233 | current_vaddr, src_addr, size); | 233 | current_vaddr, src_addr, size); |
| 234 | std::memset(dest_buffer, 0, copy_amount); | 234 | std::memset(dest_buffer, 0, copy_amount); |
| 235 | }, | 235 | }, |
| 236 | [&dest_buffer](const std::size_t copy_amount, const u8* const src_ptr) { | 236 | [&](const std::size_t copy_amount, const u8* const src_ptr) { |
| 237 | std::memcpy(dest_buffer, src_ptr, copy_amount); | 237 | std::memcpy(dest_buffer, src_ptr, copy_amount); |
| 238 | }, | 238 | }, |
| 239 | [&system = system, &dest_buffer](const VAddr current_vaddr, | 239 | [&](const VAddr current_vaddr, const std::size_t copy_amount, |
| 240 | const std::size_t copy_amount, | 240 | const u8* const host_ptr) { |
| 241 | const u8* const host_ptr) { | ||
| 242 | if constexpr (!UNSAFE) { | 241 | if constexpr (!UNSAFE) { |
| 243 | system.GPU().FlushRegion(current_vaddr, copy_amount); | 242 | system.GPU().FlushRegion(current_vaddr, copy_amount); |
| 244 | } | 243 | } |
| 245 | std::memcpy(dest_buffer, host_ptr, copy_amount); | 244 | std::memcpy(dest_buffer, host_ptr, copy_amount); |
| 246 | }, | 245 | }, |
| 247 | [&dest_buffer](const std::size_t copy_amount) { | 246 | [&](const std::size_t copy_amount) { |
| 248 | dest_buffer = static_cast<u8*>(dest_buffer) + copy_amount; | 247 | dest_buffer = static_cast<u8*>(dest_buffer) + copy_amount; |
| 249 | }); | 248 | }); |
| 250 | } | 249 | } |
| @@ -267,17 +266,16 @@ struct Memory::Impl { | |||
| 267 | "Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", | 266 | "Unmapped WriteBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", |
| 268 | current_vaddr, dest_addr, size); | 267 | current_vaddr, dest_addr, size); |
| 269 | }, | 268 | }, |
| 270 | [&src_buffer](const std::size_t copy_amount, u8* const dest_ptr) { | 269 | [&](const std::size_t copy_amount, u8* const dest_ptr) { |
| 271 | std::memcpy(dest_ptr, src_buffer, copy_amount); | 270 | std::memcpy(dest_ptr, src_buffer, copy_amount); |
| 272 | }, | 271 | }, |
| 273 | [&system = system, &src_buffer](const VAddr current_vaddr, | 272 | [&](const VAddr current_vaddr, const std::size_t copy_amount, u8* const host_ptr) { |
| 274 | const std::size_t copy_amount, u8* const host_ptr) { | ||
| 275 | if constexpr (!UNSAFE) { | 273 | if constexpr (!UNSAFE) { |
| 276 | system.GPU().InvalidateRegion(current_vaddr, copy_amount); | 274 | system.GPU().InvalidateRegion(current_vaddr, copy_amount); |
| 277 | } | 275 | } |
| 278 | std::memcpy(host_ptr, src_buffer, copy_amount); | 276 | std::memcpy(host_ptr, src_buffer, copy_amount); |
| 279 | }, | 277 | }, |
| 280 | [&src_buffer](const std::size_t copy_amount) { | 278 | [&](const std::size_t copy_amount) { |
| 281 | src_buffer = static_cast<const u8*>(src_buffer) + copy_amount; | 279 | src_buffer = static_cast<const u8*>(src_buffer) + copy_amount; |
| 282 | }); | 280 | }); |
| 283 | } | 281 | } |
| @@ -301,8 +299,7 @@ struct Memory::Impl { | |||
| 301 | [](const std::size_t copy_amount, u8* const dest_ptr) { | 299 | [](const std::size_t copy_amount, u8* const dest_ptr) { |
| 302 | std::memset(dest_ptr, 0, copy_amount); | 300 | std::memset(dest_ptr, 0, copy_amount); |
| 303 | }, | 301 | }, |
| 304 | [&system = system](const VAddr current_vaddr, const std::size_t copy_amount, | 302 | [&](const VAddr current_vaddr, const std::size_t copy_amount, u8* const host_ptr) { |
| 305 | u8* const host_ptr) { | ||
| 306 | system.GPU().InvalidateRegion(current_vaddr, copy_amount); | 303 | system.GPU().InvalidateRegion(current_vaddr, copy_amount); |
| 307 | std::memset(host_ptr, 0, copy_amount); | 304 | std::memset(host_ptr, 0, copy_amount); |
| 308 | }, | 305 | }, |
| @@ -313,22 +310,20 @@ struct Memory::Impl { | |||
| 313 | const std::size_t size) { | 310 | const std::size_t size) { |
| 314 | WalkBlock( | 311 | WalkBlock( |
| 315 | process, dest_addr, size, | 312 | process, dest_addr, size, |
| 316 | [this, &process, &dest_addr, &src_addr, size](const std::size_t copy_amount, | 313 | [&](const std::size_t copy_amount, const VAddr current_vaddr) { |
| 317 | const VAddr current_vaddr) { | ||
| 318 | LOG_ERROR(HW_Memory, | 314 | LOG_ERROR(HW_Memory, |
| 319 | "Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", | 315 | "Unmapped CopyBlock @ 0x{:016X} (start address = 0x{:016X}, size = {})", |
| 320 | current_vaddr, src_addr, size); | 316 | current_vaddr, src_addr, size); |
| 321 | ZeroBlock(process, dest_addr, copy_amount); | 317 | ZeroBlock(process, dest_addr, copy_amount); |
| 322 | }, | 318 | }, |
| 323 | [this, &process, &dest_addr](const std::size_t copy_amount, const u8* const src_ptr) { | 319 | [&](const std::size_t copy_amount, const u8* const src_ptr) { |
| 324 | WriteBlockImpl<false>(process, dest_addr, src_ptr, copy_amount); | 320 | WriteBlockImpl<false>(process, dest_addr, src_ptr, copy_amount); |
| 325 | }, | 321 | }, |
| 326 | [this, &system = system, &process, &dest_addr]( | 322 | [&](const VAddr current_vaddr, const std::size_t copy_amount, u8* const host_ptr) { |
| 327 | const VAddr current_vaddr, const std::size_t copy_amount, u8* const host_ptr) { | ||
| 328 | system.GPU().FlushRegion(current_vaddr, copy_amount); | 323 | system.GPU().FlushRegion(current_vaddr, copy_amount); |
| 329 | WriteBlockImpl<false>(process, dest_addr, host_ptr, copy_amount); | 324 | WriteBlockImpl<false>(process, dest_addr, host_ptr, copy_amount); |
| 330 | }, | 325 | }, |
| 331 | [&dest_addr, &src_addr](const std::size_t copy_amount) { | 326 | [&](const std::size_t copy_amount) { |
| 332 | dest_addr += static_cast<VAddr>(copy_amount); | 327 | dest_addr += static_cast<VAddr>(copy_amount); |
| 333 | src_addr += static_cast<VAddr>(copy_amount); | 328 | src_addr += static_cast<VAddr>(copy_amount); |
| 334 | }); | 329 | }); |
| @@ -575,7 +570,7 @@ struct Memory::Impl { | |||
| 575 | [vaddr]() { | 570 | [vaddr]() { |
| 576 | LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:016X}", sizeof(T) * 8, vaddr); | 571 | LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:016X}", sizeof(T) * 8, vaddr); |
| 577 | }, | 572 | }, |
| 578 | [&system = system, vaddr]() { system.GPU().FlushRegion(vaddr, sizeof(T)); }); | 573 | [&]() { system.GPU().FlushRegion(vaddr, sizeof(T)); }); |
| 579 | if (ptr) { | 574 | if (ptr) { |
| 580 | std::memcpy(&result, ptr, sizeof(T)); | 575 | std::memcpy(&result, ptr, sizeof(T)); |
| 581 | } | 576 | } |
| @@ -599,7 +594,7 @@ struct Memory::Impl { | |||
| 599 | LOG_ERROR(HW_Memory, "Unmapped Write{} @ 0x{:016X} = 0x{:016X}", sizeof(T) * 8, | 594 | LOG_ERROR(HW_Memory, "Unmapped Write{} @ 0x{:016X} = 0x{:016X}", sizeof(T) * 8, |
| 600 | vaddr, static_cast<u64>(data)); | 595 | vaddr, static_cast<u64>(data)); |
| 601 | }, | 596 | }, |
| 602 | [&system = system, vaddr]() { system.GPU().InvalidateRegion(vaddr, sizeof(T)); }); | 597 | [&]() { system.GPU().InvalidateRegion(vaddr, sizeof(T)); }); |
| 603 | if (ptr) { | 598 | if (ptr) { |
| 604 | std::memcpy(ptr, &data, sizeof(T)); | 599 | std::memcpy(ptr, &data, sizeof(T)); |
| 605 | } | 600 | } |
| @@ -613,7 +608,7 @@ struct Memory::Impl { | |||
| 613 | LOG_ERROR(HW_Memory, "Unmapped WriteExclusive{} @ 0x{:016X} = 0x{:016X}", | 608 | LOG_ERROR(HW_Memory, "Unmapped WriteExclusive{} @ 0x{:016X} = 0x{:016X}", |
| 614 | sizeof(T) * 8, vaddr, static_cast<u64>(data)); | 609 | sizeof(T) * 8, vaddr, static_cast<u64>(data)); |
| 615 | }, | 610 | }, |
| 616 | [&system = system, vaddr]() { system.GPU().InvalidateRegion(vaddr, sizeof(T)); }); | 611 | [&]() { system.GPU().InvalidateRegion(vaddr, sizeof(T)); }); |
| 617 | if (ptr) { | 612 | if (ptr) { |
| 618 | const auto volatile_pointer = reinterpret_cast<volatile T*>(ptr); | 613 | const auto volatile_pointer = reinterpret_cast<volatile T*>(ptr); |
| 619 | return Common::AtomicCompareAndSwap(volatile_pointer, data, expected); | 614 | return Common::AtomicCompareAndSwap(volatile_pointer, data, expected); |
| @@ -628,7 +623,7 @@ struct Memory::Impl { | |||
| 628 | LOG_ERROR(HW_Memory, "Unmapped WriteExclusive128 @ 0x{:016X} = 0x{:016X}{:016X}", | 623 | LOG_ERROR(HW_Memory, "Unmapped WriteExclusive128 @ 0x{:016X} = 0x{:016X}{:016X}", |
| 629 | vaddr, static_cast<u64>(data[1]), static_cast<u64>(data[0])); | 624 | vaddr, static_cast<u64>(data[1]), static_cast<u64>(data[0])); |
| 630 | }, | 625 | }, |
| 631 | [&system = system, vaddr]() { system.GPU().InvalidateRegion(vaddr, sizeof(u128)); }); | 626 | [&]() { system.GPU().InvalidateRegion(vaddr, sizeof(u128)); }); |
| 632 | if (ptr) { | 627 | if (ptr) { |
| 633 | const auto volatile_pointer = reinterpret_cast<volatile u64*>(ptr); | 628 | const auto volatile_pointer = reinterpret_cast<volatile u64*>(ptr); |
| 634 | return Common::AtomicCompareAndSwap(volatile_pointer, data, expected); | 629 | return Common::AtomicCompareAndSwap(volatile_pointer, data, expected); |