@@ -1061,7 +1061,11 @@ int audio_available(void)
int tcg_available(void)
{
+#if defined(CONFIG_TCG)
return 1;
+#else
+ return 0;
+#endif
}
int kvm_available(void)
@@ -615,6 +615,7 @@ static void code_gen_alloc(unsigned long tb_size)
size. */
void tcg_exec_init(unsigned long tb_size)
{
+ tcg_allowed = 1;
cpu_gen_init();
code_gen_alloc(tb_size);
code_gen_ptr = code_gen_buffer;
@@ -627,11 +628,6 @@ void tcg_exec_init(unsigned long tb_size)
#endif
}
-bool tcg_enabled(void)
-{
- return code_gen_buffer != NULL;
-}
-
void cpu_exec_init_all(void)
{
#if !defined(CONFIG_USER_ONLY)
@@ -301,8 +301,14 @@ typedef struct PCIHostDeviceAddress {
unsigned int function;
} PCIHostDeviceAddress;
+extern int tcg_allowed;
void tcg_exec_init(unsigned long tb_size);
-bool tcg_enabled(void);
+
+#ifdef CONFIG_TCG
+#define tcg_enabled() (tcg_allowed)
+#else
+#define tcg_enabled() 0
+#endif
void cpu_exec_init_all(void);
@@ -260,7 +260,7 @@ static NotifierList exit_notifiers =
static NotifierList machine_init_done_notifiers =
NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
-static int tcg_allowed = 1;
+int tcg_allowed = 0;
int kvm_allowed = 0;
int xen_allowed = 0;
uint32_t xen_domid;