]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
system/ramblock: Move RAMBlock helpers out of "system/ram_addr.h"
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 29 Sep 2025 15:36:46 +0000 (17:36 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 7 Oct 2025 01:37:04 +0000 (03:37 +0200)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Peter Xu <peterx@redhat.com>
Message-Id: <20251002032812.26069-6-philmd@linaro.org>

include/system/ram_addr.h
include/system/ramblock.h

index 53c0c8c3856a6eb4d653dba86118e0b4516fc705..6b528338efcd7285df5937397a09549551d23a6d 100644 (file)
@@ -80,17 +80,6 @@ static inline bool clear_bmap_test_and_clear(RAMBlock *rb, uint64_t page)
     return bitmap_test_and_clear(rb->clear_bmap, page >> shift, 1);
 }
 
-static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset)
-{
-    return (b && b->host && offset < b->used_length) ? true : false;
-}
-
-static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset)
-{
-    assert(offset_in_ramblock(block, offset));
-    return (char *)block->host + offset;
-}
-
 static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
                                                             RAMBlock *rb)
 {
index 85cceff6bce01ed048b7cc6fcbc30c67640be01d..76694fe1b5bb98ccf8b63262b70a70778bd25804 100644 (file)
@@ -119,4 +119,15 @@ int ram_block_attributes_state_change(RamBlockAttributes *attr, uint64_t offset,
  */
 bool ram_block_is_pmem(RAMBlock *rb);
 
+static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset)
+{
+    return b && b->host && (offset < b->used_length);
+}
+
+static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset)
+{
+    assert(offset_in_ramblock(block, offset));
+    return (char *)block->host + offset;
+}
+
 #endif