qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liu Ping Fan <qemulist@gmail.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCH v1 1/6] mem: change variable to macro
Date: Wed, 29 May 2013 10:11:04 +0800	[thread overview]
Message-ID: <1369793469-30883-2-git-send-email-qemulist@gmail.com> (raw)
In-Reply-To: <1369793469-30883-1-git-send-email-qemulist@gmail.com>

From: Liu Ping Fan <pingfank@linux.vnet.ibm.com>

The secions like phys_section_unassigned always has fixed address
in phys_sections, make them declared as macro, so we can use them
when having more than one phys_sections, ie, more than one dispatch
context.

Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
 exec.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/exec.c b/exec.c
index 281c007..6934c2d 100644
--- a/exec.c
+++ b/exec.c
@@ -82,10 +82,10 @@ int use_icount;
 
 static MemoryRegionSection *phys_sections;
 static unsigned phys_sections_nb, phys_sections_nb_alloc;
-static uint16_t phys_section_unassigned;
-static uint16_t phys_section_notdirty;
-static uint16_t phys_section_rom;
-static uint16_t phys_section_watch;
+#define phys_section_unassigned 0
+#define phys_section_notdirty 1
+#define phys_section_rom 2
+#define phys_section_watch 3
 
 /* Simple allocator for PhysPageEntry nodes */
 static PhysPageEntry (*phys_map_nodes)[L2_SIZE];
@@ -1747,11 +1747,17 @@ static void mem_begin(MemoryListener *listener)
 
 static void core_begin(MemoryListener *listener)
 {
+    uint16_t n;
+
     phys_sections_clear();
-    phys_section_unassigned = dummy_section(&io_mem_unassigned);
-    phys_section_notdirty = dummy_section(&io_mem_notdirty);
-    phys_section_rom = dummy_section(&io_mem_rom);
-    phys_section_watch = dummy_section(&io_mem_watch);
+    n = dummy_section(&io_mem_unassigned);
+    assert(phys_section_unassigned == n);
+    n = dummy_section(&io_mem_notdirty);
+    assert(phys_section_notdirty == n);
+    n = dummy_section(&io_mem_rom);
+    assert(phys_section_rom == n);
+    n = dummy_section(&io_mem_watch);
+    assert(phys_section_watch == n);
 }
 
 static void tcg_commit(MemoryListener *listener)
-- 
1.7.4.4

  reply	other threads:[~2013-05-29  2:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  2:11 [Qemu-devel] [PATCH v1 0/6] make memory listener prepared for rcu style Liu Ping Fan
2013-05-29  2:11 ` Liu Ping Fan [this message]
2013-05-29  9:06   ` [Qemu-devel] [PATCH v1 1/6] mem: change variable to macro Paolo Bonzini
2013-05-29  2:11 ` [Qemu-devel] [PATCH v1 2/6] mem: make global dispatch table ready for rcu Liu Ping Fan
2013-05-29  7:07   ` Paolo Bonzini
2013-05-29  2:11 ` [Qemu-devel] [PATCH v1 3/6] mem: fold tcg listener's logic into core memory listener Liu Ping Fan
2013-05-29  2:11 ` [Qemu-devel] [PATCH v1 4/6] mem: concenter the root of each AddressSpaceDispatch Liu Ping Fan
2013-05-29  7:03   ` Paolo Bonzini
2013-05-29  7:48     ` liu ping fan
2013-05-29  8:31       ` Paolo Bonzini
2013-05-29  9:24         ` liu ping fan
2013-05-29 11:30           ` Paolo Bonzini
2013-05-29  2:11 ` [Qemu-devel] [PATCH v1 5/6] mem: make dispatch path satify rcu style Liu Ping Fan
2013-05-29  7:06   ` Paolo Bonzini
2013-05-29  7:15   ` Paolo Bonzini
2013-05-29  2:11 ` [Qemu-devel] [PATCH v1 6/6] mem: change tcg code to " Liu Ping Fan
2013-05-29  7:22   ` Paolo Bonzini
2013-05-29  9:00     ` liu ping fan
2013-05-29  9:03       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369793469-30883-2-git-send-email-qemulist@gmail.com \
    --to=qemulist@gmail.com \
    --cc=anthony@codemonkey.ws \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).