early-access version 1659

This commit is contained in:
pineappleEA
2021-05-06 03:20:08 +02:00
parent 590872e3be
commit 37b353b187
142 changed files with 1763 additions and 1991 deletions

View File

@@ -19,7 +19,7 @@ class System;
namespace Kernel {
class PhysicalMemory;
class KProcess;
class Process;
} // namespace Kernel
namespace Core::Memory {
@@ -58,17 +58,12 @@ public:
Memory(Memory&&) = default;
Memory& operator=(Memory&&) = default;
/**
* Resets the state of the Memory system.
*/
void Reset();
/**
* Changes the currently active page table to that of the given process instance.
*
* @param process The process to use the page table of.
*/
void SetCurrentPageTable(Kernel::KProcess& process, u32 core_id);
void SetCurrentPageTable(Kernel::Process& process, u32 core_id);
/**
* Maps an allocated buffer onto a region of the emulated process address space.
@@ -99,7 +94,7 @@ public:
*
* @returns True if the given virtual address is valid, false otherwise.
*/
bool IsValidVirtualAddress(const Kernel::KProcess& process, VAddr vaddr) const;
bool IsValidVirtualAddress(const Kernel::Process& process, VAddr vaddr) const;
/**
* Checks whether or not the supplied address is a valid virtual
@@ -121,15 +116,6 @@ public:
*/
u8* GetPointer(VAddr vaddr);
/**
* Gets a pointer to the start of a kernel heap allocated memory region. Will allocate one if it
* does not already exist.
*
* @param start_vaddr Start virtual address for the memory region.
* @param size Size of the memory region.
*/
u8* GetKernelBuffer(VAddr start_vaddr, size_t size);
template <typename T>
T* GetPointer(VAddr vaddr) {
return reinterpret_cast<T*>(GetPointer(vaddr));
@@ -333,7 +319,7 @@ public:
* @post The range [dest_buffer, size) contains the read bytes from the
* process' address space.
*/
void ReadBlock(const Kernel::KProcess& process, VAddr src_addr, void* dest_buffer,
void ReadBlock(const Kernel::Process& process, VAddr src_addr, void* dest_buffer,
std::size_t size);
/**
@@ -354,7 +340,7 @@ public:
* @post The range [dest_buffer, size) contains the read bytes from the
* process' address space.
*/
void ReadBlockUnsafe(const Kernel::KProcess& process, VAddr src_addr, void* dest_buffer,
void ReadBlockUnsafe(const Kernel::Process& process, VAddr src_addr, void* dest_buffer,
std::size_t size);
/**
@@ -414,7 +400,7 @@ public:
* and will mark that region as invalidated to caches that the active
* graphics backend may be maintaining over the course of execution.
*/
void WriteBlock(const Kernel::KProcess& process, VAddr dest_addr, const void* src_buffer,
void WriteBlock(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer,
std::size_t size);
/**
@@ -434,7 +420,7 @@ public:
* will be ignored and an error will be logged.
*
*/
void WriteBlockUnsafe(const Kernel::KProcess& process, VAddr dest_addr, const void* src_buffer,
void WriteBlockUnsafe(const Kernel::Process& process, VAddr dest_addr, const void* src_buffer,
std::size_t size);
/**
@@ -486,7 +472,7 @@ public:
* @post The range [dest_addr, size) within the process' address space is
* filled with zeroes.
*/
void ZeroBlock(const Kernel::KProcess& process, VAddr dest_addr, std::size_t size);
void ZeroBlock(const Kernel::Process& process, VAddr dest_addr, std::size_t size);
/**
* Fills the specified address range within the current process' address space with zeroes.
@@ -511,7 +497,7 @@ public:
* @post The range [dest_addr, size) within the process' address space contains the
* same data within the range [src_addr, size).
*/
void CopyBlock(const Kernel::KProcess& process, VAddr dest_addr, VAddr src_addr,
void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr,
std::size_t size);
/**
@@ -538,8 +524,6 @@ public:
void RasterizerMarkRegionCached(VAddr vaddr, u64 size, bool cached);
private:
Core::System& system;
struct Impl;
std::unique_ptr<Impl> impl;
};