From patchwork Sun Jun 14 08:38:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 30131 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5E8d3QI000551 for ; Sun, 14 Jun 2009 08:39:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750848AbZFNIi6 (ORCPT ); Sun, 14 Jun 2009 04:38:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750838AbZFNIi6 (ORCPT ); Sun, 14 Jun 2009 04:38:58 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54200 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837AbZFNIi5 (ORCPT ); Sun, 14 Jun 2009 04:38:57 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5E8cvtK028414; Sun, 14 Jun 2009 04:38:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5E8cunM006124; Sun, 14 Jun 2009 04:38:56 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5E8ctAc021277; Sun, 14 Jun 2009 04:38:55 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id B3B17250A6C; Sun, 14 Jun 2009 11:38:54 +0300 (IDT) From: Avi Kivity To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH 2/3] Rearrange io_mem_init() Date: Sun, 14 Jun 2009 11:38:52 +0300 Message-Id: <1244968733-23230-3-git-send-email-avi@redhat.com> In-Reply-To: <1244968733-23230-1-git-send-email-avi@redhat.com> References: <1244968733-23230-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Move io_mem_init() downwards to avoid a forward declaration. No code change. Signed-off-by: Avi Kivity --- exec.c | 47 +++++++++++++++++++++-------------------------- 1 files changed, 21 insertions(+), 26 deletions(-) diff --git a/exec.c b/exec.c index fb99486..a6852a4 100644 --- a/exec.c +++ b/exec.c @@ -3006,32 +3006,6 @@ static int get_free_io_mem_idx(void) return -1; } -static int cpu_register_io_memory_fixed(int io_index, - CPUReadMemoryFunc **mem_read, - CPUWriteMemoryFunc **mem_write, - void *opaque); - -static void io_mem_init(void) -{ - int i; - - cpu_register_io_memory_fixed(IO_MEM_ROM, error_mem_read, unassigned_mem_write, NULL); - cpu_register_io_memory_fixed(IO_MEM_UNASSIGNED, unassigned_mem_read, unassigned_mem_write, NULL); - cpu_register_io_memory_fixed(IO_MEM_NOTDIRTY, error_mem_read, notdirty_mem_write, NULL); - for (i=0; i<5; i++) - io_mem_used[i] = 1; - - io_mem_watch = cpu_register_io_memory(watch_mem_read, - watch_mem_write, NULL); -#ifdef CONFIG_KQEMU - if (kqemu_phys_ram_base) { - /* alloc dirty bits array */ - phys_ram_dirty = qemu_vmalloc(kqemu_phys_ram_size >> TARGET_PAGE_BITS); - memset(phys_ram_dirty, 0xff, kqemu_phys_ram_size >> TARGET_PAGE_BITS); - } -#endif -} - /* mem_read and mem_write are arrays of functions containing the function to access byte (index 0), word (index 1) and dword (index 2). Functions can be omitted with a NULL function pointer. @@ -3086,6 +3060,27 @@ void cpu_unregister_io_memory(int io_table_address) io_mem_used[io_index] = 0; } +static void io_mem_init(void) +{ + int i; + + cpu_register_io_memory_fixed(IO_MEM_ROM, error_mem_read, unassigned_mem_write, NULL); + cpu_register_io_memory_fixed(IO_MEM_UNASSIGNED, unassigned_mem_read, unassigned_mem_write, NULL); + cpu_register_io_memory_fixed(IO_MEM_NOTDIRTY, error_mem_read, notdirty_mem_write, NULL); + for (i=0; i<5; i++) + io_mem_used[i] = 1; + + io_mem_watch = cpu_register_io_memory(watch_mem_read, + watch_mem_write, NULL); +#ifdef CONFIG_KQEMU + if (kqemu_phys_ram_base) { + /* alloc dirty bits array */ + phys_ram_dirty = qemu_vmalloc(kqemu_phys_ram_size >> TARGET_PAGE_BITS); + memset(phys_ram_dirty, 0xff, kqemu_phys_ram_size >> TARGET_PAGE_BITS); + } +#endif +} + #endif /* !defined(CONFIG_USER_ONLY) */ /* physical memory access (slow version, mainly for debug) */