25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: generate_arm_dpi.c,v 1.3 2005/11/11 07:31:31 debug Exp $ |
* $Id: generate_arm_dpi.c,v 1.5 2005/12/26 12:32:10 debug Exp $ |
29 |
*/ |
*/ |
30 |
|
|
31 |
#include <stdio.h> |
#include <stdio.h> |
39 |
"tst", "teq", "cmp", "cmn", "orr", "mov", "bic", "mvn" }; |
"tst", "teq", "cmp", "cmn", "orr", "mov", "bic", "mvn" }; |
40 |
|
|
41 |
|
|
42 |
char *uppercase(char *l) |
static char *uppercase(char *l) |
43 |
{ |
{ |
44 |
static char staticbuf[1000]; |
static char staticbuf[1000]; |
45 |
int i = 0; |
size_t i = 0; |
46 |
|
|
47 |
while (*l && i < sizeof(staticbuf)) { |
while (*l && i < sizeof(staticbuf)) { |
48 |
char u = *l++; |
char u = *l++; |
65 |
printf("#include <stdio.h>\n#include <stdlib.h>\n" |
printf("#include <stdio.h>\n#include <stdlib.h>\n" |
66 |
"#include \"cpu.h\"\n" |
"#include \"cpu.h\"\n" |
67 |
"#include \"misc.h\"\n" |
"#include \"misc.h\"\n" |
68 |
"#include \"arm_quick_pc_to_pointers.h\"\n" |
"#define DYNTRANS_PC_TO_POINTERS arm_pc_to_pointers\n" |
69 |
|
"#include \"quick_pc_to_pointers.h\"\n" |
70 |
"#define reg(x) (*((uint32_t *)(x)))\n"); |
"#define reg(x) (*((uint32_t *)(x)))\n"); |
71 |
printf("extern void arm_instr_nop(struct cpu *, " |
printf("extern void arm_instr_nop(struct cpu *, " |
72 |
"struct arm_instr_call *);\n"); |
"struct arm_instr_call *);\n"); |
73 |
printf("extern void arm_instr_invalid(struct cpu *, " |
printf("extern void arm_instr_invalid(struct cpu *, " |
74 |
"struct arm_instr_call *);\n"); |
"struct arm_instr_call *);\n"); |
75 |
|
printf("extern void arm_pc_to_pointers(struct cpu *);\n"); |
76 |
|
|
77 |
for (reg=0; reg<=2; reg++) |
for (reg=0; reg<=2; reg++) |
78 |
for (pc=0; pc<=1; pc++) |
for (pc=0; pc<=1; pc++) |