mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 06:28:12 +00:00
Added new regression test for ability to execute MIPS at KSEG0 and higher when in kernel mode
This commit is contained in:
parent
bb375e4fa9
commit
822198ad16
1 changed files with 25 additions and 0 deletions
25
tests/regress/mips_kernel_mmu.py
Executable file
25
tests/regress/mips_kernel_mmu.py
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from unicorn import *
|
||||
from unicorn.mips_const import *
|
||||
|
||||
import regress
|
||||
|
||||
class MipsSyscall(regress.RegressTest):
|
||||
def test(self):
|
||||
addr = 0x80000000
|
||||
code = '34213456'.decode('hex') # ori $at, $at, 0x3456
|
||||
|
||||
uc = Uc(UC_ARCH_MIPS, UC_MODE_MIPS32 + UC_MODE_BIG_ENDIAN)
|
||||
uc.mem_map(addr, 0x1000)
|
||||
uc.mem_write(addr, code)
|
||||
uc.reg_write(UC_MIPS_REG_AT, 0)
|
||||
|
||||
uc.emu_start(addr, addr + len(code))
|
||||
|
||||
#self.assertEqual(addr + len(code), uc.reg_read(UC_MIPS_REG_PC))
|
||||
self.assertEqual(uc.reg_read(UC_MIPS_REG_AT), 0x3456)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
regress.main()
|
Loading…
Reference in a new issue