mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-11 04:37:49 +02:00
Rename Ryujinx.Core to Ryujinx.HLE and add a separate project for a future LLE implementation
This commit is contained in:
44
Ryujinx.HLE/OsHle/Handles/HSharedMem.cs
Normal file
44
Ryujinx.HLE/OsHle/Handles/HSharedMem.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using ChocolArm64.Memory;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.OsHle.Handles
|
||||
{
|
||||
class HSharedMem
|
||||
{
|
||||
private List<(AMemory, long)> Positions;
|
||||
|
||||
public EventHandler<EventArgs> MemoryMapped;
|
||||
public EventHandler<EventArgs> MemoryUnmapped;
|
||||
|
||||
public HSharedMem()
|
||||
{
|
||||
Positions = new List<(AMemory, long)>();
|
||||
}
|
||||
|
||||
public void AddVirtualPosition(AMemory Memory, long Position)
|
||||
{
|
||||
lock (Positions)
|
||||
{
|
||||
Positions.Add((Memory, Position));
|
||||
|
||||
MemoryMapped?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveVirtualPosition(AMemory Memory, long Position)
|
||||
{
|
||||
lock (Positions)
|
||||
{
|
||||
Positions.Remove((Memory, Position));
|
||||
|
||||
MemoryUnmapped?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public (AMemory, long)[] GetVirtualPositions()
|
||||
{
|
||||
return Positions.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user