Index: Makefile.target =================================================================== RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.132 diff -u -r1.132 Makefile.target --- Makefile.target 29 Oct 2006 15:38:28 -0000 1.132 +++ Makefile.target 8 Nov 2006 05:58:10 -0000 @@ -17,7 +17,7 @@ VPATH+=:$(SRC_PATH)/linux-user DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing +CFLAGS=-Wall -O0 -g -fno-strict-aliasing #CFLAGS+=-Werror LDFLAGS=-g LIBS= @@ -66,8 +66,10 @@ endif ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +#HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer +#OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS:=$(CFLAGS) +OP_CFLAGS:=-Wall -O1 -g -mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+= -falign-functions=0 -fno-gcse else Index: block-raw.c =================================================================== RCS file: /sources/qemu/qemu/block-raw.c,v retrieving revision 1.10 diff -u -r1.10 block-raw.c --- block-raw.c 3 Sep 2006 12:08:37 -0000 1.10 +++ block-raw.c 8 Nov 2006 05:58:11 -0000 @@ -161,7 +161,8 @@ struct RawAIOCB *next; } RawAIOCB; -static int aio_sig_num = SIGUSR2; +//static int aio_sig_num = SIGUSR2; +static int aio_sig_num = SIGALRM; static RawAIOCB *first_aio; /* AIO issued */ static int aio_initialized = 0; Index: cpu-exec.c =================================================================== RCS file: /sources/qemu/qemu/cpu-exec.c,v retrieving revision 1.87 diff -u -r1.87 cpu-exec.c --- cpu-exec.c 22 Oct 2006 00:18:54 -0000 1.87 +++ cpu-exec.c 8 Nov 2006 05:58:14 -0000 @@ -812,6 +812,18 @@ cpu_loop_exit(); } #endif +#if 1 +#define MIN_CYCLE_COUNT 100 + { + static int cycle_count; + + if (++cycle_count > MIN_CYCLE_COUNT) { + cycle_count = 0; + env->exception_index = EXCP_INTERRUPT; + cpu_loop_exit(); + } + } +#endif } } else { env_to_regs(); Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.218 diff -u -r1.218 vl.c --- vl.c 1 Nov 2006 01:44:16 -0000 1.218 +++ vl.c 8 Nov 2006 05:58:20 -0000 @@ -878,6 +878,7 @@ last_clock = ti; } #endif +#if 0 if (qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL], qemu_get_clock(vm_clock)) || qemu_timer_expired(active_timers[QEMU_TIMER_REALTIME], @@ -896,6 +897,7 @@ #endif } } +#endif } #ifndef _WIN32 @@ -939,6 +941,7 @@ static void init_timer_alarm(void) { +#if 0 #ifdef _WIN32 { int count=0; @@ -1021,6 +1024,7 @@ } } #endif +#endif } void quit_timers(void) Index: target-i386/cpu.h =================================================================== RCS file: /sources/qemu/qemu/target-i386/cpu.h,v retrieving revision 1.38 diff -u -r1.38 cpu.h --- target-i386/cpu.h 27 Sep 2006 19:54:02 -0000 1.38 +++ target-i386/cpu.h 8 Nov 2006 05:58:21 -0000 @@ -531,6 +531,9 @@ /* in order to simplify APIC support, we leave this pointer to the user */ struct APICState *apic_state; + + /* jump count in TranslationBlock */ + uint32_t jumps_in_tb; } CPUX86State; CPUX86State *cpu_x86_init(void); Index: target-i386/exec.h =================================================================== RCS file: /sources/qemu/qemu/target-i386/exec.h,v retrieving revision 1.31 diff -u -r1.31 exec.h --- target-i386/exec.h 24 Sep 2006 18:40:46 -0000 1.31 +++ target-i386/exec.h 8 Nov 2006 05:58:21 -0000 @@ -30,7 +30,8 @@ #include "cpu-defs.h" /* at least 4 register variables are defined */ -register struct CPUX86State *env asm(AREG0); +//register struct CPUX86State *env asm(AREG0); +struct CPUX86State *env; #if TARGET_LONG_BITS > HOST_LONG_BITS @@ -43,9 +44,14 @@ /* XXX: use unsigned long instead of target_ulong - better code will be generated for 64 bit CPUs */ +#if 0 register target_ulong T0 asm(AREG1); register target_ulong T1 asm(AREG2); register target_ulong T2 asm(AREG3); +#endif +target_ulong T0; +target_ulong T1; +target_ulong T2; /* if more registers are available, we define some registers too */ #ifdef AREG4 @@ -506,6 +512,8 @@ extern const uint8_t rclw_table[32]; extern const uint8_t rclb_table[32]; +void helper_cpu_interrupt(void); + static inline uint32_t compute_eflags(void) { return env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK); Index: target-i386/helper.c =================================================================== RCS file: /sources/qemu/qemu/target-i386/helper.c,v retrieving revision 1.73 diff -u -r1.73 helper.c --- target-i386/helper.c 29 Sep 2006 20:01:17 -0000 1.73 +++ target-i386/helper.c 8 Nov 2006 05:58:25 -0000 @@ -3836,3 +3836,13 @@ } env = saved_env; } + +#define MAX_JUMP_COUNT_IN_TB 1000 + +void helper_cpu_interrupt(void) +{ + if (++env->jumps_in_tb > MAX_JUMP_COUNT_IN_TB) { + cpu_interrupt(env, CPU_INTERRUPT_EXIT); + env->jumps_in_tb = 0; + } +} Index: target-i386/op.c =================================================================== RCS file: /sources/qemu/qemu/target-i386/op.c,v retrieving revision 1.46 diff -u -r1.46 op.c --- target-i386/op.c 24 Sep 2006 18:40:46 -0000 1.46 +++ target-i386/op.c 8 Nov 2006 05:58:27 -0000 @@ -17,8 +17,9 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#if 0 #define ASM_SOFTMMU +#endif #include "exec.h" /* n must be a constant to be efficient */ @@ -2442,6 +2443,11 @@ *(uint32_t *)(env->fptags + 4) = 0x01010101; } +void OPPROTO op_cpu_interrupt(void) +{ + helper_cpu_interrupt(); +} + #define SHIFT 0 #include "ops_sse.h" Index: target-i386/translate.c =================================================================== RCS file: /sources/qemu/qemu/target-i386/translate.c,v retrieving revision 1.61 diff -u -r1.61 translate.c --- target-i386/translate.c 24 Sep 2006 18:40:46 -0000 1.61 +++ target-i386/translate.c 8 Nov 2006 05:58:34 -0000 @@ -1785,6 +1785,8 @@ target_ulong tmp; int l1, l2; + gen_op_cpu_interrupt(); + inv = b & 1; jcc_op = (b >> 1) & 7;