diff options
| -rw-r--r-- | miasm2/jitter/arch/JitCore_aarch64.c | 84 | ||||
| -rw-r--r-- | miasm2/jitter/arch/JitCore_arm.c | 59 | ||||
| -rw-r--r-- | miasm2/jitter/arch/JitCore_mep.c | 114 | ||||
| -rw-r--r-- | miasm2/jitter/arch/JitCore_mips32.c | 72 | ||||
| -rw-r--r-- | miasm2/jitter/arch/JitCore_ppc32.c | 2 | ||||
| -rw-r--r-- | miasm2/jitter/arch/JitCore_x86.c | 197 |
6 files changed, 265 insertions, 263 deletions
diff --git a/miasm2/jitter/arch/JitCore_aarch64.c b/miasm2/jitter/arch/JitCore_aarch64.c index f5977308..76452a44 100644 --- a/miasm2/jitter/arch/JitCore_aarch64.c +++ b/miasm2/jitter/arch/JitCore_aarch64.c @@ -13,48 +13,48 @@ reg_dict gpreg_dict[] = { - {.name = "X0", .offset = offsetof(vm_cpu_t, X0)}, - {.name = "X1", .offset = offsetof(vm_cpu_t, X1)}, - {.name = "X2", .offset = offsetof(vm_cpu_t, X2)}, - {.name = "X3", .offset = offsetof(vm_cpu_t, X3)}, - {.name = "X4", .offset = offsetof(vm_cpu_t, X4)}, - {.name = "X5", .offset = offsetof(vm_cpu_t, X5)}, - {.name = "X6", .offset = offsetof(vm_cpu_t, X6)}, - {.name = "X7", .offset = offsetof(vm_cpu_t, X7)}, - {.name = "X8", .offset = offsetof(vm_cpu_t, X8)}, - {.name = "X9", .offset = offsetof(vm_cpu_t, X9)}, - {.name = "X10", .offset = offsetof(vm_cpu_t, X10)}, - {.name = "X11", .offset = offsetof(vm_cpu_t, X11)}, - {.name = "X12", .offset = offsetof(vm_cpu_t, X12)}, - {.name = "X13", .offset = offsetof(vm_cpu_t, X13)}, - {.name = "X14", .offset = offsetof(vm_cpu_t, X14)}, - {.name = "X15", .offset = offsetof(vm_cpu_t, X15)}, - {.name = "X16", .offset = offsetof(vm_cpu_t, X16)}, - {.name = "X17", .offset = offsetof(vm_cpu_t, X17)}, - {.name = "X18", .offset = offsetof(vm_cpu_t, X18)}, - {.name = "X19", .offset = offsetof(vm_cpu_t, X19)}, - {.name = "X20", .offset = offsetof(vm_cpu_t, X20)}, - {.name = "X21", .offset = offsetof(vm_cpu_t, X21)}, - {.name = "X22", .offset = offsetof(vm_cpu_t, X22)}, - {.name = "X23", .offset = offsetof(vm_cpu_t, X23)}, - {.name = "X24", .offset = offsetof(vm_cpu_t, X24)}, - {.name = "X25", .offset = offsetof(vm_cpu_t, X25)}, - {.name = "X26", .offset = offsetof(vm_cpu_t, X26)}, - {.name = "X27", .offset = offsetof(vm_cpu_t, X27)}, - {.name = "X28", .offset = offsetof(vm_cpu_t, X28)}, - {.name = "X29", .offset = offsetof(vm_cpu_t, X29)}, - {.name = "LR", .offset = offsetof(vm_cpu_t, LR)}, - - {.name = "SP", .offset = offsetof(vm_cpu_t, SP)}, - {.name = "PC", .offset = offsetof(vm_cpu_t, PC)}, - - {.name = "zf", .offset = offsetof(vm_cpu_t, zf)}, - {.name = "nf", .offset = offsetof(vm_cpu_t, nf)}, - {.name = "of", .offset = offsetof(vm_cpu_t, of)}, - {.name = "cf", .offset = offsetof(vm_cpu_t, cf)}, - - {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags)}, - {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num)}, + {.name = "X0", .offset = offsetof(vm_cpu_t, X0), .size = 64}, + {.name = "X1", .offset = offsetof(vm_cpu_t, X1), .size = 64}, + {.name = "X2", .offset = offsetof(vm_cpu_t, X2), .size = 64}, + {.name = "X3", .offset = offsetof(vm_cpu_t, X3), .size = 64}, + {.name = "X4", .offset = offsetof(vm_cpu_t, X4), .size = 64}, + {.name = "X5", .offset = offsetof(vm_cpu_t, X5), .size = 64}, + {.name = "X6", .offset = offsetof(vm_cpu_t, X6), .size = 64}, + {.name = "X7", .offset = offsetof(vm_cpu_t, X7), .size = 64}, + {.name = "X8", .offset = offsetof(vm_cpu_t, X8), .size = 64}, + {.name = "X9", .offset = offsetof(vm_cpu_t, X9), .size = 64}, + {.name = "X10", .offset = offsetof(vm_cpu_t, X10), .size = 64}, + {.name = "X11", .offset = offsetof(vm_cpu_t, X11), .size = 64}, + {.name = "X12", .offset = offsetof(vm_cpu_t, X12), .size = 64}, + {.name = "X13", .offset = offsetof(vm_cpu_t, X13), .size = 64}, + {.name = "X14", .offset = offsetof(vm_cpu_t, X14), .size = 64}, + {.name = "X15", .offset = offsetof(vm_cpu_t, X15), .size = 64}, + {.name = "X16", .offset = offsetof(vm_cpu_t, X16), .size = 64}, + {.name = "X17", .offset = offsetof(vm_cpu_t, X17), .size = 64}, + {.name = "X18", .offset = offsetof(vm_cpu_t, X18), .size = 64}, + {.name = "X19", .offset = offsetof(vm_cpu_t, X19), .size = 64}, + {.name = "X20", .offset = offsetof(vm_cpu_t, X20), .size = 64}, + {.name = "X21", .offset = offsetof(vm_cpu_t, X21), .size = 64}, + {.name = "X22", .offset = offsetof(vm_cpu_t, X22), .size = 64}, + {.name = "X23", .offset = offsetof(vm_cpu_t, X23), .size = 64}, + {.name = "X24", .offset = offsetof(vm_cpu_t, X24), .size = 64}, + {.name = "X25", .offset = offsetof(vm_cpu_t, X25), .size = 64}, + {.name = "X26", .offset = offsetof(vm_cpu_t, X26), .size = 64}, + {.name = "X27", .offset = offsetof(vm_cpu_t, X27), .size = 64}, + {.name = "X28", .offset = offsetof(vm_cpu_t, X28), .size = 64}, + {.name = "X29", .offset = offsetof(vm_cpu_t, X29), .size = 64}, + {.name = "LR", .offset = offsetof(vm_cpu_t, LR), .size = 64}, + + {.name = "SP", .offset = offsetof(vm_cpu_t, SP), .size = 64}, + {.name = "PC", .offset = offsetof(vm_cpu_t, PC), .size = 64}, + + {.name = "zf", .offset = offsetof(vm_cpu_t, zf), .size = 8}, + {.name = "nf", .offset = offsetof(vm_cpu_t, nf), .size = 8}, + {.name = "of", .offset = offsetof(vm_cpu_t, of), .size = 8}, + {.name = "cf", .offset = offsetof(vm_cpu_t, cf), .size = 8}, + + {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags), .size = 32}, + {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num), .size = 32}, }; diff --git a/miasm2/jitter/arch/JitCore_arm.c b/miasm2/jitter/arch/JitCore_arm.c index f253c45b..ac7d16bf 100644 --- a/miasm2/jitter/arch/JitCore_arm.c +++ b/miasm2/jitter/arch/JitCore_arm.c @@ -12,35 +12,36 @@ -reg_dict gpreg_dict[] = { {.name = "R0", .offset = offsetof(vm_cpu_t, R0)}, - {.name = "R1", .offset = offsetof(vm_cpu_t, R1)}, - {.name = "R2", .offset = offsetof(vm_cpu_t, R2)}, - {.name = "R3", .offset = offsetof(vm_cpu_t, R3)}, - {.name = "R4", .offset = offsetof(vm_cpu_t, R4)}, - {.name = "R5", .offset = offsetof(vm_cpu_t, R5)}, - {.name = "R6", .offset = offsetof(vm_cpu_t, R6)}, - {.name = "R7", .offset = offsetof(vm_cpu_t, R7)}, - {.name = "R8", .offset = offsetof(vm_cpu_t, R8)}, - {.name = "R9", .offset = offsetof(vm_cpu_t, R9)}, - {.name = "R10", .offset = offsetof(vm_cpu_t, R10)}, - {.name = "R11", .offset = offsetof(vm_cpu_t, R11)}, - {.name = "R12", .offset = offsetof(vm_cpu_t, R12)}, - {.name = "SP", .offset = offsetof(vm_cpu_t, SP)}, - {.name = "LR", .offset = offsetof(vm_cpu_t, LR)}, - {.name = "PC", .offset = offsetof(vm_cpu_t, PC)}, - - {.name = "zf", .offset = offsetof(vm_cpu_t, zf)}, - {.name = "nf", .offset = offsetof(vm_cpu_t, nf)}, - {.name = "of", .offset = offsetof(vm_cpu_t, of)}, - {.name = "cf", .offset = offsetof(vm_cpu_t, cf)}, - - {.name = "ge0", .offset = offsetof(vm_cpu_t, ge0)}, - {.name = "ge1", .offset = offsetof(vm_cpu_t, ge1)}, - {.name = "ge2", .offset = offsetof(vm_cpu_t, ge2)}, - {.name = "ge3", .offset = offsetof(vm_cpu_t, ge3)}, - - {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags)}, - {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num)}, +reg_dict gpreg_dict[] = { + {.name = "R0", .offset = offsetof(vm_cpu_t, R0), .size = 32}, + {.name = "R1", .offset = offsetof(vm_cpu_t, R1), .size = 32}, + {.name = "R2", .offset = offsetof(vm_cpu_t, R2), .size = 32}, + {.name = "R3", .offset = offsetof(vm_cpu_t, R3), .size = 32}, + {.name = "R4", .offset = offsetof(vm_cpu_t, R4), .size = 32}, + {.name = "R5", .offset = offsetof(vm_cpu_t, R5), .size = 32}, + {.name = "R6", .offset = offsetof(vm_cpu_t, R6), .size = 32}, + {.name = "R7", .offset = offsetof(vm_cpu_t, R7), .size = 32}, + {.name = "R8", .offset = offsetof(vm_cpu_t, R8), .size = 32}, + {.name = "R9", .offset = offsetof(vm_cpu_t, R9), .size = 32}, + {.name = "R10", .offset = offsetof(vm_cpu_t, R10), .size = 32}, + {.name = "R11", .offset = offsetof(vm_cpu_t, R11), .size = 32}, + {.name = "R12", .offset = offsetof(vm_cpu_t, R12), .size = 32}, + {.name = "SP", .offset = offsetof(vm_cpu_t, SP), .size = 32}, + {.name = "LR", .offset = offsetof(vm_cpu_t, LR), .size = 32}, + {.name = "PC", .offset = offsetof(vm_cpu_t, PC), .size = 32}, + + {.name = "zf", .offset = offsetof(vm_cpu_t, zf), .size = 8}, + {.name = "nf", .offset = offsetof(vm_cpu_t, nf), .size = 8}, + {.name = "of", .offset = offsetof(vm_cpu_t, of), .size = 8}, + {.name = "cf", .offset = offsetof(vm_cpu_t, cf), .size = 8}, + + {.name = "ge0", .offset = offsetof(vm_cpu_t, ge0), .size = 8}, + {.name = "ge1", .offset = offsetof(vm_cpu_t, ge1), .size = 8}, + {.name = "ge2", .offset = offsetof(vm_cpu_t, ge2), .size = 8}, + {.name = "ge3", .offset = offsetof(vm_cpu_t, ge3), .size = 8}, + + {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags), .size = 32}, + {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num), .size = 32}, }; /************************** JitCpu object **************************/ diff --git a/miasm2/jitter/arch/JitCore_mep.c b/miasm2/jitter/arch/JitCore_mep.c index dff65dd5..da070016 100644 --- a/miasm2/jitter/arch/JitCore_mep.c +++ b/miasm2/jitter/arch/JitCore_mep.c @@ -14,63 +14,63 @@ reg_dict gpreg_dict[] = { - {.name = "R0", .offset = offsetof(vm_cpu_t, R0)}, - {.name = "R1", .offset = offsetof(vm_cpu_t, R1)}, - {.name = "R2", .offset = offsetof(vm_cpu_t, R2)}, - {.name = "R3", .offset = offsetof(vm_cpu_t, R3)}, - {.name = "R4", .offset = offsetof(vm_cpu_t, R4)}, - {.name = "R5", .offset = offsetof(vm_cpu_t, R5)}, - {.name = "R6", .offset = offsetof(vm_cpu_t, R6)}, - {.name = "R7", .offset = offsetof(vm_cpu_t, R7)}, - {.name = "R8", .offset = offsetof(vm_cpu_t, R8)}, - {.name = "R9", .offset = offsetof(vm_cpu_t, R9)}, - {.name = "R10", .offset = offsetof(vm_cpu_t, R10)}, - {.name = "R11", .offset = offsetof(vm_cpu_t, R11)}, - {.name = "R12", .offset = offsetof(vm_cpu_t, R12)}, - {.name = "TP", .offset = offsetof(vm_cpu_t, TP)}, - {.name = "GP", .offset = offsetof(vm_cpu_t, GP)}, - {.name = "SP", .offset = offsetof(vm_cpu_t, SP)}, - - {.name = "PC", .offset = offsetof(vm_cpu_t, PC)}, - {.name = "LP", .offset = offsetof(vm_cpu_t, LP)}, - {.name = "SAR", .offset = offsetof(vm_cpu_t, SAR)}, - {.name = "S3", .offset = offsetof(vm_cpu_t, S3)}, - {.name = "RPB", .offset = offsetof(vm_cpu_t, RPB)}, - {.name = "RPE", .offset = offsetof(vm_cpu_t, RPE)}, - {.name = "RPC", .offset = offsetof(vm_cpu_t, RPC)}, - {.name = "HI", .offset = offsetof(vm_cpu_t, HI)}, - {.name = "LO", .offset = offsetof(vm_cpu_t, LO)}, - {.name = "S9", .offset = offsetof(vm_cpu_t, S9)}, - {.name = "S10", .offset = offsetof(vm_cpu_t, S10)}, - {.name = "S11", .offset = offsetof(vm_cpu_t, S11)}, - {.name = "MB0", .offset = offsetof(vm_cpu_t, MB0)}, - {.name = "ME0", .offset = offsetof(vm_cpu_t, ME0)}, - {.name = "MB1", .offset = offsetof(vm_cpu_t, MB1)}, - {.name = "ME1", .offset = offsetof(vm_cpu_t, ME1)}, - {.name = "PSW", .offset = offsetof(vm_cpu_t, PSW)}, - {.name = "ID", .offset = offsetof(vm_cpu_t, ID)}, - {.name = "TMP", .offset = offsetof(vm_cpu_t, TMP)}, - {.name = "EPC", .offset = offsetof(vm_cpu_t, EPC)}, - {.name = "EXC", .offset = offsetof(vm_cpu_t, EXC)}, - {.name = "CFG", .offset = offsetof(vm_cpu_t, CFG)}, - {.name = "S22", .offset = offsetof(vm_cpu_t, S22)}, - {.name = "NPC", .offset = offsetof(vm_cpu_t, NPC)}, - {.name = "DBG", .offset = offsetof(vm_cpu_t, DBG)}, - {.name = "DEPC", .offset = offsetof(vm_cpu_t, DEPC)}, - {.name = "OPT", .offset = offsetof(vm_cpu_t, OPT)}, - {.name = "RCFG", .offset = offsetof(vm_cpu_t, RCFG)}, - {.name = "CCFG", .offset = offsetof(vm_cpu_t, CCFG)}, - {.name = "S29", .offset = offsetof(vm_cpu_t, S29)}, - {.name = "S30", .offset = offsetof(vm_cpu_t, S30)}, - {.name = "S31", .offset = offsetof(vm_cpu_t, S31)}, - {.name = "S32", .offset = offsetof(vm_cpu_t, S32)}, - {.name = "take_jmp", .offset = offsetof(vm_cpu_t, take_jmp)}, - {.name = "last_addr", .offset = offsetof(vm_cpu_t, last_addr)}, - {.name = "is_repeat_end", .offset = offsetof(vm_cpu_t, is_repeat_end)}, - - {.name = "PC_end", .offset = offsetof(vm_cpu_t, PC_end)}, - {.name = "RPE_instr_count", .offset = offsetof(vm_cpu_t, RPE_instr_count)}, - {.name = "RPC_current", .offset = offsetof(vm_cpu_t, RPC_current)}, + {.name = "R0", .offset = offsetof(vm_cpu_t, R0), .size = 32}, + {.name = "R1", .offset = offsetof(vm_cpu_t, R1), .size = 32}, + {.name = "R2", .offset = offsetof(vm_cpu_t, R2), .size = 32}, + {.name = "R3", .offset = offsetof(vm_cpu_t, R3), .size = 32}, + {.name = "R4", .offset = offsetof(vm_cpu_t, R4), .size = 32}, + {.name = "R5", .offset = offsetof(vm_cpu_t, R5), .size = 32}, + {.name = "R6", .offset = offsetof(vm_cpu_t, R6), .size = 32}, + {.name = "R7", .offset = offsetof(vm_cpu_t, R7), .size = 32}, + {.name = "R8", .offset = offsetof(vm_cpu_t, R8), .size = 32}, + {.name = "R9", .offset = offsetof(vm_cpu_t, R9), .size = 32}, + {.name = "R10", .offset = offsetof(vm_cpu_t, R10), .size = 32}, + {.name = "R11", .offset = offsetof(vm_cpu_t, R11), .size = 32}, + {.name = "R12", .offset = offsetof(vm_cpu_t, R12), .size = 32}, + {.name = "TP", .offset = offsetof(vm_cpu_t, TP), .size = 32}, + {.name = "GP", .offset = offsetof(vm_cpu_t, GP), .size = 32}, + {.name = "SP", .offset = offsetof(vm_cpu_t, SP), .size = 32}, + + {.name = "PC", .offset = offsetof(vm_cpu_t, PC), .size = 32}, + {.name = "LP", .offset = offsetof(vm_cpu_t, LP), .size = 32}, + {.name = "SAR", .offset = offsetof(vm_cpu_t, SAR), .size = 32}, + {.name = "S3", .offset = offsetof(vm_cpu_t, S3), .size = 32}, + {.name = "RPB", .offset = offsetof(vm_cpu_t, RPB), .size = 32}, + {.name = "RPE", .offset = offsetof(vm_cpu_t, RPE), .size = 32}, + {.name = "RPC", .offset = offsetof(vm_cpu_t, RPC), .size = 32}, + {.name = "HI", .offset = offsetof(vm_cpu_t, HI), .size = 32}, + {.name = "LO", .offset = offsetof(vm_cpu_t, LO), .size = 32}, + {.name = "S9", .offset = offsetof(vm_cpu_t, S9), .size = 32}, + {.name = "S10", .offset = offsetof(vm_cpu_t, S10), .size = 32}, + {.name = "S11", .offset = offsetof(vm_cpu_t, S11), .size = 32}, + {.name = "MB0", .offset = offsetof(vm_cpu_t, MB0), .size = 32}, + {.name = "ME0", .offset = offsetof(vm_cpu_t, ME0), .size = 32}, + {.name = "MB1", .offset = offsetof(vm_cpu_t, MB1), .size = 32}, + {.name = "ME1", .offset = offsetof(vm_cpu_t, ME1), .size = 32}, + {.name = "PSW", .offset = offsetof(vm_cpu_t, PSW), .size = 32}, + {.name = "ID", .offset = offsetof(vm_cpu_t, ID), .size = 32}, + {.name = "TMP", .offset = offsetof(vm_cpu_t, TMP), .size = 32}, + {.name = "EPC", .offset = offsetof(vm_cpu_t, EPC), .size = 32}, + {.name = "EXC", .offset = offsetof(vm_cpu_t, EXC), .size = 32}, + {.name = "CFG", .offset = offsetof(vm_cpu_t, CFG), .size = 32}, + {.name = "S22", .offset = offsetof(vm_cpu_t, S22), .size = 32}, + {.name = "NPC", .offset = offsetof(vm_cpu_t, NPC), .size = 32}, + {.name = "DBG", .offset = offsetof(vm_cpu_t, DBG), .size = 32}, + {.name = "DEPC", .offset = offsetof(vm_cpu_t, DEPC), .size = 32}, + {.name = "OPT", .offset = offsetof(vm_cpu_t, OPT), .size = 32}, + {.name = "RCFG", .offset = offsetof(vm_cpu_t, RCFG), .size = 32}, + {.name = "CCFG", .offset = offsetof(vm_cpu_t, CCFG), .size = 32}, + {.name = "S29", .offset = offsetof(vm_cpu_t, S29), .size = 32}, + {.name = "S30", .offset = offsetof(vm_cpu_t, S30), .size = 32}, + {.name = "S31", .offset = offsetof(vm_cpu_t, S31), .size = 32}, + {.name = "S32", .offset = offsetof(vm_cpu_t, S32), .size = 32}, + {.name = "take_jmp", .offset = offsetof(vm_cpu_t, take_jmp), .size = 32}, + {.name = "last_addr", .offset = offsetof(vm_cpu_t, last_addr), .size = 32}, + {.name = "is_repeat_end", .offset = offsetof(vm_cpu_t, is_repeat_end), .size = 32}, + + {.name = "PC_end", .offset = offsetof(vm_cpu_t, PC_end), .size = 32}, + {.name = "RPE_instr_count", .offset = offsetof(vm_cpu_t, RPE_instr_count), .size = 32}, + {.name = "RPC_current", .offset = offsetof(vm_cpu_t, RPC_current), .size = 32}, }; diff --git a/miasm2/jitter/arch/JitCore_mips32.c b/miasm2/jitter/arch/JitCore_mips32.c index a1bf44f5..2a5dfd0f 100644 --- a/miasm2/jitter/arch/JitCore_mips32.c +++ b/miasm2/jitter/arch/JitCore_mips32.c @@ -12,42 +12,42 @@ -reg_dict gpreg_dict[] = { {.name = "ZERO", .offset = offsetof(vm_cpu_t, ZERO)}, - {.name = "AT", .offset = offsetof(vm_cpu_t, AT)}, - {.name = "V0", .offset = offsetof(vm_cpu_t, V0)}, - {.name = "V1", .offset = offsetof(vm_cpu_t, V1)}, - {.name = "A0", .offset = offsetof(vm_cpu_t, A0)}, - {.name = "A1", .offset = offsetof(vm_cpu_t, A1)}, - {.name = "A2", .offset = offsetof(vm_cpu_t, A2)}, - {.name = "A3", .offset = offsetof(vm_cpu_t, A3)}, - {.name = "T0", .offset = offsetof(vm_cpu_t, T0)}, - {.name = "T1", .offset = offsetof(vm_cpu_t, T1)}, - {.name = "T2", .offset = offsetof(vm_cpu_t, T2)}, - {.name = "T3", .offset = offsetof(vm_cpu_t, T3)}, - {.name = "T4", .offset = offsetof(vm_cpu_t, T4)}, - {.name = "T5", .offset = offsetof(vm_cpu_t, T5)}, - {.name = "T6", .offset = offsetof(vm_cpu_t, T6)}, - {.name = "T7", .offset = offsetof(vm_cpu_t, T7)}, - {.name = "S0", .offset = offsetof(vm_cpu_t, S0)}, - {.name = "S1", .offset = offsetof(vm_cpu_t, S1)}, - {.name = "S2", .offset = offsetof(vm_cpu_t, S2)}, - {.name = "S3", .offset = offsetof(vm_cpu_t, S3)}, - {.name = "S4", .offset = offsetof(vm_cpu_t, S4)}, - {.name = "S5", .offset = offsetof(vm_cpu_t, S5)}, - {.name = "S6", .offset = offsetof(vm_cpu_t, S6)}, - {.name = "S7", .offset = offsetof(vm_cpu_t, S7)}, - {.name = "T8", .offset = offsetof(vm_cpu_t, T8)}, - {.name = "T9", .offset = offsetof(vm_cpu_t, T9)}, - {.name = "K0", .offset = offsetof(vm_cpu_t, K0)}, - {.name = "K1", .offset = offsetof(vm_cpu_t, K1)}, - {.name = "GP", .offset = offsetof(vm_cpu_t, GP)}, - {.name = "SP", .offset = offsetof(vm_cpu_t, SP)}, - {.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 = "PC_FETCH", .offset = offsetof(vm_cpu_t, PC_FETCH)}, - {.name = "R_LO", .offset = offsetof(vm_cpu_t, R_LO)}, - {.name = "R_HI", .offset = offsetof(vm_cpu_t, R_HI)}, +reg_dict gpreg_dict[] = { {.name = "ZERO", .offset = offsetof(vm_cpu_t, ZERO), .size = 32}, + {.name = "AT", .offset = offsetof(vm_cpu_t, AT), .size = 32}, + {.name = "V0", .offset = offsetof(vm_cpu_t, V0), .size = 32}, + {.name = "V1", .offset = offsetof(vm_cpu_t, V1), .size = 32}, + {.name = "A0", .offset = offsetof(vm_cpu_t, A0), .size = 32}, + {.name = "A1", .offset = offsetof(vm_cpu_t, A1), .size = 32}, + {.name = "A2", .offset = offsetof(vm_cpu_t, A2), .size = 32}, + {.name = "A3", .offset = offsetof(vm_cpu_t, A3), .size = 32}, + {.name = "T0", .offset = offsetof(vm_cpu_t, T0), .size = 32}, + {.name = "T1", .offset = offsetof(vm_cpu_t, T1), .size = 32}, + {.name = "T2", .offset = offsetof(vm_cpu_t, T2), .size = 32}, + {.name = "T3", .offset = offsetof(vm_cpu_t, T3), .size = 32}, + {.name = "T4", .offset = offsetof(vm_cpu_t, T4), .size = 32}, + {.name = "T5", .offset = offsetof(vm_cpu_t, T5), .size = 32}, + {.name = "T6", .offset = offsetof(vm_cpu_t, T6), .size = 32}, + {.name = "T7", .offset = offsetof(vm_cpu_t, T7), .size = 32}, + {.name = "S0", .offset = offsetof(vm_cpu_t, S0), .size = 32}, + {.name = "S1", .offset = offsetof(vm_cpu_t, S1), .size = 32}, + {.name = "S2", .offset = offsetof(vm_cpu_t, S2), .size = 32}, + {.name = "S3", .offset = offsetof(vm_cpu_t, S3), .size = 32}, + {.name = "S4", .offset = offsetof(vm_cpu_t, S4), .size = 32}, + {.name = "S5", .offset = offsetof(vm_cpu_t, S5), .size = 32}, + {.name = "S6", .offset = offsetof(vm_cpu_t, S6), .size = 32}, + {.name = "S7", .offset = offsetof(vm_cpu_t, S7), .size = 32}, + {.name = "T8", .offset = offsetof(vm_cpu_t, T8), .size = 32}, + {.name = "T9", .offset = offsetof(vm_cpu_t, T9), .size = 32}, + {.name = "K0", .offset = offsetof(vm_cpu_t, K0), .size = 32}, + {.name = "K1", .offset = offsetof(vm_cpu_t, K1), .size = 32}, + {.name = "GP", .offset = offsetof(vm_cpu_t, GP), .size = 32}, + {.name = "SP", .offset = offsetof(vm_cpu_t, SP), .size = 32}, + {.name = "FP", .offset = offsetof(vm_cpu_t, FP), .size = 32}, + {.name = "RA", .offset = offsetof(vm_cpu_t, RA), .size = 32}, + {.name = "PC", .offset = offsetof(vm_cpu_t, PC), .size = 32}, + {.name = "PC_FETCH", .offset = offsetof(vm_cpu_t, PC_FETCH), .size = 32}, + {.name = "R_LO", .offset = offsetof(vm_cpu_t, R_LO), .size = 32}, + {.name = "R_HI", .offset = offsetof(vm_cpu_t, R_HI), .size = 32}, }; /************************** JitCpu object **************************/ diff --git a/miasm2/jitter/arch/JitCore_ppc32.c b/miasm2/jitter/arch/JitCore_ppc32.c index 3acf769a..dfc46c91 100644 --- a/miasm2/jitter/arch/JitCore_ppc32.c +++ b/miasm2/jitter/arch/JitCore_ppc32.c @@ -11,7 +11,7 @@ reg_dict gpreg_dict[] = { #define JITCORE_PPC_REG_EXPAND(_name, _size) \ - { .name = #_name, .offset = offsetof(struct vm_cpu, _name) }, + { .name = #_name, .offset = offsetof(struct vm_cpu, _name), .size = _size }, #include "JitCore_ppc32_regs.h" #undef JITCORE_PPC_REG_EXPAND }; diff --git a/miasm2/jitter/arch/JitCore_x86.c b/miasm2/jitter/arch/JitCore_x86.c index 4e52ec85..1782c5ae 100644 --- a/miasm2/jitter/arch/JitCore_x86.c +++ b/miasm2/jitter/arch/JitCore_x86.c @@ -12,72 +12,73 @@ vm_cpu_t ref_arch_regs; -reg_dict gpreg_dict[] = { {.name = "RAX", .offset = offsetof(vm_cpu_t, RAX), .size = 8*sizeof(ref_arch_regs.RAX)}, - {.name = "RBX", .offset = offsetof(vm_cpu_t, RBX), .size = 8*sizeof(ref_arch_regs.RBX)}, - {.name = "RCX", .offset = offsetof(vm_cpu_t, RCX), .size = 8*sizeof(ref_arch_regs.RCX)}, - {.name = "RDX", .offset = offsetof(vm_cpu_t, RDX), .size = 8*sizeof(ref_arch_regs.RDX)}, - {.name = "RSI", .offset = offsetof(vm_cpu_t, RSI), .size = 8*sizeof(ref_arch_regs.RSI)}, - {.name = "RDI", .offset = offsetof(vm_cpu_t, RDI), .size = 8*sizeof(ref_arch_regs.RDI)}, - {.name = "RSP", .offset = offsetof(vm_cpu_t, RSP), .size = 8*sizeof(ref_arch_regs.RSP)}, - {.name = "RBP", .offset = offsetof(vm_cpu_t, RBP), .size = 8*sizeof(ref_arch_regs.RBP)}, - - {.name = "R8", .offset = offsetof(vm_cpu_t, R8), .size = 8*sizeof(ref_arch_regs.R8)}, - {.name = "R9", .offset = offsetof(vm_cpu_t, R9), .size = 8*sizeof(ref_arch_regs.R9)}, - {.name = "R10", .offset = offsetof(vm_cpu_t, R10), .size = 8*sizeof(ref_arch_regs.R10)}, - {.name = "R11", .offset = offsetof(vm_cpu_t, R11), .size = 8*sizeof(ref_arch_regs.R11)}, - {.name = "R12", .offset = offsetof(vm_cpu_t, R12), .size = 8*sizeof(ref_arch_regs.R12)}, - {.name = "R13", .offset = offsetof(vm_cpu_t, R13), .size = 8*sizeof(ref_arch_regs.R13)}, - {.name = "R14", .offset = offsetof(vm_cpu_t, R14), .size = 8*sizeof(ref_arch_regs.R14)}, - {.name = "R15", .offset = offsetof(vm_cpu_t, R15), .size = 8*sizeof(ref_arch_regs.R15)}, - - {.name = "RIP", .offset = offsetof(vm_cpu_t, RIP), .size = 8*sizeof(ref_arch_regs.RIP)}, - - {.name = "zf", .offset = offsetof(vm_cpu_t, zf), .size = 8*sizeof(ref_arch_regs.zf)}, - {.name = "nf", .offset = offsetof(vm_cpu_t, nf), .size = 8*sizeof(ref_arch_regs.nf)}, - {.name = "pf", .offset = offsetof(vm_cpu_t, pf), .size = 8*sizeof(ref_arch_regs.pf)}, - {.name = "of", .offset = offsetof(vm_cpu_t, of), .size = 8*sizeof(ref_arch_regs.of)}, - {.name = "cf", .offset = offsetof(vm_cpu_t, cf), .size = 8*sizeof(ref_arch_regs.cf)}, - {.name = "af", .offset = offsetof(vm_cpu_t, af), .size = 8*sizeof(ref_arch_regs.af)}, - {.name = "df", .offset = offsetof(vm_cpu_t, df), .size = 8*sizeof(ref_arch_regs.df)}, - - {.name = "ES", .offset = offsetof(vm_cpu_t, ES), .size = 8*sizeof(ref_arch_regs.ES)}, - {.name = "CS", .offset = offsetof(vm_cpu_t, CS), .size = 8*sizeof(ref_arch_regs.CS)}, - {.name = "SS", .offset = offsetof(vm_cpu_t, SS), .size = 8*sizeof(ref_arch_regs.SS)}, - {.name = "DS", .offset = offsetof(vm_cpu_t, DS), .size = 8*sizeof(ref_arch_regs.DS)}, - {.name = "FS", .offset = offsetof(vm_cpu_t, FS), .size = 8*sizeof(ref_arch_regs.FS)}, - {.name = "GS", .offset = offsetof(vm_cpu_t, GS), .size = 8*sizeof(ref_arch_regs.GS)}, - - {.name = "MM0", .offset = offsetof(vm_cpu_t, MM0), .size = 8*sizeof(ref_arch_regs.MM0)}, - {.name = "MM1", .offset = offsetof(vm_cpu_t, MM1), .size = 8*sizeof(ref_arch_regs.MM1)}, - {.name = "MM2", .offset = offsetof(vm_cpu_t, MM2), .size = 8*sizeof(ref_arch_regs.MM2)}, - {.name = "MM3", .offset = offsetof(vm_cpu_t, MM3), .size = 8*sizeof(ref_arch_regs.MM3)}, - {.name = "MM4", .offset = offsetof(vm_cpu_t, MM4), .size = 8*sizeof(ref_arch_regs.MM4)}, - {.name = "MM5", .offset = offsetof(vm_cpu_t, MM5), .size = 8*sizeof(ref_arch_regs.MM5)}, - {.name = "MM6", .offset = offsetof(vm_cpu_t, MM6), .size = 8*sizeof(ref_arch_regs.MM6)}, - {.name = "MM7", .offset = offsetof(vm_cpu_t, MM7), .size = 8*sizeof(ref_arch_regs.MM7)}, - - {.name = "XMM0", .offset = offsetof(vm_cpu_t, XMM0), .size = 128}, - {.name = "XMM1", .offset = offsetof(vm_cpu_t, XMM1), .size = 128}, - {.name = "XMM2", .offset = offsetof(vm_cpu_t, XMM2), .size = 128}, - {.name = "XMM3", .offset = offsetof(vm_cpu_t, XMM3), .size = 128}, - {.name = "XMM4", .offset = offsetof(vm_cpu_t, XMM4), .size = 128}, - {.name = "XMM5", .offset = offsetof(vm_cpu_t, XMM5), .size = 128}, - {.name = "XMM6", .offset = offsetof(vm_cpu_t, XMM6), .size = 128}, - {.name = "XMM7", .offset = offsetof(vm_cpu_t, XMM7), .size = 128}, - {.name = "XMM8", .offset = offsetof(vm_cpu_t, XMM8), .size = 128}, - {.name = "XMM9", .offset = offsetof(vm_cpu_t, XMM9), .size = 128}, - {.name = "XMM10", .offset = offsetof(vm_cpu_t, XMM10), .size = 128}, - {.name = "XMM11", .offset = offsetof(vm_cpu_t, XMM11), .size = 128}, - {.name = "XMM12", .offset = offsetof(vm_cpu_t, XMM12), .size = 128}, - {.name = "XMM13", .offset = offsetof(vm_cpu_t, XMM13), .size = 128}, - {.name = "XMM14", .offset = offsetof(vm_cpu_t, XMM14), .size = 128}, - {.name = "XMM15", .offset = offsetof(vm_cpu_t, XMM15), .size = 128}, - - {.name = "tsc1", .offset = offsetof(vm_cpu_t, tsc1), .size = 8*sizeof(ref_arch_regs.tsc1)}, - {.name = "tsc2", .offset = offsetof(vm_cpu_t, tsc2), .size = 8*sizeof(ref_arch_regs.tsc2)}, - - {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags), .size = 8*sizeof(ref_arch_regs.exception_flags)}, - {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num), .size = 8*sizeof(ref_arch_regs.interrupt_num)}, +reg_dict gpreg_dict[] = { + {.name = "RAX", .offset = offsetof(vm_cpu_t, RAX), .size = 64}, + {.name = "RBX", .offset = offsetof(vm_cpu_t, RBX), .size = 64}, + {.name = "RCX", .offset = offsetof(vm_cpu_t, RCX), .size = 64}, + {.name = "RDX", .offset = offsetof(vm_cpu_t, RDX), .size = 64}, + {.name = "RSI", .offset = offsetof(vm_cpu_t, RSI), .size = 64}, + {.name = "RDI", .offset = offsetof(vm_cpu_t, RDI), .size = 64}, + {.name = "RSP", .offset = offsetof(vm_cpu_t, RSP), .size = 64}, + {.name = "RBP", .offset = offsetof(vm_cpu_t, RBP), .size = 64}, + + {.name = "R8", .offset = offsetof(vm_cpu_t, R8), .size = 64}, + {.name = "R9", .offset = offsetof(vm_cpu_t, R9), .size = 64}, + {.name = "R10", .offset = offsetof(vm_cpu_t, R10), .size = 64}, + {.name = "R11", .offset = offsetof(vm_cpu_t, R11), .size = 64}, + {.name = "R12", .offset = offsetof(vm_cpu_t, R12), .size = 64}, + {.name = "R13", .offset = offsetof(vm_cpu_t, R13), .size = 64}, + {.name = "R14", .offset = offsetof(vm_cpu_t, R14), .size = 64}, + {.name = "R15", .offset = offsetof(vm_cpu_t, R15), .size = 64}, + + {.name = "RIP", .offset = offsetof(vm_cpu_t, RIP), .size = 64}, + + {.name = "zf", .offset = offsetof(vm_cpu_t, zf), .size = 8}, + {.name = "nf", .offset = offsetof(vm_cpu_t, nf), .size = 8}, + {.name = "pf", .offset = offsetof(vm_cpu_t, pf), .size = 8}, + {.name = "of", .offset = offsetof(vm_cpu_t, of), .size = 8}, + {.name = "cf", .offset = offsetof(vm_cpu_t, cf), .size = 8}, + {.name = "af", .offset = offsetof(vm_cpu_t, af), .size = 8}, + {.name = "df", .offset = offsetof(vm_cpu_t, df), .size = 8}, + + {.name = "ES", .offset = offsetof(vm_cpu_t, ES), .size = 16}, + {.name = "CS", .offset = offsetof(vm_cpu_t, CS), .size = 16}, + {.name = "SS", .offset = offsetof(vm_cpu_t, SS), .size = 16}, + {.name = "DS", .offset = offsetof(vm_cpu_t, DS), .size = 16}, + {.name = "FS", .offset = offsetof(vm_cpu_t, FS), .size = 16}, + {.name = "GS", .offset = offsetof(vm_cpu_t, GS), .size = 16}, + + {.name = "MM0", .offset = offsetof(vm_cpu_t, MM0), .size = 64}, + {.name = "MM1", .offset = offsetof(vm_cpu_t, MM1), .size = 64}, + {.name = "MM2", .offset = offsetof(vm_cpu_t, MM2), .size = 64}, + {.name = "MM3", .offset = offsetof(vm_cpu_t, MM3), .size = 64}, + {.name = "MM4", .offset = offsetof(vm_cpu_t, MM4), .size = 64}, + {.name = "MM5", .offset = offsetof(vm_cpu_t, MM5), .size = 64}, + {.name = "MM6", .offset = offsetof(vm_cpu_t, MM6), .size = 64}, + {.name = "MM7", .offset = offsetof(vm_cpu_t, MM7), .size = 64}, + + {.name = "XMM0", .offset = offsetof(vm_cpu_t, XMM0), .size = 128}, + {.name = "XMM1", .offset = offsetof(vm_cpu_t, XMM1), .size = 128}, + {.name = "XMM2", .offset = offsetof(vm_cpu_t, XMM2), .size = 128}, + {.name = "XMM3", .offset = offsetof(vm_cpu_t, XMM3), .size = 128}, + {.name = "XMM4", .offset = offsetof(vm_cpu_t, XMM4), .size = 128}, + {.name = "XMM5", .offset = offsetof(vm_cpu_t, XMM5), .size = 128}, + {.name = "XMM6", .offset = offsetof(vm_cpu_t, XMM6), .size = 128}, + {.name = "XMM7", .offset = offsetof(vm_cpu_t, XMM7), .size = 128}, + {.name = "XMM8", .offset = offsetof(vm_cpu_t, XMM8), .size = 128}, + {.name = "XMM9", .offset = offsetof(vm_cpu_t, XMM9), .size = 128}, + {.name = "XMM10", .offset = offsetof(vm_cpu_t, XMM10), .size = 128}, + {.name = "XMM11", .offset = offsetof(vm_cpu_t, XMM11), .size = 128}, + {.name = "XMM12", .offset = offsetof(vm_cpu_t, XMM12), .size = 128}, + {.name = "XMM13", .offset = offsetof(vm_cpu_t, XMM13), .size = 128}, + {.name = "XMM14", .offset = offsetof(vm_cpu_t, XMM14), .size = 128}, + {.name = "XMM15", .offset = offsetof(vm_cpu_t, XMM15), .size = 128}, + + {.name = "tsc1", .offset = offsetof(vm_cpu_t, tsc1), .size = 32}, + {.name = "tsc2", .offset = offsetof(vm_cpu_t, tsc2), .size = 32}, + + {.name = "exception_flags", .offset = offsetof(vm_cpu_t, exception_flags), .size = 32}, + {.name = "interrupt_num", .offset = offsetof(vm_cpu_t, interrupt_num), .size = 32}, }; @@ -138,22 +139,22 @@ PyObject* cpu_get_gpreg(JitCpu* self) get_reg(MM6); get_reg(MM7); - get_reg_bn(XMM0); - get_reg_bn(XMM1); - get_reg_bn(XMM2); - get_reg_bn(XMM3); - get_reg_bn(XMM4); - get_reg_bn(XMM5); - get_reg_bn(XMM6); - get_reg_bn(XMM7); - get_reg_bn(XMM8); - get_reg_bn(XMM9); - get_reg_bn(XMM10); - get_reg_bn(XMM11); - get_reg_bn(XMM12); - get_reg_bn(XMM13); - get_reg_bn(XMM14); - get_reg_bn(XMM15); + get_reg_bn(XMM0, 128); + get_reg_bn(XMM1, 128); + get_reg_bn(XMM2, 128); + get_reg_bn(XMM3, 128); + get_reg_bn(XMM4, 128); + get_reg_bn(XMM5, 128); + get_reg_bn(XMM6, 128); + get_reg_bn(XMM7, 128); + get_reg_bn(XMM8, 128); + get_reg_bn(XMM9, 128); + get_reg_bn(XMM10, 128); + get_reg_bn(XMM11, 128); + get_reg_bn(XMM12, 128); + get_reg_bn(XMM13, 128); + get_reg_bn(XMM14, 128); + get_reg_bn(XMM15, 128); get_reg(tsc1); get_reg(tsc2); @@ -616,22 +617,22 @@ getset_reg_u64(MM5); getset_reg_u64(MM6); getset_reg_u64(MM7); -getset_reg_bn(XMM0); -getset_reg_bn(XMM1); -getset_reg_bn(XMM2); -getset_reg_bn(XMM3); -getset_reg_bn(XMM4); -getset_reg_bn(XMM5); -getset_reg_bn(XMM6); -getset_reg_bn(XMM7); -getset_reg_bn(XMM8); -getset_reg_bn(XMM9); -getset_reg_bn(XMM10); -getset_reg_bn(XMM11); -getset_reg_bn(XMM12); -getset_reg_bn(XMM13); -getset_reg_bn(XMM14); -getset_reg_bn(XMM15); +getset_reg_bn(XMM0, 128); +getset_reg_bn(XMM1, 128); +getset_reg_bn(XMM2, 128); +getset_reg_bn(XMM3, 128); +getset_reg_bn(XMM4, 128); +getset_reg_bn(XMM5, 128); +getset_reg_bn(XMM6, 128); +getset_reg_bn(XMM7, 128); +getset_reg_bn(XMM8, 128); +getset_reg_bn(XMM9, 128); +getset_reg_bn(XMM10, 128); +getset_reg_bn(XMM11, 128); +getset_reg_bn(XMM12, 128); +getset_reg_bn(XMM13, 128); +getset_reg_bn(XMM14, 128); +getset_reg_bn(XMM15, 128); getset_reg_u32(tsc1); getset_reg_u32(tsc2); |