about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/arch/mips32/regs.py10
-rw-r--r--miasm2/jitter/arch/JitCore_mips32.c12
-rw-r--r--miasm2/jitter/arch/JitCore_mips32.h4
3 files changed, 24 insertions, 2 deletions
diff --git a/miasm2/arch/mips32/regs.py b/miasm2/arch/mips32/regs.py
index bf4926a8..c87a6412 100644
--- a/miasm2/arch/mips32/regs.py
+++ b/miasm2/arch/mips32/regs.py
@@ -25,6 +25,12 @@ regs_flt_str = ['F%d'%i for i in xrange(0x20)]
 
 regs_fcc_str = ['FCC%d'%i for i in xrange(8)]
 
+R_LO = ExprId('R_LO', 32)
+R_HI = ExprId('R_HI', 32)
+
+R_LO_init = ExprId('R_LO_init', 32)
+R_HI_init = ExprId('R_HI_init', 32)
+
 
 cpr0_str = ["CPR0_%d"%x for x in xrange(0x100)]
 cpr0_str[0] = "INDEX"
@@ -44,9 +50,9 @@ regs_flt_expr, regs_flt_init, fltregs = gen_regs(regs_flt_str, globals())
 regs_fcc_expr, regs_fcc_init, fccregs = gen_regs(regs_fcc_str, globals())
 
 
-all_regs_ids = [PC] + gpregs_expr + regs_flt_expr + regs_fcc_expr
+all_regs_ids = [PC, R_LO, R_HI] + gpregs_expr + regs_flt_expr + regs_fcc_expr
 all_regs_ids_byname = dict([(x.name, x) for x in all_regs_ids])
-all_regs_ids_init = [PC_init] + gpregs_init + regs_flt_init + regs_fcc_init
+all_regs_ids_init = [PC_init, R_LO_init, R_HI_init] + gpregs_init + regs_flt_init + regs_fcc_init
 all_regs_ids_no_alias = all_regs_ids[:]
 
 regs_init = {}
diff --git a/miasm2/jitter/arch/JitCore_mips32.c b/miasm2/jitter/arch/JitCore_mips32.c
index c340d494..989bedd9 100644
--- a/miasm2/jitter/arch/JitCore_mips32.c
+++ b/miasm2/jitter/arch/JitCore_mips32.c
@@ -59,6 +59,8 @@ reg_dict gpreg_dict[] = { {.name = "ZERO", .offset = offsetof(vm_cpu_t, ZERO)},
 			  {.name = "FP", .offset = offsetof(vm_cpu_t, FP)},
 			  {.name = "RA", .offset = offsetof(vm_cpu_t, RA)},
 			  {.name = "PC", .offset = offsetof(vm_cpu_t, PC)},
+			  {.name = "R_LO", .offset = offsetof(vm_cpu_t, R_LO)},
+			  {.name = "R_HI", .offset = offsetof(vm_cpu_t, R_HI)},
 };
 
 /************************** JitCpu object **************************/
@@ -117,6 +119,8 @@ PyObject* cpu_get_gpreg(JitCpu* self)
     get_reg(FP);
     get_reg(RA);
     get_reg(PC);
+    get_reg(R_LO);
+    get_reg(R_HI);
 
     return dict;
 }
@@ -319,6 +323,8 @@ getset_reg_u32(SP);
 getset_reg_u32(FP);
 getset_reg_u32(RA);
 getset_reg_u32(PC);
+getset_reg_u32(R_LO);
+getset_reg_u32(R_HI);
 
 
 
@@ -370,6 +376,8 @@ PyObject* get_gpreg_offset_all(void)
     get_reg_off(FP);
     get_reg_off(RA);
     get_reg_off(PC);
+    get_reg_off(R_LO);
+    get_reg_off(R_HI);
 
     get_reg_off(ZERO_new);
     get_reg_off(AT_new);
@@ -404,6 +412,8 @@ PyObject* get_gpreg_offset_all(void)
     get_reg_off(FP_new);
     get_reg_off(RA_new);
     get_reg_off(PC_new);
+    get_reg_off(R_LO_new);
+    get_reg_off(R_HI_new);
 
 
 
@@ -537,6 +547,8 @@ static PyGetSetDef JitCpu_getseters[] = {
     {"FP" , (getter)JitCpu_get_FP , (setter)JitCpu_set_FP , "FP" , NULL},
     {"RA" , (getter)JitCpu_get_RA , (setter)JitCpu_set_RA , "RA" , NULL},
     {"PC" , (getter)JitCpu_get_PC , (setter)JitCpu_set_PC , "PC" , NULL},
+    {"R_LO" , (getter)JitCpu_get_R_LO , (setter)JitCpu_set_R_LO , "R_LO" , NULL},
+    {"R_HI" , (getter)JitCpu_get_R_HI , (setter)JitCpu_set_R_HI , "R_HI" , NULL},
 
     {NULL}  /* Sentinel */
 };
diff --git a/miasm2/jitter/arch/JitCore_mips32.h b/miasm2/jitter/arch/JitCore_mips32.h
index d8fe6f0a..8d516207 100644
--- a/miasm2/jitter/arch/JitCore_mips32.h
+++ b/miasm2/jitter/arch/JitCore_mips32.h
@@ -38,6 +38,8 @@ typedef struct {
 	uint32_t FP;
 	uint32_t RA;
 	uint32_t PC;
+	uint32_t R_LO;
+	uint32_t R_HI;
 
 	uint32_t ZERO_new;
 	uint32_t AT_new;
@@ -72,6 +74,8 @@ typedef struct {
 	uint32_t FP_new;
 	uint32_t RA_new;
 	uint32_t PC_new;
+	uint32_t R_LO_new;
+	uint32_t R_HI_new;