We will look for target-specific accel subclasses, if available.
Signed-off-by: Eduardo Habkost <[email protected]>
---
arch_init.c | 6 ++++++
hw/core/accel.c | 2 +-
include/hw/accel.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch_init.c b/arch_init.c
index 7870c0c..79f3d6a 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -52,6 +52,7 @@
#include "exec/ram_addr.h"
#include "hw/acpi/acpi.h"
#include "qemu/host-utils.h"
+#include "hw/accel.h"
#ifdef DEBUG_ARCH_INIT
#define DPRINTF(fmt, ...) \
@@ -155,6 +156,11 @@ int qemu_read_default_config_files(bool userconfig)
return 0;
}
+int configure_accelerator(MachineState *ms)
+{
+ return init_accelerator(ms, TARGET_NAME);
+}
+
static inline bool is_zero_range(uint8_t *p, uint64_t size)
{
return buffer_find_nonzero_offset(p, size) == size;
diff --git a/hw/core/accel.c b/hw/core/accel.c
index 268ecee..78e7dfc 100644
--- a/hw/core/accel.c
+++ b/hw/core/accel.c
@@ -76,7 +76,7 @@ static int accel_init_machine(AccelClass *acc, MachineState
*ms)
return ret;
}
-int configure_accelerator(MachineState *ms)
+int init_accelerator(MachineState *ms, const char *target_name)
{
const char *p;
char buf[10];
diff --git a/include/hw/accel.h b/include/hw/accel.h
index 4f9909d..a369c61 100644
--- a/include/hw/accel.h
+++ b/include/hw/accel.h
@@ -55,5 +55,6 @@ typedef struct AccelClass {
extern int tcg_tb_size;
int configure_accelerator(MachineState *ms);
+int init_accelerator(MachineState *ms, const char *target_name);
#endif
--
1.9.3