mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-11 18:46:30 +00:00
Ranged cache invalidation
This commit is contained in:
33
src/common/address_range.h
Normal file
33
src/common/address_range.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2016 MerryMage
|
||||
* This software may be used and distributed according to the terms of the GNU
|
||||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Dynarmic {
|
||||
namespace Common {
|
||||
|
||||
struct FullAddressRange {};
|
||||
|
||||
struct AddressInterval {
|
||||
u32 start_address;
|
||||
std::size_t length;
|
||||
|
||||
// Does this interval overlap with [from, to)?
|
||||
bool Overlaps(u32 from, u32 to) const {
|
||||
return start_address <= to && from <= start_address + length;
|
||||
}
|
||||
};
|
||||
|
||||
using AddressRange = boost::variant<FullAddressRange, AddressInterval>;
|
||||
|
||||
} // namespace Common
|
||||
} // namespace Dynarmic
|
||||
Reference in New Issue
Block a user