mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-16 16:47:23 +00:00
machine: Eliminate QEMUMachine and qemu_register_machine()
The struct is not used anymore and can be eliminated. Backports commit 3b53e45f43825caaaf4fad6a5b85ce6a9949ff02 from qemu
This commit is contained in:
parent
048aaf05ca
commit
7c7bb4c6d1
|
@ -10,19 +10,6 @@
|
||||||
#include "qom/cpu.h"
|
#include "qom/cpu.h"
|
||||||
#include "uc_priv.h"
|
#include "uc_priv.h"
|
||||||
|
|
||||||
typedef int QEMUMachineInitFunc(struct uc_struct *uc, MachineState *ms);
|
|
||||||
|
|
||||||
typedef void QEMUMachineResetFunc(void);
|
|
||||||
|
|
||||||
struct QEMUMachine {
|
|
||||||
const char *name;
|
|
||||||
QEMUMachineInitFunc *init;
|
|
||||||
int max_cpus;
|
|
||||||
int is_default;
|
|
||||||
int arch;
|
|
||||||
int minimum_page_bits;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* memory_region_allocate_system_memory - Allocate a board's main memory
|
* memory_region_allocate_system_memory - Allocate a board's main memory
|
||||||
* @mr: the #MemoryRegion to be initialized
|
* @mr: the #MemoryRegion to be initialized
|
||||||
|
@ -55,9 +42,6 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
|
||||||
const char *name,
|
const char *name,
|
||||||
uint64_t ram_size);
|
uint64_t ram_size);
|
||||||
|
|
||||||
void qemu_register_machine(struct uc_struct *uc, QEMUMachine *m, const char *type_machine,
|
|
||||||
void (*init)(struct uc_struct *uc, ObjectClass *oc, void *data));
|
|
||||||
|
|
||||||
#define TYPE_MACHINE_SUFFIX "-machine"
|
#define TYPE_MACHINE_SUFFIX "-machine"
|
||||||
|
|
||||||
/* Machine class name that needs to be used for class-name-based machine
|
/* Machine class name that needs to be used for class-name-based machine
|
||||||
|
@ -78,7 +62,6 @@ MachineClass *find_default_machine(struct uc_struct *uc, int arch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MachineClass:
|
* MachineClass:
|
||||||
* @qemu_machine: #QEMUMachine
|
|
||||||
* @minimum_page_bits:
|
* @minimum_page_bits:
|
||||||
* If non-zero, the board promises never to create a CPU with a page size
|
* If non-zero, the board promises never to create a CPU with a page size
|
||||||
* smaller than this, so QEMU can use a more efficient larger page
|
* smaller than this, so QEMU can use a more efficient larger page
|
||||||
|
|
|
@ -63,7 +63,6 @@ typedef struct Property Property;
|
||||||
typedef struct PropertyInfo PropertyInfo;
|
typedef struct PropertyInfo PropertyInfo;
|
||||||
typedef struct QEMUBH QEMUBH;
|
typedef struct QEMUBH QEMUBH;
|
||||||
typedef struct QEMUFile QEMUFile;
|
typedef struct QEMUFile QEMUFile;
|
||||||
typedef struct QEMUMachine QEMUMachine;
|
|
||||||
typedef struct QEMUSGList QEMUSGList;
|
typedef struct QEMUSGList QEMUSGList;
|
||||||
typedef struct QEMUSizedBuffer QEMUSizedBuffer;
|
typedef struct QEMUSizedBuffer QEMUSizedBuffer;
|
||||||
typedef struct QEMUTimer QEMUTimer;
|
typedef struct QEMUTimer QEMUTimer;
|
||||||
|
|
29
qemu/vl.c
29
qemu/vl.c
|
@ -176,32 +176,3 @@ void qemu_system_shutdown_request(void)
|
||||||
{
|
{
|
||||||
//shutdown_requested = 1;
|
//shutdown_requested = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void machine_class_init(struct uc_struct *uc, ObjectClass *oc, void *data)
|
|
||||||
{
|
|
||||||
MachineClass *mc = MACHINE_CLASS(uc, oc);
|
|
||||||
QEMUMachine *qm = data;
|
|
||||||
|
|
||||||
mc->init = qm->init;
|
|
||||||
mc->max_cpus = qm->max_cpus;
|
|
||||||
mc->is_default = qm->is_default;
|
|
||||||
mc->arch = qm->arch;
|
|
||||||
mc->minimum_page_bits = qm->minimum_page_bits;
|
|
||||||
}
|
|
||||||
|
|
||||||
void qemu_register_machine(struct uc_struct *uc, QEMUMachine *m, const char *type_machine,
|
|
||||||
void (*init)(struct uc_struct *uc, ObjectClass *oc, void *data))
|
|
||||||
{
|
|
||||||
char *name = g_strdup_printf(MACHINE_TYPE_NAME("%s"), m->name);
|
|
||||||
TypeInfo ti = {0};
|
|
||||||
ti.name = name;
|
|
||||||
ti.parent = type_machine;
|
|
||||||
ti.class_init = init;
|
|
||||||
ti.class_data = (void *)m;
|
|
||||||
|
|
||||||
if (init == NULL)
|
|
||||||
ti.class_init = machine_class_init;
|
|
||||||
|
|
||||||
type_register(uc, &ti);
|
|
||||||
g_free(name);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue