[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 19/21] exec/cpu: Make address_space_init/reloading_memory_map
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 19/21] exec/cpu: Make address_space_init/reloading_memory_map target agnostic |
Date: |
Thu, 3 Feb 2022 20:18:12 +0100 |
cpu_address_space_init() and cpu_reloading_memory_map() are
target-agnostic, but are declared in "exec/exec-all.h" which
contains target-specific declarations. Any target-agnostic
source including "exec/exec-all.h" becomes target-specific and
we have to compile it N times for the N targets built. In order
to avoid that, move the declarations to "exec/cpu-common.h" which
only contains target-agnostic declarations.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/exec/cpu-common.h | 23 +++++++++++++++++++++++
include/exec/exec-all.h | 25 -------------------------
2 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 8031ebc680..7f7b5943c7 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -90,6 +90,28 @@ void qemu_ram_unset_migratable(RAMBlock *rb);
size_t qemu_ram_pagesize(RAMBlock *block);
size_t qemu_ram_pagesize_largest(void);
+/**
+ * cpu_address_space_init:
+ * @cpu: CPU to add this address space to
+ * @asidx: integer index of this address space
+ * @prefix: prefix to be used as name of address space
+ * @mr: the root memory region of address space
+ *
+ * Add the specified address space to the CPU's cpu_ases list.
+ * The address space added with @asidx 0 is the one used for the
+ * convenience pointer cpu->as.
+ * The target-specific code which registers ASes is responsible
+ * for defining what semantics address space 0, 1, 2, etc have.
+ *
+ * Before the first call to this function, the caller must set
+ * cpu->num_ases to the total number of address spaces it needs
+ * to support.
+ *
+ * Note that with KVM only one address space is supported.
+ */
+void cpu_address_space_init(CPUState *cpu, int asidx,
+ const char *prefix, MemoryRegion *mr);
+
void cpu_physical_memory_rw(hwaddr addr, void *buf,
hwaddr len, bool is_write);
static inline void cpu_physical_memory_read(hwaddr addr,
@@ -102,6 +124,7 @@ static inline void cpu_physical_memory_write(hwaddr addr,
{
cpu_physical_memory_rw(addr, (void *)buf, len, true);
}
+void cpu_reloading_memory_map(void);
void *cpu_physical_memory_map(hwaddr addr,
hwaddr *plen,
bool is_write);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 87df70fa8f..199fd49e5d 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -82,31 +82,6 @@ static inline bool cpu_loop_exit_requested(CPUState *cpu)
return (int32_t)qatomic_read(&cpu_neg(cpu)->icount_decr.u32) < 0;
}
-#if !defined(CONFIG_USER_ONLY)
-void cpu_reloading_memory_map(void);
-/**
- * cpu_address_space_init:
- * @cpu: CPU to add this address space to
- * @asidx: integer index of this address space
- * @prefix: prefix to be used as name of address space
- * @mr: the root memory region of address space
- *
- * Add the specified address space to the CPU's cpu_ases list.
- * The address space added with @asidx 0 is the one used for the
- * convenience pointer cpu->as.
- * The target-specific code which registers ASes is responsible
- * for defining what semantics address space 0, 1, 2, etc have.
- *
- * Before the first call to this function, the caller must set
- * cpu->num_ases to the total number of address spaces it needs
- * to support.
- *
- * Note that with KVM only one address space is supported.
- */
-void cpu_address_space_init(CPUState *cpu, int asidx,
- const char *prefix, MemoryRegion *mr);
-#endif
-
#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG)
/* cputlb.c */
/**
--
2.34.1
- Re: [PATCH v2 09/21] softmmu/cpus: Code movement, (continued)
- [PATCH v2 06/21] sysemu/kvm: Make kvm_on_sigbus() / kvm_on_sigbus_vcpu() target agnostic, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 11/21] accel: Introduce AccelOpsClass::cpus_are_resettable(), Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 12/21] softmmu/globals: Remove unused 'hw/i386/*' headers, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 10/21] accel: Introduce AccelOpsClass::cpu_thread_is_idle(), Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 18/21] exec/gdbstub: Make gdb_exit() / gdb_set_stop_cpu() target agnostic, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 17/21] misc: Add missing "sysemu/cpu-timers.h" include, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 19/21] exec/cpu: Make address_space_init/reloading_memory_map target agnostic,
Philippe Mathieu-Daudé <=
- [PATCH v2 13/21] softmmu/runstate: Clean headers, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 14/21] softmmu/physmem: Remove unnecessary include, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 15/21] softmmu/cpu-timers: Remove unused 'exec/exec-all.h' header, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 16/21] misc: Remove unnecessary "sysemu/cpu-timers.h" include, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 21/21] softmmu: Build target-agnostic objects once, Philippe Mathieu-Daudé, 2022/02/03
- [PATCH v2 20/21] softmmu: Add qemu_init_arch_modules(), Philippe Mathieu-Daudé, 2022/02/03