mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-29 11:56:24 +02:00
memory: Add Android support
This commit is contained in:
parent
c27a12df2c
commit
0b14eb3a61
4 changed files with 36 additions and 16 deletions
|
@ -89,6 +89,9 @@ namespace Ryujinx.Memory
|
|||
[LibraryImport("libc", SetLastError = true)]
|
||||
public static partial int shm_unlink(IntPtr name);
|
||||
|
||||
[DllImport("android")]
|
||||
internal static extern int ASharedMemory_create(IntPtr name, nuint size);
|
||||
|
||||
private static int MmapFlagsToSystemFlags(MmapFlags flags)
|
||||
{
|
||||
int result = 0;
|
||||
|
@ -110,7 +113,7 @@ namespace Ryujinx.Memory
|
|||
|
||||
if (flags.HasFlag(MmapFlags.MAP_ANONYMOUS))
|
||||
{
|
||||
if (OperatingSystem.IsLinux())
|
||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid())
|
||||
{
|
||||
result |= MAP_ANONYMOUS_LINUX_GENERIC;
|
||||
}
|
||||
|
@ -126,7 +129,7 @@ namespace Ryujinx.Memory
|
|||
|
||||
if (flags.HasFlag(MmapFlags.MAP_NORESERVE))
|
||||
{
|
||||
if (OperatingSystem.IsLinux())
|
||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid())
|
||||
{
|
||||
result |= MAP_NORESERVE_LINUX_GENERIC;
|
||||
}
|
||||
|
@ -142,7 +145,7 @@ namespace Ryujinx.Memory
|
|||
|
||||
if (flags.HasFlag(MmapFlags.MAP_UNLOCKED))
|
||||
{
|
||||
if (OperatingSystem.IsLinux())
|
||||
if (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid())
|
||||
{
|
||||
result |= MAP_UNLOCKED_LINUX_GENERIC;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue