summaryrefslogtreecommitdiff
path: root/src/core/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/memory.h')
-rw-r--r--src/core/memory.h53
1 files changed, 51 insertions, 2 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 7cd348b49..fc0013a96 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -170,6 +170,57 @@ public:
170 std::string ReadCString(VAddr vaddr, std::size_t max_length); 170 std::string ReadCString(VAddr vaddr, std::size_t max_length);
171 171
172 /** 172 /**
173 * Fills the specified address range within a process' address space with zeroes.
174 *
175 * @param process The process that will have a portion of its memory zeroed out.
176 * @param dest_addr The starting virtual address of the range to zero out.
177 * @param size The size of the address range to zero out, in bytes.
178 *
179 * @post The range [dest_addr, size) within the process' address space is
180 * filled with zeroes.
181 */
182 void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size);
183
184 /**
185 * Fills the specified address range within the current process' address space with zeroes.
186 *
187 * @param dest_addr The starting virtual address of the range to zero out.
188 * @param size The size of the address range to zero out, in bytes.
189 *
190 * @post The range [dest_addr, size) within the current process' address space is
191 * filled with zeroes.
192 */
193 void ZeroBlock(VAddr dest_addr, std::size_t size);
194
195 /**
196 * Copies data within a process' address space to another location within the
197 * same address space.
198 *
199 * @param process The process that will have data copied within its address space.
200 * @param dest_addr The destination virtual address to begin copying the data into.
201 * @param src_addr The source virtual address to begin copying the data from.
202 * @param size The size of the data to copy, in bytes.
203 *
204 * @post The range [dest_addr, size) within the process' address space contains the
205 * same data within the range [src_addr, size).
206 */
207 void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
208 std::size_t size);
209
210 /**
211 * Copies data within the current process' address space to another location within the
212 * same address space.
213 *
214 * @param dest_addr The destination virtual address to begin copying the data into.
215 * @param src_addr The source virtual address to begin copying the data from.
216 * @param size The size of the data to copy, in bytes.
217 *
218 * @post The range [dest_addr, size) within the current process' address space
219 * contains the same data within the range [src_addr, size).
220 */
221 void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size);
222
223 /**
173 * Marks each page within the specified address range as cached or uncached. 224 * Marks each page within the specified address range as cached or uncached.
174 * 225 *
175 * @param vaddr The virtual address indicating the start of the address range. 226 * @param vaddr The virtual address indicating the start of the address range.
@@ -206,7 +257,5 @@ void ReadBlock(VAddr src_addr, void* dest_buffer, std::size_t size);
206void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer, 257void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer,
207 std::size_t size); 258 std::size_t size);
208void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size); 259void WriteBlock(VAddr dest_addr, const void* src_buffer, std::size_t size);
209void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size);
210void CopyBlock(VAddr dest_addr, VAddr src_addr, std::size_t size);
211 260
212} // namespace Memory 261} // namespace Memory