]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
include/exec/target_page.h: move page-target.c to header
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Wed, 30 Jul 2025 22:05:18 +0000 (15:05 -0700)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 2 Sep 2025 15:57:05 +0000 (17:57 +0200)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250730220519.1140447-3-pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
include/exec/target_page.h
meson.build
page-target.c [deleted file]

index ca0ebbc8bbd2caa11fcba59fbb203604ac80aa29..813591c9b51cfff1903bd436afe6c594c57d20d8 100644 (file)
@@ -62,6 +62,15 @@ static inline int qemu_target_page_bits(void)
     return TARGET_PAGE_BITS;
 }
 
-size_t qemu_target_pages_to_MiB(size_t pages);
+/* Convert target pages to MiB (2**20). */
+static inline size_t qemu_target_pages_to_MiB(size_t pages)
+{
+    int page_bits = TARGET_PAGE_BITS;
+
+    /* So far, the largest (non-huge) page size is 64k, i.e. 16 bits. */
+    g_assert(page_bits < 20);
+
+    return pages >> (20 - page_bits);
+}
 
 #endif
index 7ff84787cf197e35b03dbfef16770067d490cd30..fa6186db33435c26d06dce2971a9f536250607e0 100644 (file)
@@ -3899,7 +3899,7 @@ if get_option('b_lto')
   pagevary = declare_dependency(link_with: pagevary)
 endif
 common_ss.add(pagevary)
-specific_ss.add(files('page-target.c', 'page-vary-target.c'))
+specific_ss.add(files('page-vary-target.c'))
 
 common_ss.add(files('target-info.c'))
 specific_ss.add(files('target-info-stub.c'))
diff --git a/page-target.c b/page-target.c
deleted file mode 100644 (file)
index 8fcd544..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * QEMU page values getters (target independent)
- *
- *  Copyright (c) 2003 Fabrice Bellard
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
- */
-
-#include "qemu/osdep.h"
-#include "exec/target_page.h"
-
-/* Convert target pages to MiB (2**20). */
-size_t qemu_target_pages_to_MiB(size_t pages)
-{
-    int page_bits = TARGET_PAGE_BITS;
-
-    /* So far, the largest (non-huge) page size is 64k, i.e. 16 bits. */
-    g_assert(page_bits < 20);
-
-    return pages >> (20 - page_bits);
-}