예제 #1
0
        public void Setup()
        {
            _currAddress = CodeBaseAddress;

            _ram    = new MemoryBlock(Size * 2);
            _memory = new MemoryManager(1ul << 16);
            _memory.IncrementReferenceCount();
            _memory.Map(CodeBaseAddress, _ram.GetPointer(0, Size * 2), Size * 2);

            _context = CpuContext.CreateExecutionContext();
            Translator.IsReadyForTranslation.Set();

            _cpuContext = new CpuContext(_memory, for64Bit: true);

            // Prevent registering LCQ functions in the FunctionTable to avoid initializing and populating the table,
            // which improves test durations.
            Optimizations.AllowLcqInFunctionTable  = false;
            Optimizations.UseUnmanagedDispatchLoop = false;

            if (_unicornAvailable)
            {
                _unicornEmu = new UnicornAArch64();
                _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC);
                _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE);
                _unicornEmu.PC = CodeBaseAddress;
            }
        }
예제 #2
0
 public void Teardown()
 {
     _memory.Dispose();
     _context.Dispose();
     _ram.Dispose();
     _memory     = null;
     _context    = null;
     _cpuContext = null;
     _unicornEmu = null;
 }
예제 #3
0
        public void Teardown()
        {
            _memory.DecrementReferenceCount();
            _context.Dispose();
            _ram.Dispose();

            _memory     = null;
            _context    = null;
            _cpuContext = null;
            _unicornEmu = null;

            _usingMemory = false;
        }
예제 #4
0
파일: CpuTest.cs 프로젝트: ski982/Ryujinx-1
        public void Setup()
        {
            _currAddress = CodeBaseAddress;

            _ram    = new MemoryBlock(Size * 2);
            _memory = new MemoryManager(_ram, 1ul << 16);
            _memory.Map(CodeBaseAddress, 0, Size * 2);

            _context = CpuContext.CreateExecutionContext();

            _cpuContext = new CpuContext(_memory);

            if (_unicornAvailable)
            {
                _unicornEmu = new UnicornAArch64();
                _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC);
                _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE);
                _unicornEmu.PC = CodeBaseAddress;
            }
        }
예제 #5
0
        public void Setup()
        {
            _currAddress = 0x1000;
            _size        = 0x1000;

            _entryPoint = _currAddress;

            _ram    = new MemoryBlock(_size);
            _memory = new MemoryManager(_ram, 1UL << 16);
            _memory.Map(_currAddress, 0, _size);

            _context = CpuContext.CreateExecutionContext();

            _cpuContext = new CpuContext(_memory);

            if (_unicornAvailable)
            {
                _unicornEmu = new UnicornAArch64();
                _unicornEmu.MemoryMap(_currAddress, _size, MemoryPermission.READ | MemoryPermission.EXEC);
                _unicornEmu.PC = _entryPoint;
            }
        }
예제 #6
0
        public void Setup()
        {
            _currAddress = CodeBaseAddress;

            _ram    = new MemoryBlock(Size * 2);
            _memory = new MemoryManager(1ul << 16);
            _memory.IncrementReferenceCount();
            _memory.Map(CodeBaseAddress, _ram.GetPointer(0, Size * 2), Size * 2);

            _context = CpuContext.CreateExecutionContext();
            Translator.IsReadyForTranslation.Set();

            _cpuContext = new CpuContext(_memory);

            if (_unicornAvailable)
            {
                _unicornEmu = new UnicornAArch64();
                _unicornEmu.MemoryMap(CodeBaseAddress, Size, MemoryPermission.READ | MemoryPermission.EXEC);
                _unicornEmu.MemoryMap(DataBaseAddress, Size, MemoryPermission.READ | MemoryPermission.WRITE);
                _unicornEmu.PC = CodeBaseAddress;
            }
        }