Added new regression test for ability to execute MIPS at KSEG0 and higher when in kernel mode

This commit is contained in:
Justin Campbell 2015-12-28 00:34:26 +00:00
parent bb375e4fa9
commit 822198ad16

View 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()