diff options
| author | 2023-03-23 19:58:48 -0400 | |
|---|---|---|
| committer | 2023-03-23 20:28:47 -0400 | |
| commit | 41d99aa89db7ee483112e49baa6c86e14adbd168 (patch) | |
| tree | 085ba1f2eb6a75c2b93d70834cc20d4b14f4d10f /src/core/memory.h | |
| parent | Merge pull request #9971 from Morph1984/q (diff) | |
| download | yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.gz yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.tar.xz yuzu-41d99aa89db7ee483112e49baa6c86e14adbd168.zip | |
memory: rename global memory references to application memory
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 64 |
1 files changed, 6 insertions, 58 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index ed4e87739..72a0be813 100644 --- a/src/core/memory.h +++ b/src/core/memory.h | |||
| @@ -305,26 +305,6 @@ public: | |||
| 305 | std::string ReadCString(Common::ProcessAddress vaddr, std::size_t max_length); | 305 | std::string ReadCString(Common::ProcessAddress vaddr, std::size_t max_length); |
| 306 | 306 | ||
| 307 | /** | 307 | /** |
| 308 | * Reads a contiguous block of bytes from a specified process' address space. | ||
| 309 | * | ||
| 310 | * @param process The process to read the data from. | ||
| 311 | * @param src_addr The virtual address to begin reading from. | ||
| 312 | * @param dest_buffer The buffer to place the read bytes into. | ||
| 313 | * @param size The amount of data to read, in bytes. | ||
| 314 | * | ||
| 315 | * @note If a size of 0 is specified, then this function reads nothing and | ||
| 316 | * no attempts to access memory are made at all. | ||
| 317 | * | ||
| 318 | * @pre dest_buffer must be at least size bytes in length, otherwise a | ||
| 319 | * buffer overrun will occur. | ||
| 320 | * | ||
| 321 | * @post The range [dest_buffer, size) contains the read bytes from the | ||
| 322 | * process' address space. | ||
| 323 | */ | ||
| 324 | void ReadBlock(const Kernel::KProcess& process, Common::ProcessAddress src_addr, | ||
| 325 | void* dest_buffer, std::size_t size); | ||
| 326 | |||
| 327 | /** | ||
| 328 | * Reads a contiguous block of bytes from the current process' address space. | 308 | * Reads a contiguous block of bytes from the current process' address space. |
| 329 | * | 309 | * |
| 330 | * @param src_addr The virtual address to begin reading from. | 310 | * @param src_addr The virtual address to begin reading from. |
| @@ -362,29 +342,6 @@ public: | |||
| 362 | void ReadBlockUnsafe(Common::ProcessAddress src_addr, void* dest_buffer, std::size_t size); | 342 | void ReadBlockUnsafe(Common::ProcessAddress src_addr, void* dest_buffer, std::size_t size); |
| 363 | 343 | ||
| 364 | /** | 344 | /** |
| 365 | * Writes a range of bytes into a given process' address space at the specified | ||
| 366 | * virtual address. | ||
| 367 | * | ||
| 368 | * @param process The process to write data into the address space of. | ||
| 369 | * @param dest_addr The destination virtual address to begin writing the data at. | ||
| 370 | * @param src_buffer The data to write into the process' address space. | ||
| 371 | * @param size The size of the data to write, in bytes. | ||
| 372 | * | ||
| 373 | * @post The address range [dest_addr, size) in the process' address space | ||
| 374 | * contains the data that was within src_buffer. | ||
| 375 | * | ||
| 376 | * @post If an attempt is made to write into an unmapped region of memory, the writes | ||
| 377 | * will be ignored and an error will be logged. | ||
| 378 | * | ||
| 379 | * @post If a write is performed into a region of memory that is considered cached | ||
| 380 | * rasterizer memory, will cause the currently active rasterizer to be notified | ||
| 381 | * and will mark that region as invalidated to caches that the active | ||
| 382 | * graphics backend may be maintaining over the course of execution. | ||
| 383 | */ | ||
| 384 | void WriteBlock(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | ||
| 385 | const void* src_buffer, std::size_t size); | ||
| 386 | |||
| 387 | /** | ||
| 388 | * Writes a range of bytes into the current process' address space at the specified | 345 | * Writes a range of bytes into the current process' address space at the specified |
| 389 | * virtual address. | 346 | * virtual address. |
| 390 | * | 347 | * |
| @@ -428,7 +385,6 @@ public: | |||
| 428 | * Copies data within a process' address space to another location within the | 385 | * Copies data within a process' address space to another location within the |
| 429 | * same address space. | 386 | * same address space. |
| 430 | * | 387 | * |
| 431 | * @param process The process that will have data copied within its address space. | ||
| 432 | * @param dest_addr The destination virtual address to begin copying the data into. | 388 | * @param dest_addr The destination virtual address to begin copying the data into. |
| 433 | * @param src_addr The source virtual address to begin copying the data from. | 389 | * @param src_addr The source virtual address to begin copying the data from. |
| 434 | * @param size The size of the data to copy, in bytes. | 390 | * @param size The size of the data to copy, in bytes. |
| @@ -436,58 +392,50 @@ public: | |||
| 436 | * @post The range [dest_addr, size) within the process' address space contains the | 392 | * @post The range [dest_addr, size) within the process' address space contains the |
| 437 | * same data within the range [src_addr, size). | 393 | * same data within the range [src_addr, size). |
| 438 | */ | 394 | */ |
| 439 | void CopyBlock(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | 395 | void CopyBlock(Common::ProcessAddress dest_addr, Common::ProcessAddress src_addr, |
| 440 | Common::ProcessAddress src_addr, std::size_t size); | 396 | std::size_t size); |
| 441 | 397 | ||
| 442 | /** | 398 | /** |
| 443 | * Zeros a range of bytes within the current process' address space at the specified | 399 | * Zeros a range of bytes within the current process' address space at the specified |
| 444 | * virtual address. | 400 | * virtual address. |
| 445 | * | 401 | * |
| 446 | * @param process The process that will have data zeroed within its address space. | ||
| 447 | * @param dest_addr The destination virtual address to zero the data from. | 402 | * @param dest_addr The destination virtual address to zero the data from. |
| 448 | * @param size The size of the range to zero out, in bytes. | 403 | * @param size The size of the range to zero out, in bytes. |
| 449 | * | 404 | * |
| 450 | * @post The range [dest_addr, size) within the process' address space contains the | 405 | * @post The range [dest_addr, size) within the process' address space contains the |
| 451 | * value 0. | 406 | * value 0. |
| 452 | */ | 407 | */ |
| 453 | void ZeroBlock(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | 408 | void ZeroBlock(Common::ProcessAddress dest_addr, std::size_t size); |
| 454 | std::size_t size); | ||
| 455 | 409 | ||
| 456 | /** | 410 | /** |
| 457 | * Invalidates a range of bytes within the current process' address space at the specified | 411 | * Invalidates a range of bytes within the current process' address space at the specified |
| 458 | * virtual address. | 412 | * virtual address. |
| 459 | * | 413 | * |
| 460 | * @param process The process that will have data invalidated within its address space. | ||
| 461 | * @param dest_addr The destination virtual address to invalidate the data from. | 414 | * @param dest_addr The destination virtual address to invalidate the data from. |
| 462 | * @param size The size of the range to invalidate, in bytes. | 415 | * @param size The size of the range to invalidate, in bytes. |
| 463 | * | 416 | * |
| 464 | */ | 417 | */ |
| 465 | Result InvalidateDataCache(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | 418 | Result InvalidateDataCache(Common::ProcessAddress dest_addr, std::size_t size); |
| 466 | std::size_t size); | ||
| 467 | 419 | ||
| 468 | /** | 420 | /** |
| 469 | * Stores a range of bytes within the current process' address space at the specified | 421 | * Stores a range of bytes within the current process' address space at the specified |
| 470 | * virtual address. | 422 | * virtual address. |
| 471 | * | 423 | * |
| 472 | * @param process The process that will have data stored within its address space. | ||
| 473 | * @param dest_addr The destination virtual address to store the data from. | 424 | * @param dest_addr The destination virtual address to store the data from. |
| 474 | * @param size The size of the range to store, in bytes. | 425 | * @param size The size of the range to store, in bytes. |
| 475 | * | 426 | * |
| 476 | */ | 427 | */ |
| 477 | Result StoreDataCache(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | 428 | Result StoreDataCache(Common::ProcessAddress dest_addr, std::size_t size); |
| 478 | std::size_t size); | ||
| 479 | 429 | ||
| 480 | /** | 430 | /** |
| 481 | * Flushes a range of bytes within the current process' address space at the specified | 431 | * Flushes a range of bytes within the current process' address space at the specified |
| 482 | * virtual address. | 432 | * virtual address. |
| 483 | * | 433 | * |
| 484 | * @param process The process that will have data flushed within its address space. | ||
| 485 | * @param dest_addr The destination virtual address to flush the data from. | 434 | * @param dest_addr The destination virtual address to flush the data from. |
| 486 | * @param size The size of the range to flush, in bytes. | 435 | * @param size The size of the range to flush, in bytes. |
| 487 | * | 436 | * |
| 488 | */ | 437 | */ |
| 489 | Result FlushDataCache(const Kernel::KProcess& process, Common::ProcessAddress dest_addr, | 438 | Result FlushDataCache(Common::ProcessAddress dest_addr, std::size_t size); |
| 490 | std::size_t size); | ||
| 491 | 439 | ||
| 492 | /** | 440 | /** |
| 493 | * Marks each page within the specified address range as cached or uncached. | 441 | * Marks each page within the specified address range as cached or uncached. |