summaryrefslogtreecommitdiffstats
path: root/src/common/page_table.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-26 16:33:28 +0200
committerGitHub <noreply@github.com>2023-07-26 16:33:28 +0200
commitd3da1e6517fe27670b6c2d713d144872d55057d8 (patch)
treeab5c72b17b15185ec40945c5ba29400569b50630 /src/common/page_table.h
parentMerge pull request #11142 from german77/avoid_crash (diff)
parentFixes and workarounds to make UBSan happier on macOS (diff)
downloadyuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar.gz
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar.bz2
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar.lz
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar.xz
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.tar.zst
yuzu-d3da1e6517fe27670b6c2d713d144872d55057d8.zip
Diffstat (limited to '')
-rw-r--r--src/common/page_table.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/page_table.h b/src/common/page_table.h
index fec8378f3..e653d52ad 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -51,7 +51,7 @@ struct PageTable {
class PageInfo {
public:
/// Returns the page pointer
- [[nodiscard]] u8* Pointer() const noexcept {
+ [[nodiscard]] uintptr_t Pointer() const noexcept {
return ExtractPointer(raw.load(std::memory_order_relaxed));
}
@@ -61,7 +61,7 @@ struct PageTable {
}
/// Returns the page pointer and attribute pair, extracted from the same atomic read
- [[nodiscard]] std::pair<u8*, PageType> PointerType() const noexcept {
+ [[nodiscard]] std::pair<uintptr_t, PageType> PointerType() const noexcept {
const uintptr_t non_atomic_raw = raw.load(std::memory_order_relaxed);
return {ExtractPointer(non_atomic_raw), ExtractType(non_atomic_raw)};
}
@@ -73,13 +73,13 @@ struct PageTable {
}
/// Write a page pointer and type pair atomically
- void Store(u8* pointer, PageType type) noexcept {
- raw.store(reinterpret_cast<uintptr_t>(pointer) | static_cast<uintptr_t>(type));
+ void Store(uintptr_t pointer, PageType type) noexcept {
+ raw.store(pointer | static_cast<uintptr_t>(type));
}
/// Unpack a pointer from a page info raw representation
- [[nodiscard]] static u8* ExtractPointer(uintptr_t raw) noexcept {
- return reinterpret_cast<u8*>(raw & (~uintptr_t{0} << ATTRIBUTE_BITS));
+ [[nodiscard]] static uintptr_t ExtractPointer(uintptr_t raw) noexcept {
+ return raw & (~uintptr_t{0} << ATTRIBUTE_BITS);
}
/// Unpack a page type from a page info raw representation