[SvcSystem/SvcMemory] Implement SvcGetInfo 16, SvcMapPhysicalMemory & SvcUnmapPhysicalMemory (#126)
* [SvcSystem] Implement SvcGetInfo 16 SvcGetInfo 16 always should be 1(?) * Implement SvcMapPhysicalMemory & SvcUnmapPhysicalMemory * Adjusted to review.
This commit is contained in:
parent
fa4b34bd19
commit
84996ccd36
3 changed files with 28 additions and 0 deletions
|
@ -250,6 +250,26 @@ namespace Ryujinx.Core.OsHle.Kernel
|
|||
ThreadState.X1 = Handle;
|
||||
}
|
||||
|
||||
private void SvcMapPhysicalMemory(AThreadState ThreadState)
|
||||
{
|
||||
long Position = (long)ThreadState.X0;
|
||||
uint Size = (uint)ThreadState.X1;
|
||||
|
||||
Memory.Manager.Map(Position, Size, (int)MemoryType.Heap, AMemoryPerm.RW);
|
||||
|
||||
ThreadState.X0 = 0;
|
||||
}
|
||||
|
||||
private void SvcUnmapPhysicalMemory(AThreadState ThreadState)
|
||||
{
|
||||
long Position = (long)ThreadState.X0;
|
||||
uint Size = (uint)ThreadState.X1;
|
||||
|
||||
Memory.Manager.Unmap(Position, Size);
|
||||
|
||||
ThreadState.X0 = 0;
|
||||
}
|
||||
|
||||
private static bool IsValidPosition(long Position)
|
||||
{
|
||||
return Position >= MemoryRegions.AddrSpaceStart &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue