[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 20/34] memory: move RAM_PREALLOC_MASK to exec.c,
From: |
address@hidden |
Subject: |
[Qemu-devel] [PATCH v3 20/34] memory: move RAM_PREALLOC_MASK to exec.c, rename |
Date: |
Wed, 26 Mar 2014 10:37:00 +0000 |
From: Paolo Bonzini <address@hidden>
Prepare for adding more flags. The "_MASK" suffix is unique, kill it.
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 710e025..691d216 100644
--- a/exec.c
+++ b/exec.c
@@ -70,6 +70,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);
@@ -1316,7 +1319,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);
}
@@ -1355,7 +1358,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);
@@ -1387,7 +1390,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 dfdd071..6960544 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -414,9 +414,6 @@ CPUArchState *cpu_copy(CPUArchState *env);
/* 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.2.229.g4448466
- [Qemu-devel] [PATCH v3 18/34] memory: add error propagation to file-based RAM allocation, (continued)
- [Qemu-devel] [PATCH v3 18/34] memory: add error propagation to file-based RAM allocation, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 08/34] vl: convert -m to QemuOpts, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 14/34] add memdev backend infrastructure, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 21/34] hostmem: add file-based HostMemoryBackend, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 22/34] hostmem: separate allocation from UserCreatable complete method, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 26/34] configure: add Linux libnuma detection, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 24/34] hostmem: allow preallocation of any memory region, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 27/34] hostmem: add properties for NUMA memory policy, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 11/34] qmp: improve error reporting for -object and object-add, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 32/34] qom: introduce object_property_get_enum and object_property_get_uint16List, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 20/34] memory: move RAM_PREALLOC_MASK to exec.c, rename,
address@hidden <=
- [Qemu-devel] [PATCH v3 25/34] hostmem: add property to map memory with MAP_SHARED, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 23/34] hostmem: add merge and dump properties, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 34/34] hmp: add info memdev, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 28/34] hw: switch all boards to use memory_region_allocate_system_memory, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 31/34] qapi: make string output visitor parse int list, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 33/34] qmp: add query-memdev, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 06/34] man: improve -numa doc, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 19/34] memory: move preallocation code out of exec.c, address@hidden, 2014/03/26
- [Qemu-devel] [PATCH v3 29/34] Introduce signed range., address@hidden, 2014/03/26