47 #if defined(A__SIGNED) && !defined(A__H) && !defined(A__L) 50 #if defined(A__SIGNED) && defined(A__H) && !defined(A__L) 62 #if !defined(A__P) && defined(A__W) 69 uint32_t (*reg_func)(
struct cpu *,
struct arm_instr_call *)
70 = (uint32_t (*)(
struct cpu *,
struct arm_instr_call *))
71 (
void *)(
size_t)ic->arg[1];
74 #if defined(A__STRD) || defined(A__LDRD) 75 unsigned char data[8];
76 const int datalen = 8;
79 unsigned char data[1];
80 const int datalen = 1;
83 unsigned char data[2];
84 const int datalen = 2;
86 const int datalen = 4;
87 #ifdef HOST_LITTLE_ENDIAN 88 unsigned char *data = (
unsigned char *) ic->arg[2];
90 unsigned char data[4];
96 uint32_t
addr, low_pc, offset =
106 low_pc = ((size_t)ic - (
size_t)cpu->
cd.
arm.
107 cur_ic_page) /
sizeof(
struct arm_instr_call);
112 addr =
reg(ic->arg[0])
118 addr &= ~(datalen - 1);
120 #if defined(A__L) || defined(A__LDRD) 127 #if defined(A__B) && !defined(A__LDRD) 134 #if defined(A__H) && !defined(A__LDRD) 140 ? (data[0] + (data[1] << 8))
141 : (data[1] + (data[0] << 8)));
146 ? data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
147 : data[3] + (data[2] << 8) + (data[1] << 16) + (data[0] << 24);
152 ? data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24)
153 : data[7] + (data[1] << 6) + (data[5] << 16) + (data[4] << 24);
154 reg(((uint32_t *)ic->arg[2]) + 1) =
156 ? data[4] + (data[5] << 8) + (data[6] << 16) + (data[7] << 24)
157 : data[0] + (data[1] << 8) + (data[2] << 16) + (data[3] << 24);
163 #if !defined(A__B) && !defined(A__H) && defined(HOST_LITTLE_ENDIAN) 165 *(uint32_t *)data =
reg(ic->arg[2]);
166 *(uint32_t *)(data + 4) =
reg(ic->arg[2] + 4);
170 data[i] =
reg(ic->arg[2]);
173 data[i] =
reg(ic->arg[2]) >> 8;
175 #if !defined(A__H) || defined(A__STRD) 176 data[i] =
reg(ic->arg[2]) >> 16;
178 data[i] =
reg(ic->arg[2]) >> 24;
182 data[i] =
reg(ic->arg[2] + 4);
184 data[i] =
reg(ic->arg[2] + 4) >> 8;
186 data[i] =
reg(ic->arg[2] + 4) >> 16;
188 data[i] =
reg(ic->arg[2] + 4) >> 24;
206 reg(ic->arg[0]) = addr + offset;
216 #if defined(A__LDRD) || defined(A__STRD) 221 uint32_t (*reg_func)(
struct cpu *,
struct arm_instr_call *)
222 = (uint32_t (*)(
struct cpu *,
struct arm_instr_call *))
223 (
void *)(
size_t)ic->arg[1];
234 uint32_t
addr =
reg(ic->arg[0])
248 #if !defined(A__P) && defined(A__W) 255 if (!(x & (1 << ((addr >> 12) & 31))))
279 ? (page[addr & 0xfff] + (page[(addr & 0xfff) + 1] << 8))
280 : ((page[addr & 0xfff] << 8) + page[(addr & 0xfff) + 1]));
284 reg(ic->arg[2]) = page[addr & 0xfff] +
285 (page[(addr & 0xfff) + 1] << 8) +
286 (page[(addr & 0xfff) + 2] << 16) +
287 (page[(addr & 0xfff) + 3] << 24);
289 reg(ic->arg[2]) = page[(addr & 0xfff) + 3] +
290 (page[(addr & 0xfff) + 2] << 8) +
291 (page[(addr & 0xfff) + 1] << 16) +
292 (page[(addr & 0xfff) + 0] << 24);
297 page[addr & 0xfff] =
reg(ic->arg[2]);
302 page[addr & 0xfff] =
reg(ic->arg[2]);
303 page[(addr & 0xfff)+1] =
reg(ic->arg[2]) >> 8;
305 page[addr & 0xfff] =
reg(ic->arg[2]) >> 8;
306 page[(addr & 0xfff)+1] =
reg(ic->arg[2]);
311 page[addr & 0xfff] =
reg(ic->arg[2]);
312 page[(addr & 0xfff)+1] =
reg(ic->arg[2]) >> 8;
313 page[(addr & 0xfff)+2] =
reg(ic->arg[2]) >> 16;
314 page[(addr & 0xfff)+3] =
reg(ic->arg[2]) >> 24;
316 page[addr & 0xfff] =
reg(ic->arg[2]) >> 24;
317 page[(addr & 0xfff)+1] =
reg(ic->arg[2]) >> 16;
318 page[(addr & 0xfff)+2] =
reg(ic->arg[2]) >> 8;
319 page[(addr & 0xfff)+3] =
reg(ic->arg[2]);
332 reg(ic->arg[0]) = addr + offset;
361 uint32_t low_pc, tmp;
362 low_pc = ((size_t)ic - (
size_t) cpu->
cd.
arm.cur_ic_page) /
363 sizeof(
struct arm_instr_call);
378 uint32_t low_pc, tmp;
380 low_pc = ((size_t)ic - (
size_t) cpu->
cd.
arm.cur_ic_page) /
381 sizeof(
struct arm_instr_call);
391 #ifndef A__NOCONDITIONS void A__NAME_PC__ge(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__cs(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__vc(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__general(struct cpu *cpu, struct arm_instr_call *ic)
struct arm_instr_call * ic
void A__NAME__pl(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__mi(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__eq(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__cc(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__cc(struct cpu *cpu, struct arm_instr_call *ic)
uint32_t is_userpage[N_VPH32_ENTRIES/32]
#define EMUL_LITTLE_ENDIAN
#define ARM_IC_ENTRIES_PER_PAGE
void A__NAME_PC__ne(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__hi(struct cpu *cpu, struct arm_instr_call *ic)
#define quick_pc_to_pointers(cpu)
#define ARM_INSTR_ALIGNMENT_SHIFT
void A__NAME_PC__ls(struct cpu *cpu, struct arm_instr_call *ic)
int(* memory_rw)(struct cpu *cpu, struct memory *mem, uint64_t vaddr, unsigned char *data, size_t len, int writeflag, int cache_flags)
void A__NAME_PC__le(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__eq(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__vc(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__ne(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__lt(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__pl(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__gt(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__ls(struct cpu *cpu, struct arm_instr_call *ic)
void cpu_functioncall_trace(struct cpu *cpu, uint64_t f)
void A__NAME_PC__vs(struct cpu *cpu, struct arm_instr_call *ic)
#define MEMORY_USER_ACCESS
void A__NAME__gt(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__ge(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__vs(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__le(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__hi(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__lt(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME__mi(struct cpu *cpu, struct arm_instr_call *ic)
void A__NAME_PC__cs(struct cpu *cpu, struct arm_instr_call *ic)