Rename untracked to writeable

This commit is contained in:
Lander Gallastegi 2025-06-16 18:30:25 +02:00
parent d43d1bcbfe
commit 64f1111582
2 changed files with 16 additions and 16 deletions

View File

@ -20,7 +20,7 @@ constexpr u64 NUM_REGION_PAGES = HIGHER_PAGE_SIZE / BYTES_PER_PAGE;
enum class Type { enum class Type {
CPU, CPU,
GPU, GPU,
Untracked, Writeable,
}; };
using RegionBits = Common::BitArray<NUM_REGION_PAGES>; using RegionBits = Common::BitArray<NUM_REGION_PAGES>;

View File

@ -29,7 +29,7 @@ public:
: tracker{tracker_}, cpu_addr{cpu_addr_} { : tracker{tracker_}, cpu_addr{cpu_addr_} {
cpu.Fill(); cpu.Fill();
gpu.Clear(); gpu.Clear();
untracked.Fill(); writeable.Fill();
} }
explicit RegionManager() = default; explicit RegionManager() = default;
@ -47,13 +47,13 @@ public:
template <Type type> template <Type type>
RegionBits& GetRegionBits() noexcept { RegionBits& GetRegionBits() noexcept {
static_assert(type != Type::Untracked); static_assert(type != Type::Writeable);
if constexpr (type == Type::CPU) { if constexpr (type == Type::CPU) {
return cpu; return cpu;
} else if constexpr (type == Type::GPU) { } else if constexpr (type == Type::GPU) {
return gpu; return gpu;
} else if constexpr (type == Type::Untracked) { } else if constexpr (type == Type::Writeable) {
return untracked; return writeable;
} else { } else {
static_assert(false, "Invalid type"); static_assert(false, "Invalid type");
} }
@ -61,13 +61,13 @@ public:
template <Type type> template <Type type>
const RegionBits& GetRegionBits() const noexcept { const RegionBits& GetRegionBits() const noexcept {
static_assert(type != Type::Untracked); static_assert(type != Type::Writeable);
if constexpr (type == Type::CPU) { if constexpr (type == Type::CPU) {
return cpu; return cpu;
} else if constexpr (type == Type::GPU) { } else if constexpr (type == Type::GPU) {
return gpu; return gpu;
} else if constexpr (type == Type::Untracked) { } else if constexpr (type == Type::Writeable) {
return untracked; return writeable;
} else { } else {
static_assert(false, "Invalid type"); static_assert(false, "Invalid type");
} }
@ -89,7 +89,7 @@ public:
} }
RENDERER_TRACE; RENDERER_TRACE;
std::unique_lock lk{lock}; std::unique_lock lk{lock};
static_assert(type != Type::Untracked); static_assert(type != Type::Writeable);
RegionBits& bits = GetRegionBits<type>(); RegionBits& bits = GetRegionBits<type>();
if constexpr (enable) { if constexpr (enable) {
@ -120,13 +120,13 @@ public:
return; return;
} }
std::unique_lock lk{lock}; std::unique_lock lk{lock};
static_assert(type != Type::Untracked); static_assert(type != Type::Writeable);
RegionBits& bits = GetRegionBits<type>(); RegionBits& bits = GetRegionBits<type>();
RegionBits mask{}; RegionBits mask{};
mask.SetRange(start_page, end_page); mask.SetRange(start_page, end_page);
if constexpr (type == Type::GPU) { if constexpr (type == Type::GPU) {
mask &= ~untracked; mask &= ~writeable;
} }
mask &= bits; mask &= bits;
@ -157,13 +157,13 @@ public:
return false; return false;
} }
// std::scoped_lock lk{lock}; // Is this needed? // std::scoped_lock lk{lock}; // Is this needed?
static_assert(type != Type::Untracked); static_assert(type != Type::Writeable);
const RegionBits& bits = GetRegionBits<type>(); const RegionBits& bits = GetRegionBits<type>();
RegionBits test{}; RegionBits test{};
test.SetRange(start_page, end_page); test.SetRange(start_page, end_page);
if constexpr (type == Type::GPU) { if constexpr (type == Type::GPU) {
test &= ~untracked; test &= ~writeable;
} }
test &= bits; test &= bits;
return test.Any(); return test.Any();
@ -182,8 +182,8 @@ private:
template <bool add_to_tracker, typename Lock> template <bool add_to_tracker, typename Lock>
void UpdateProtection(Lock&& lk) { void UpdateProtection(Lock&& lk) {
RENDERER_TRACE; RENDERER_TRACE;
RegionBits mask = cpu ^ untracked; RegionBits mask = cpu ^ writeable;
untracked = cpu; writeable = cpu;
lk.unlock(); lk.unlock();
tracker->UpdatePageWatchersMasked<add_to_tracker>(cpu_addr, mask); tracker->UpdatePageWatchersMasked<add_to_tracker>(cpu_addr, mask);
} }
@ -197,7 +197,7 @@ private:
VAddr cpu_addr = 0; VAddr cpu_addr = 0;
RegionBits cpu; RegionBits cpu;
RegionBits gpu; RegionBits gpu;
RegionBits untracked; RegionBits writeable;
}; };
} // namespace VideoCore } // namespace VideoCore