[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 38/45] memory: inline a few small accessors
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 38/45] memory: inline a few small accessors |
Date: |
Thu, 17 Dec 2015 18:46:34 +0100 |
These are used in the address_space_* fast paths.
Signed-off-by: Paolo Bonzini <address@hidden>
---
include/exec/memory.h | 22 ++++++++++++++++++----
memory.c | 20 --------------------
2 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 3680d6a..a0993e5 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -523,7 +523,10 @@ uint64_t memory_region_size(MemoryRegion *mr);
*
* @mr: the memory region being queried
*/
-bool memory_region_is_ram(MemoryRegion *mr);
+static inline bool memory_region_is_ram(MemoryRegion *mr)
+{
+ return mr->ram;
+}
/**
* memory_region_is_skip_dump: check whether a memory region should not be
@@ -563,7 +566,11 @@ static inline bool memory_region_is_romd(MemoryRegion *mr)
*
* @mr: the memory region being queried
*/
-bool memory_region_is_iommu(MemoryRegion *mr);
+static inline bool memory_region_is_iommu(MemoryRegion *mr)
+{
+ return mr->iommu_ops;
+}
+
/**
* memory_region_notify_iommu: notify a change in an IOMMU translation entry.
@@ -645,7 +652,11 @@ uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr);
*
* @mr: the memory region being queried
*/
-bool memory_region_is_rom(MemoryRegion *mr);
+static inline bool memory_region_is_rom(MemoryRegion *mr)
+{
+ return mr->ram && mr->readonly;
+}
+
/**
* memory_region_get_fd: Get a file descriptor backing a RAM memory region.
@@ -970,7 +981,10 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr,
* DO NOT USE THIS FUNCTION. This is a temporary workaround while the Xen
* code is being reworked.
*/
-ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr);
+static inline ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr)
+{
+ return mr->ram_addr;
+}
uint64_t memory_region_get_alignment(const MemoryRegion *mr);
/**
diff --git a/memory.c b/memory.c
index b4d2b52..93bd8ed 100644
--- a/memory.c
+++ b/memory.c
@@ -1403,11 +1403,6 @@ const char *memory_region_name(const MemoryRegion *mr)
return mr->name;
}
-bool memory_region_is_ram(MemoryRegion *mr)
-{
- return mr->ram;
-}
-
bool memory_region_is_skip_dump(MemoryRegion *mr)
{
return mr->skip_dump;
@@ -1427,16 +1422,6 @@ bool memory_region_is_logging(MemoryRegion *mr, uint8_t
client)
return memory_region_get_dirty_log_mask(mr) & (1 << client);
}
-bool memory_region_is_rom(MemoryRegion *mr)
-{
- return mr->ram && mr->readonly;
-}
-
-bool memory_region_is_iommu(MemoryRegion *mr)
-{
- return mr->iommu_ops;
-}
-
void memory_region_register_iommu_notifier(MemoryRegion *mr, Notifier *n)
{
notifier_list_add(&mr->iommu_notify, n);
@@ -1928,11 +1913,6 @@ void memory_region_set_alias_offset(MemoryRegion *mr,
hwaddr offset)
memory_region_transaction_commit();
}
-ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr)
-{
- return mr->ram_addr;
-}
-
uint64_t memory_region_get_alignment(const MemoryRegion *mr)
{
return mr->align;
--
2.5.0
- [Qemu-devel] [PULL 30/45] linux-user: avoid "naked" qemu_log, (continued)
- [Qemu-devel] [PULL 30/45] linux-user: avoid "naked" qemu_log, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 28/45] xtensa: avoid "naked" qemu_log, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 35/45] memory: avoid unnecessary object_ref/unref, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 40/45] rcu: optimize rcu_read_lock, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 37/45] memory: extract first iteration of address_space_read and address_space_write, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 41/45] target-i386: kvm: clear unusable segments' flags in migration, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 43/45] scsi: always call notifier on async cancellation, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 44/45] coverity: Model g_poll(), Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 33/45] exec: make qemu_ram_ptr_length more similar to qemu_get_ram_ptr, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 36/45] memory: split address_space_read and address_space_write, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 38/45] memory: inline a few small accessors,
Paolo Bonzini <=
- [Qemu-devel] [PULL 39/45] memory: try to inline constant-length reads, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 42/45] scsi: use scsi_req_cancel_async when purging requests, Paolo Bonzini, 2015/12/17
- [Qemu-devel] [PULL 45/45] coverity: Model g_memdup(), Paolo Bonzini, 2015/12/17
- Re: [Qemu-devel] [PULL 00/45] KVM, memory, SCSI, qemu_log, Coverity patches for 2015-12-17, Peter Maydell, 2015/12/17