From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KERJ0-0006Yp-Gw for qemu-devel@nongnu.org; Thu, 03 Jul 2008 12:05:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KERIw-0006UW-8N for qemu-devel@nongnu.org; Thu, 03 Jul 2008 12:05:07 -0400 Received: from [199.232.76.173] (port=33027 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KERIv-0006UH-QU for qemu-devel@nongnu.org; Thu, 03 Jul 2008 12:05:05 -0400 Received: from gecko.sbs.de ([194.138.37.40]:16458) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KERIu-0002GJ-JJ for qemu-devel@nongnu.org; Thu, 03 Jul 2008 12:05:05 -0400 Received: from mail2.sbs.de (localhost [127.0.0.1]) by gecko.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m63G4o5k017240 for ; Thu, 3 Jul 2008 18:04:50 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail2.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id m63G4oRW022051 for ; Thu, 3 Jul 2008 18:04:50 +0200 Resent-To: qemu-devel@nongnu.org Resent-Message-Id: <486CF8A2.5040605@siemens.com> Message-ID: <486CF757.3080805@siemens.com> Date: Thu, 03 Jul 2008 17:59:19 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <486CF559.5090805@siemens.com> In-Reply-To: <486CF559.5090805@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 5/13] Introduce next_cflags Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Introduce next_cflags as part of CPUState. It controls the compile flags of the next newly generated TB. After use, it will automatically be reset to zero. This allows the caller to simply set and then forget about it, e.g. to ensure that the next, and only the next TB will contain just a single instruction. Signed-off-by: Jan Kiszka --- cpu-defs.h | 4 ++++ cpu-exec.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) Index: b/cpu-defs.h =================================================================== --- a/cpu-defs.h +++ b/cpu-defs.h @@ -183,6 +183,10 @@ typedef struct CPUWatchpoint { } icount_decr; \ uint32_t can_do_io; /* nonzero if memory mapped IO is safe. */ \ \ + /* Compile flags for generating next regular TB. \ + Will be automatically zeroed after use. */ \ + uint16_t next_cflags; \ + \ /* from this point: preserved by CPU reset */ \ /* ice debug support */ \ CPUBreakpoint *breakpoints; \ Index: b/cpu-exec.c =================================================================== --- a/cpu-exec.c +++ b/cpu-exec.c @@ -150,7 +150,8 @@ static TranslationBlock *tb_find_slow(ta } not_found: /* if no translated code available, then translate it now */ - tb = tb_gen_code(env, pc, cs_base, flags, 0); + tb = tb_gen_code(env, pc, cs_base, flags, env->next_cflags); + env->next_cflags = 0; found: /* we add the TB in the virtual pc hash table */