From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnF9k-0005pu-1Y for qemu-devel@nongnu.org; Wed, 09 Feb 2011 13:52:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnF9h-0007y1-K7 for qemu-devel@nongnu.org; Wed, 09 Feb 2011 13:52:46 -0500 Received: from hall.aurel32.net ([88.191.126.93]:53282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnF9h-0007xq-E7 for qemu-devel@nongnu.org; Wed, 09 Feb 2011 13:52:45 -0500 Date: Wed, 9 Feb 2011 19:52:52 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Make tb_alloc static. Message-ID: <20110209185252.GL3131@volta.aurel32.net> References: <1297164135-30510-1-git-send-email-gingold@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1297164135-30510-1-git-send-email-gingold@adacore.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Tristan Gingold Cc: qemu-devel@nongnu.org On Tue, Feb 08, 2011 at 12:22:15PM +0100, Tristan Gingold wrote: > This function is only used within exec.c, so no need to make it public. > > Signed-off-by: Tristan Gingold > --- > exec-all.h | 1 - > exec.c | 4 +++- > 2 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/exec-all.h b/exec-all.h > index 81497c0..c062693 100644 > --- a/exec-all.h > +++ b/exec-all.h > @@ -182,7 +182,6 @@ static inline unsigned int tb_phys_hash_func(tb_page_addr_t pc) > return (pc >> 2) & (CODE_GEN_PHYS_HASH_SIZE - 1); > } > > -TranslationBlock *tb_alloc(target_ulong pc); > void tb_free(TranslationBlock *tb); > void tb_flush(CPUState *env); > void tb_link_page(TranslationBlock *tb, > diff --git a/exec.c b/exec.c > index 477199b..1c59d0b 100644 > --- a/exec.c > +++ b/exec.c > @@ -221,6 +221,8 @@ static int tlb_flush_count; > static int tb_flush_count; > static int tb_phys_invalidate_count; > > +static TranslationBlock *tb_alloc(target_ulong pc); > + What about moving tb_alloc() (with tb_free()) higher in the file? After all it make sense to have the function creating or destructing a tb before the function manipulating them. Otherwise looks like a good idea. > #ifdef _WIN32 > static void map_exec(void *addr, long size) > { > @@ -1229,7 +1231,7 @@ static inline void tb_alloc_page(TranslationBlock *tb, > > /* Allocate a new translation block. Flush the translation buffer if > too many translation blocks or too much generated code. */ > -TranslationBlock *tb_alloc(target_ulong pc) > +static TranslationBlock *tb_alloc(target_ulong pc) > { > TranslationBlock *tb; > > -- > 1.7.3.GIT > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net