mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-05 03:21:23 +00:00
fbb4019ed5
* Make GPU memory manager a member of GPU channel * Move physical memory instance to the memory manager, and the caches to the physical memory * PR feedback
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
using Ryujinx.Common.Configuration;
|
|
using Ryujinx.Cpu;
|
|
using Ryujinx.Graphics.Gpu;
|
|
using Ryujinx.HLE.HOS.Kernel;
|
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
|
using Ryujinx.Memory;
|
|
using System;
|
|
|
|
namespace Ryujinx.HLE.HOS
|
|
{
|
|
class ArmProcessContextFactory : IProcessContextFactory
|
|
{
|
|
private readonly GpuContext _gpu;
|
|
|
|
public ArmProcessContextFactory(GpuContext gpu)
|
|
{
|
|
_gpu = gpu;
|
|
}
|
|
|
|
public IProcessContext Create(KernelContext context, long pid, ulong addressSpaceSize, InvalidAccessHandler invalidAccessHandler, bool for64Bit)
|
|
{
|
|
MemoryManagerMode mode = context.Device.Configuration.MemoryManagerMode;
|
|
|
|
switch (mode)
|
|
{
|
|
case MemoryManagerMode.SoftwarePageTable:
|
|
return new ArmProcessContext<MemoryManager>(pid, _gpu, new MemoryManager(addressSpaceSize, invalidAccessHandler), for64Bit);
|
|
|
|
case MemoryManagerMode.HostMapped:
|
|
case MemoryManagerMode.HostMappedUnsafe:
|
|
bool unsafeMode = mode == MemoryManagerMode.HostMappedUnsafe;
|
|
return new ArmProcessContext<MemoryManagerHostMapped>(pid, _gpu, new MemoryManagerHostMapped(addressSpaceSize, unsafeMode, invalidAccessHandler), for64Bit);
|
|
|
|
default:
|
|
throw new ArgumentOutOfRangeException();
|
|
}
|
|
}
|
|
}
|
|
}
|