summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar LC2021-01-01 11:02:14 -0500
committerGravatar GitHub2021-01-01 11:02:14 -0500
commit9e109849ff3f61c0f1e586ebc9c16c413eb7f175 (patch)
tree317be75d2ee47aa3c280b597c1233da758c1a9ee /src/core
parentMerge pull request #5249 from ReinUsesLisp/lock-free-pages (diff)
parentmemory: Remove MemoryHook (diff)
downloadyuzu-9e109849ff3f61c0f1e586ebc9c16c413eb7f175.tar.gz
yuzu-9e109849ff3f61c0f1e586ebc9c16c413eb7f175.tar.xz
yuzu-9e109849ff3f61c0f1e586ebc9c16c413eb7f175.zip
Merge pull request #5271 from MerryMage/rm-mem-Special
memory: Remove MemoryHook
Diffstat (limited to 'src/core')
-rw-r--r--src/core/memory.cpp30
-rw-r--r--src/core/memory.h34
2 files changed, 0 insertions, 64 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index f209c4949..11609682a 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -44,27 +44,12 @@ struct Memory::Impl {
44 MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory); 44 MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, target, Common::PageType::Memory);
45 } 45 }
46 46
47 void MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
48 Common::MemoryHookPointer mmio_handler) {
49 UNIMPLEMENTED();
50 }
51
52 void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { 47 void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
53 ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size); 48 ASSERT_MSG((size & PAGE_MASK) == 0, "non-page aligned size: {:016X}", size);
54 ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base); 49 ASSERT_MSG((base & PAGE_MASK) == 0, "non-page aligned base: {:016X}", base);
55 MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped); 50 MapPages(page_table, base / PAGE_SIZE, size / PAGE_SIZE, 0, Common::PageType::Unmapped);
56 } 51 }
57 52
58 void AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
59 Common::MemoryHookPointer hook) {
60 UNIMPLEMENTED();
61 }
62
63 void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
64 Common::MemoryHookPointer hook) {
65 UNIMPLEMENTED();
66 }
67
68 bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const { 53 bool IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
69 const auto& page_table = process.PageTable().PageTableImpl(); 54 const auto& page_table = process.PageTable().PageTableImpl();
70 const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType(); 55 const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType();
@@ -740,25 +725,10 @@ void Memory::MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size
740 impl->MapMemoryRegion(page_table, base, size, target); 725 impl->MapMemoryRegion(page_table, base, size, target);
741} 726}
742 727
743void Memory::MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
744 Common::MemoryHookPointer mmio_handler) {
745 impl->MapIoRegion(page_table, base, size, std::move(mmio_handler));
746}
747
748void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) { 728void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
749 impl->UnmapRegion(page_table, base, size); 729 impl->UnmapRegion(page_table, base, size);
750} 730}
751 731
752void Memory::AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
753 Common::MemoryHookPointer hook) {
754 impl->AddDebugHook(page_table, base, size, std::move(hook));
755}
756
757void Memory::RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
758 Common::MemoryHookPointer hook) {
759 impl->RemoveDebugHook(page_table, base, size, std::move(hook));
760}
761
762bool Memory::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const { 732bool Memory::IsValidVirtualAddress(const Kernel::Process& process, const VAddr vaddr) const {
763 return impl->IsValidVirtualAddress(process, vaddr); 733 return impl->IsValidVirtualAddress(process, vaddr);
764} 734}
diff --git a/src/core/memory.h b/src/core/memory.h
index 4a1cc63f4..705ebb23d 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -8,7 +8,6 @@
8#include <memory> 8#include <memory>
9#include <string> 9#include <string>
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/memory_hook.h"
12 11
13namespace Common { 12namespace Common {
14struct PageTable; 13struct PageTable;
@@ -78,17 +77,6 @@ public:
78 void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, PAddr target); 77 void MapMemoryRegion(Common::PageTable& page_table, VAddr base, u64 size, PAddr target);
79 78
80 /** 79 /**
81 * Maps a region of the emulated process address space as a IO region.
82 *
83 * @param page_table The page table of the emulated process.
84 * @param base The address to start mapping at. Must be page-aligned.
85 * @param size The amount of bytes to map. Must be page-aligned.
86 * @param mmio_handler The handler that backs the mapping.
87 */
88 void MapIoRegion(Common::PageTable& page_table, VAddr base, u64 size,
89 Common::MemoryHookPointer mmio_handler);
90
91 /**
92 * Unmaps a region of the emulated process address space. 80 * Unmaps a region of the emulated process address space.
93 * 81 *
94 * @param page_table The page table of the emulated process. 82 * @param page_table The page table of the emulated process.
@@ -98,28 +86,6 @@ public:
98 void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size); 86 void UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size);
99 87
100 /** 88 /**
101 * Adds a memory hook to intercept reads and writes to given region of memory.
102 *
103 * @param page_table The page table of the emulated process
104 * @param base The starting address to apply the hook to.
105 * @param size The size of the memory region to apply the hook to, in bytes.
106 * @param hook The hook to apply to the region of memory.
107 */
108 void AddDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
109 Common::MemoryHookPointer hook);
110
111 /**
112 * Removes a memory hook from a given range of memory.
113 *
114 * @param page_table The page table of the emulated process.
115 * @param base The starting address to remove the hook from.
116 * @param size The size of the memory region to remove the hook from, in bytes.
117 * @param hook The hook to remove from the specified region of memory.
118 */
119 void RemoveDebugHook(Common::PageTable& page_table, VAddr base, u64 size,
120 Common::MemoryHookPointer hook);
121
122 /**
123 * Checks whether or not the supplied address is a valid virtual 89 * Checks whether or not the supplied address is a valid virtual
124 * address for the given process. 90 * address for the given process.
125 * 91 *