diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-08 14:25:03 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-08 14:25:03 +0000 |
commit | ec6338bac30f982c16c23106edcf1ce4a04da575 (patch) | |
tree | eb42654dd53839e7d6b74d4d7c071be0ff533ae5 /target-i386 | |
parent | 838104f60845adfa3ff5ad30e7f3a28c76f42bea (diff) |
removed obsolete x86 code copy support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3551 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/cpu.h | 11 | ||||
-rw-r--r-- | target-i386/helper2.c | 105 | ||||
-rw-r--r-- | target-i386/translate.c | 3 |
3 files changed, 0 insertions, 119 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h index e92fc31048..c8fb125916 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -46,10 +46,6 @@ #include "softfloat.h" -#if defined(__i386__) && !defined(CONFIG_SOFTMMU) && !defined(__APPLE__) -#define USE_CODE_COPY -#endif - #define R_EAX 0 #define R_ECX 1 #define R_EDX 2 @@ -552,13 +548,6 @@ typedef struct CPUX86State { uint64_t pat; - /* temporary data for USE_CODE_COPY mode */ -#ifdef USE_CODE_COPY - uint32_t tmp0; - uint32_t saved_esp; - int native_fp_regs; /* if true, the FPU state is in the native CPU regs */ -#endif - /* exception/interrupt handling */ jmp_buf jmp_env; int exception_index; diff --git a/target-i386/helper2.c b/target-i386/helper2.c index 87788d7214..065532049a 100644 --- a/target-i386/helper2.c +++ b/target-i386/helper2.c @@ -31,22 +31,6 @@ //#define DEBUG_MMU -#ifdef USE_CODE_COPY -#include <unistd.h> -#include <asm/ldt.h> -#include <linux/unistd.h> -#include <linux/version.h> - -int modify_ldt(int func, void *ptr, unsigned long bytecount) -{ - return syscall(__NR_modify_ldt, func, ptr, bytecount); -} - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66) -#define modify_ldt_ldt_s user_desc -#endif -#endif /* USE_CODE_COPY */ - static struct x86_def_t *x86_cpu_def; typedef struct x86_def_t x86_def_t; static int cpu_x86_register (CPUX86State *env, const x86_def_t *def); @@ -123,25 +107,6 @@ CPUX86State *cpu_x86_init(void) inited = 1; optimize_flags_init(); } -#ifdef USE_CODE_COPY - /* testing code for code copy case */ - { - struct modify_ldt_ldt_s ldt; - - ldt.entry_number = 1; - ldt.base_addr = (unsigned long)env; - ldt.limit = (sizeof(CPUState) + 0xfff) >> 12; - ldt.seg_32bit = 1; - ldt.contents = MODIFY_LDT_CONTENTS_DATA; - ldt.read_exec_only = 0; - ldt.limit_in_pages = 1; - ldt.seg_not_present = 0; - ldt.useable = 1; - modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */ - - asm volatile ("movl %0, %%fs" : : "r" ((1 << 3) | 7)); - } -#endif cpu_x86_register(env, x86_cpu_def); cpu_reset(env); #ifdef USE_KQEMU @@ -1186,73 +1151,3 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) return paddr; } #endif /* !CONFIG_USER_ONLY */ - -#if defined(USE_CODE_COPY) -struct fpstate { - uint16_t fpuc; - uint16_t dummy1; - uint16_t fpus; - uint16_t dummy2; - uint16_t fptag; - uint16_t dummy3; - - uint32_t fpip; - uint32_t fpcs; - uint32_t fpoo; - uint32_t fpos; - uint8_t fpregs1[8 * 10]; -}; - -void restore_native_fp_state(CPUState *env) -{ - int fptag, i, j; - struct fpstate fp1, *fp = &fp1; - - fp->fpuc = env->fpuc; - fp->fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; - fptag = 0; - for (i=7; i>=0; i--) { - fptag <<= 2; - if (env->fptags[i]) { - fptag |= 3; - } else { - /* the FPU automatically computes it */ - } - } - fp->fptag = fptag; - j = env->fpstt; - for(i = 0;i < 8; i++) { - memcpy(&fp->fpregs1[i * 10], &env->fpregs[j].d, 10); - j = (j + 1) & 7; - } - asm volatile ("frstor %0" : "=m" (*fp)); - env->native_fp_regs = 1; -} - -void save_native_fp_state(CPUState *env) -{ - int fptag, i, j; - uint16_t fpuc; - struct fpstate fp1, *fp = &fp1; - - asm volatile ("fsave %0" : : "m" (*fp)); - env->fpuc = fp->fpuc; - env->fpstt = (fp->fpus >> 11) & 7; - env->fpus = fp->fpus & ~0x3800; - fptag = fp->fptag; - for(i = 0;i < 8; i++) { - env->fptags[i] = ((fptag & 3) == 3); - fptag >>= 2; - } - j = env->fpstt; - for(i = 0;i < 8; i++) { - memcpy(&env->fpregs[j].d, &fp->fpregs1[i * 10], 10); - j = (j + 1) & 7; - } - /* we must restore the default rounding state */ - /* XXX: we do not restore the exception state */ - fpuc = 0x037f | (env->fpuc & (3 << 10)); - asm volatile("fldcw %0" : : "m" (fpuc)); - env->native_fp_regs = 0; -} -#endif diff --git a/target-i386/translate.c b/target-i386/translate.c index 7ab8f4b69f..02dc6cf61c 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -4888,9 +4888,6 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) goto illegal_op; } } -#ifdef USE_CODE_COPY - s->tb->cflags |= CF_TB_FP_USED; -#endif break; /************************/ /* string ops */ |