Received: from eggs.gnu.org ([2001:4830:134:3::10]:39237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKpvO-0001YO-IB for qemu-devel@nongnu.org; Tue, 04 Mar 2014 09:02:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKpvG-0001bX-4b for qemu-devel@nongnu.org; Tue, 04 Mar 2014 09:02:26 -0500 Received: from mail-ea0-x22d.google.com ([2a00:1450:4013:c01::22d]:53575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKpvF-0001b7-Pb for qemu-devel@nongnu.org; Tue, 04 Mar 2014 09:02:18 -0500 Received: by mail-ea0-f173.google.com with SMTP id r15so372656ead.32 for ; Tue, 04 Mar 2014 06:02:16 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 4 Mar 2014 15:00:48 +0100 Message-Id: <1393941656-29068-21-git-send-email-pbonzini@redhat.com> In-Reply-To: <1393941656-29068-1-git-send-email-pbonzini@redhat.com> References: <1393941656-29068-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2.1 20/28] memory: move RAM_PREALLOC_MASK to exec.c, rename List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, hutao@cn.fujitsu.com, mtosatti@redhat.com, imammedo@redhat.com, a.motakis@virtualopensystems.com, gaowanlong@cn.fujitsu.com Prepare for adding more flags. The "_MASK" suffix is unique, kill it. Signed-off-by: Paolo Bonzini --- exec.c | 9 ++++++--- include/exec/cpu-all.h | 3 --- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 7f05f14..387eb9c 100644 --- a/exec.c +++ b/exec.c @@ -71,6 +71,9 @@ AddressSpace address_space_memory; MemoryRegion io_mem_rom, io_mem_notdirty; static MemoryRegion io_mem_unassigned; +/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */ +#define RAM_PREALLOC (1 << 0) + #endif struct CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus); @@ -1305,7 +1308,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, new_block->fd = -1; new_block->host = host; if (host) { - new_block->flags |= RAM_PREALLOC_MASK; + new_block->flags |= RAM_PREALLOC; } return ram_block_add(new_block); } @@ -1344,7 +1347,7 @@ void qemu_ram_free(ram_addr_t addr) QTAILQ_REMOVE(&ram_list.blocks, block, next); ram_list.mru_block = NULL; ram_list.version++; - if (block->flags & RAM_PREALLOC_MASK) { + if (block->flags & RAM_PREALLOC) { ; } else if (xen_enabled()) { xen_invalidate_map_cache_entry(block->host); @@ -1376,7 +1379,7 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) offset = addr - block->offset; if (offset < block->length) { vaddr = block->host + offset; - if (block->flags & RAM_PREALLOC_MASK) { + if (block->flags & RAM_PREALLOC) { ; } else if (xen_enabled()) { abort(); diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index b44babb..fa4807d 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -438,9 +438,6 @@ void cpu_watchpoint_remove_all(CPUArchState *env, int mask); /* memory API */ -/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */ -#define RAM_PREALLOC_MASK (1 << 0) - typedef struct RAMBlock { struct MemoryRegion *mr; uint8_t *host; -- 1.8.5.3