add arm64 CPACR_EL1 register support (#814)

This commit is contained in:
Ryan Hileman 2017-05-01 23:51:19 -07:00 committed by Nguyen Anh Quynh
parent 9eebd6daa3
commit 187b470245
7 changed files with 18 additions and 5 deletions

View File

@ -272,7 +272,8 @@ module Arm64 =
// pseudo registers // pseudo registers
let UC_ARM64_REG_PC = 260 let UC_ARM64_REG_PC = 260
let UC_ARM64_REG_ENDING = 261 let UC_ARM64_REG_CPACR_EL1 = 261
let UC_ARM64_REG_ENDING = 262
// alias registers // alias registers
let UC_ARM64_REG_IP1 = 215 let UC_ARM64_REG_IP1 = 215

View File

@ -267,7 +267,8 @@ const (
// pseudo registers // pseudo registers
ARM64_REG_PC = 260 ARM64_REG_PC = 260
ARM64_REG_ENDING = 261 ARM64_REG_CPACR_EL1 = 261
ARM64_REG_ENDING = 262
// alias registers // alias registers
ARM64_REG_IP1 = 215 ARM64_REG_IP1 = 215

View File

@ -269,7 +269,8 @@ public interface Arm64Const {
// pseudo registers // pseudo registers
public static final int UC_ARM64_REG_PC = 260; public static final int UC_ARM64_REG_PC = 260;
public static final int UC_ARM64_REG_ENDING = 261; public static final int UC_ARM64_REG_CPACR_EL1 = 261;
public static final int UC_ARM64_REG_ENDING = 262;
// alias registers // alias registers
public static final int UC_ARM64_REG_IP1 = 215; public static final int UC_ARM64_REG_IP1 = 215;

View File

@ -265,7 +265,8 @@ UC_ARM64_REG_V31 = 259
# pseudo registers # pseudo registers
UC_ARM64_REG_PC = 260 UC_ARM64_REG_PC = 260
UC_ARM64_REG_ENDING = 261 UC_ARM64_REG_CPACR_EL1 = 261
UC_ARM64_REG_ENDING = 262
# alias registers # alias registers
UC_ARM64_REG_IP1 = 215 UC_ARM64_REG_IP1 = 215

View File

@ -267,7 +267,8 @@ module Unicorn
# pseudo registers # pseudo registers
UC_ARM64_REG_PC = 260 UC_ARM64_REG_PC = 260
UC_ARM64_REG_ENDING = 261 UC_ARM64_REG_CPACR_EL1 = 261
UC_ARM64_REG_ENDING = 262
# alias registers # alias registers
UC_ARM64_REG_IP1 = 215 UC_ARM64_REG_IP1 = 215

View File

@ -280,6 +280,8 @@ typedef enum uc_arm64_reg {
//> pseudo registers //> pseudo registers
UC_ARM64_REG_PC, // program counter register UC_ARM64_REG_PC, // program counter register
UC_ARM64_REG_CPACR_EL1,
UC_ARM64_REG_ENDING, // <-- mark the end of the list of registers UC_ARM64_REG_ENDING, // <-- mark the end of the list of registers
//> alias registers //> alias registers

View File

@ -76,6 +76,9 @@ int arm64_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int co
} else { } else {
switch(regid) { switch(regid) {
default: break; default: break;
case UC_ARM64_REG_CPACR_EL1:
*(uint32_t *)value = ARM_CPU(uc, mycpu)->env.cp15.c1_coproc;
break;
case UC_ARM64_REG_X29: case UC_ARM64_REG_X29:
*(int64_t *)value = ARM_CPU(uc, mycpu)->env.xregs[29]; *(int64_t *)value = ARM_CPU(uc, mycpu)->env.xregs[29];
break; break;
@ -129,6 +132,9 @@ int arm64_reg_write(struct uc_struct *uc, unsigned int *regs, void* const* vals,
} else { } else {
switch(regid) { switch(regid) {
default: break; default: break;
case UC_ARM64_REG_CPACR_EL1:
ARM_CPU(uc, mycpu)->env.cp15.c1_coproc = *(uint32_t *)value;
break;
case UC_ARM64_REG_X29: case UC_ARM64_REG_X29:
ARM_CPU(uc, mycpu)->env.xregs[29] = *(uint64_t *)value; ARM_CPU(uc, mycpu)->env.xregs[29] = *(uint64_t *)value;
break; break;