return ret;
}
-int hax_accel_init(uint64_t ram_size)
+static int hax_init(MachineState *ms)
{
struct hax_state *hax = NULL;
int ret = 0;
+ uint64_t ram_size =
+ qemu_opt_get_number(qemu_find_opts_singleton("memory"), "size");
hax = &hax_global;
memset(hax, 0, sizeof(struct hax_state));
}
*/
+ if (!ret && !hax_ug_platform()) {
+ // TCG is used for very limited purpose under HAX.
+ // so we can allocate small TB buffer.
+ tcg_exec_init(16 * 1024 * 1024);
+ }
+
return ret;
}
}
}
+#define TYPE_HAX_ACCEL ACCEL_CLASS_NAME("hax")
+
+static void hax_accel_class_init(ObjectClass *oc, void *data)
+{
+ AccelClass *ac = ACCEL_CLASS(oc);
+ ac->name = "HAX";
+ ac->init_machine = hax_init;
+ ac->allowed = &hax_allowed;
+}
+
+static const TypeInfo hax_accel_type = {
+ .name = TYPE_HAX_ACCEL,
+ .parent = TYPE_ACCEL,
+ .class_init = hax_accel_class_init,
+// .instance_size = sizeof(hax_state),
+};
+
+static void hax_type_init(void)
+{
+ type_register_static(&hax_accel_type);
+}
+
+type_init(hax_type_init);