Skip to content

Commit 1f9f484

Browse files
committed
Implementation of read/write access of ARM coproc
Fix unicorn-engine#652
1 parent 5a117c8 commit 1f9f484

26 files changed

+5290
-41
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ build/
9999
[Oo]bj/
100100
packages/
101101
cmocka/
102+
103+
# Arm documentation used for cpregs generation
104+
utils/arm-doc/

include/unicorn/arm.h

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef UNICORN_ARM_H
88
#define UNICORN_ARM_H
99

10+
#include "arm_cpreg.h"
11+
1012
#ifdef __cplusplus
1113
extern "C" {
1214
#endif
@@ -129,9 +131,8 @@ typedef enum uc_arm_reg {
129131
UC_ARM_REG_S30,
130132
UC_ARM_REG_S31,
131133

132-
UC_ARM_REG_C1_C0_2,
133-
UC_ARM_REG_C13_C0_2,
134-
UC_ARM_REG_C13_C0_3,
134+
//> CP registers
135+
UC_ARM_CPREG_LIST // C macro, see arm_cpgreg.h
135136

136137
UC_ARM_REG_ENDING, // <-- mark the end of the list or registers
137138

@@ -144,6 +145,9 @@ typedef enum uc_arm_reg {
144145
UC_ARM_REG_SL = UC_ARM_REG_R10,
145146
UC_ARM_REG_FP = UC_ARM_REG_R11,
146147
UC_ARM_REG_IP = UC_ARM_REG_R12,
148+
UC_ARM_REG_C1_C0_2 = UC_ARM_REG_CPACR,
149+
UC_ARM_REG_C13_C0_2 = UC_ARM_REG_TPIDRURW,
150+
UC_ARM_REG_C13_C0_3 = UC_ARM_REG_TPIDRURO,
147151
} uc_arm_reg;
148152

149153
#ifdef __cplusplus

include/unicorn/arm64.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef UNICORN_ARM64_H
88
#define UNICORN_ARM64_H
99

10+
#include "arm64_cpreg.h"
11+
1012
#ifdef __cplusplus
1113
extern "C" {
1214
#endif
@@ -283,13 +285,10 @@ typedef enum uc_arm64_reg {
283285
//> pseudo registers
284286
UC_ARM64_REG_PC, // program counter register
285287

286-
UC_ARM64_REG_CPACR_EL1,
287288

288-
//> thread registers
289-
UC_ARM64_REG_TPIDR_EL0,
290-
UC_ARM64_REG_TPIDRRO_EL0,
291-
UC_ARM64_REG_TPIDR_EL1,
292-
289+
//> CP registers
290+
UC_ARM64_CPREG_LIST // C macro, see arm64_cpgreg.h
291+
293292
UC_ARM64_REG_ENDING, // <-- mark the end of the list of registers
294293

295294
//> alias registers

0 commit comments

Comments
 (0)