Add x87 FPU registers #1524
This commit is contained in:
@ -319,6 +319,11 @@ typedef enum uc_x86_reg {
|
|||||||
UC_X86_REG_GS_BASE,
|
UC_X86_REG_GS_BASE,
|
||||||
UC_X86_REG_FLAGS,
|
UC_X86_REG_FLAGS,
|
||||||
UC_X86_REG_RFLAGS,
|
UC_X86_REG_RFLAGS,
|
||||||
|
UC_X86_REG_FIP,
|
||||||
|
UC_X86_REG_FCS,
|
||||||
|
UC_X86_REG_FDP,
|
||||||
|
UC_X86_REG_FDS,
|
||||||
|
UC_X86_REG_FOP,
|
||||||
UC_X86_REG_ENDING // <-- mark the end of the list of registers
|
UC_X86_REG_ENDING // <-- mark the end of the list of registers
|
||||||
} uc_x86_reg;
|
} uc_x86_reg;
|
||||||
|
|
||||||
|
@ -321,6 +321,22 @@ static void reg_read(CPUX86State *env, unsigned int regid, void *value,
|
|||||||
dst[3] = hi_reg->_d[1];
|
dst[3] = hi_reg->_d[1];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case UC_X86_REG_FIP:
|
||||||
|
*(uint64_t *)value = env->fpip;
|
||||||
|
return;
|
||||||
|
case UC_X86_REG_FCS:
|
||||||
|
*(uint16_t *)value = env->fpcs;
|
||||||
|
return;
|
||||||
|
case UC_X86_REG_FDP:
|
||||||
|
*(uint64_t *)value = env->fpdp;
|
||||||
|
return;
|
||||||
|
case UC_X86_REG_FDS:
|
||||||
|
*(uint16_t *)value = env->fpds;
|
||||||
|
return;
|
||||||
|
case UC_X86_REG_FOP:
|
||||||
|
*(uint16_t *)value = env->fpop;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
@ -912,6 +928,22 @@ static int reg_write(CPUX86State *env, unsigned int regid, const void *value,
|
|||||||
hi_reg->_d[1] = src[3];
|
hi_reg->_d[1] = src[3];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case UC_X86_REG_FIP:
|
||||||
|
env->fpip = *(uint64_t *)value;
|
||||||
|
return 0;
|
||||||
|
case UC_X86_REG_FCS:
|
||||||
|
env->fpcs = *(uint16_t *)value;
|
||||||
|
return 0;
|
||||||
|
case UC_X86_REG_FDP:
|
||||||
|
env->fpdp = *(uint64_t *)value;
|
||||||
|
return 0;
|
||||||
|
case UC_X86_REG_FDS:
|
||||||
|
env->fpds = *(uint16_t *)value;
|
||||||
|
return 0;
|
||||||
|
case UC_X86_REG_FOP:
|
||||||
|
env->fpop = *(uint16_t *)value;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
Reference in New Issue
Block a user