aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-dyngen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcg/tcg-dyngen.c')
-rw-r--r--tcg/tcg-dyngen.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/tcg/tcg-dyngen.c b/tcg/tcg-dyngen.c
index 8e9d2e92d8..b4ceb5e5c6 100644
--- a/tcg/tcg-dyngen.c
+++ b/tcg/tcg-dyngen.c
@@ -143,109 +143,6 @@ void fix_bsr(void *p, int offset) {
#endif /* __alpha__ */
-#ifdef __arm__
-
-#define ARM_LDR_TABLE_SIZE 1024
-
-typedef struct LDREntry {
- uint8_t *ptr;
- uint32_t *data_ptr;
- unsigned type:2;
-} LDREntry;
-
-static LDREntry arm_ldr_table[1024];
-static uint32_t arm_data_table[ARM_LDR_TABLE_SIZE];
-
-extern char exec_loop;
-
-static inline void arm_reloc_pc24(uint32_t *ptr, uint32_t insn, int val)
-{
- *ptr = (insn & ~0xffffff) | ((insn + ((val - (int)ptr) >> 2)) & 0xffffff);
-}
-
-static uint8_t *arm_flush_ldr(uint8_t *gen_code_ptr,
- LDREntry *ldr_start, LDREntry *ldr_end,
- uint32_t *data_start, uint32_t *data_end,
- int gen_jmp)
-{
- LDREntry *le;
- uint32_t *ptr;
- int offset, data_size, target;
- uint8_t *data_ptr;
- uint32_t insn;
- uint32_t mask;
-
- data_size = (data_end - data_start) << 2;
-
- if (gen_jmp) {
- /* generate branch to skip the data */
- if (data_size == 0)
- return gen_code_ptr;
- target = (long)gen_code_ptr + data_size + 4;
- arm_reloc_pc24((uint32_t *)gen_code_ptr, 0xeafffffe, target);
- gen_code_ptr += 4;
- }
-
- /* copy the data */
- data_ptr = gen_code_ptr;
- memcpy(gen_code_ptr, data_start, data_size);
- gen_code_ptr += data_size;
-
- /* patch the ldr to point to the data */
- for(le = ldr_start; le < ldr_end; le++) {
- ptr = (uint32_t *)le->ptr;
- offset = ((unsigned long)(le->data_ptr) - (unsigned long)data_start) +
- (unsigned long)data_ptr -
- (unsigned long)ptr - 8;
- if (offset < 0) {
- fprintf(stderr, "Negative constant pool offset\n");
- tcg_abort();
- }
- switch (le->type) {
- case 0: /* ldr */
- mask = ~0x00800fff;
- if (offset >= 4096) {
- fprintf(stderr, "Bad ldr offset\n");
- tcg_abort();
- }
- break;
- case 1: /* ldc */
- mask = ~0x008000ff;
- if (offset >= 1024 ) {
- fprintf(stderr, "Bad ldc offset\n");
- tcg_abort();
- }
- break;
- case 2: /* add */
- mask = ~0xfff;
- if (offset >= 1024 ) {
- fprintf(stderr, "Bad add offset\n");
- tcg_abort();
- }
- break;
- default:
- fprintf(stderr, "Bad pc relative fixup\n");
- tcg_abort();
- }
- insn = *ptr & mask;
- switch (le->type) {
- case 0: /* ldr */
- insn |= offset | 0x00800000;
- break;
- case 1: /* ldc */
- insn |= (offset >> 2) | 0x00800000;
- break;
- case 2: /* add */
- insn |= (offset >> 2) | 0xf00;
- break;
- }
- *ptr = insn;
- }
- return gen_code_ptr;
-}
-
-#endif /* __arm__ */
-
#ifdef __ia64
/* Patch instruction with "val" where "mask" has 1 bits. */