#include "tizen/src/ecs/ecs.h"
#include "tizen/src/util/error_handler.h"
#include "tizen/src/util/exported_strings.h"
-#include "tizen/src/debug_ch.h"
-
-DECLARE_DEBUG_CHANNEL(vl_main);
inline static bool is_maru_machine(MachineClass *mc) {
return g_str_has_prefix(mc->name, "maru");
# ifdef CONFIG_MARU
static bool set_maru_display_option(void) {
# ifdef CONFIG_QT
-if (dpy.type == DISPLAY_TYPE_MARU_QT) {
if (dpy.u.maru_qt.resolution != NULL) {
char *endptr = NULL;
// Resolution should be formed "640x480" or "640*480".
if (dpy.u.maru_qt.forcelegacy == true) {
maru_qt5_set_force_legacy(true);
}
-}
#endif // CONFIG_QT
return true;
error_report("VNC requires a display argument vnc=<display>");
exit(1);
}
-#ifdef CONFIG_MARU
- } else if (strstart(p, "maru_remote_spice", &opts)) {
-# ifdef CONFIG_SPICE
- dpy.type = DISPLAY_TYPE_MARU_REMOTE_SPICE;
-# else
- fprintf(stderr, "maru_remote_spice is disabled\n");
- exit(1);
-# endif //CONFIG_SPICE
-#endif /* CONFIG_MARU */
} else {
parse_display_qapi(p);
}
}
#if defined(CONFIG_MARU)
-// W/A for preserve larger continuous heap for RAM.
-extern void *preallocated_ram_ptr;
-extern int preallocated_ram_size;
// FIXME
extern bool nodisplay;
#endif //CONFIG_MARU
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
-#ifdef CONFIG_YAGL
- static bool yagl_enabled = false;
-#endif /* CONFIG_YAGL */
-#ifdef CONFIG_VIGS
- static bool vigs_enabled = false;
- static char *vigs_backend = NULL;
-#endif /* CONFIG_VIGS */
char *dir, **dirs;
const char *mem_path = NULL;
bool have_custom_ram_size;
olist = qemu_find_opts("machine");
qemu_opts_parse_noisily(olist, "accel=kvm", false);
break;
- case QEMU_OPTION_enable_yagl:
-#if defined(CONFIG_YAGL)
- yagl_enabled = true;
-#else
- fprintf(stderr, "YaGL openGLES passthrough support is disabled,"
- " ignoring -enable-yagl\n");
-#endif
- break;
- case QEMU_OPTION_enable_vigs:
-#if defined(CONFIG_VIGS)
- vigs_enabled = true;
-#else
- fprintf(stderr, "VIGS support is disabled,"
- " ignoring -enable-vigs\n");
-#endif
- break;
- case QEMU_OPTION_vigs_backend:
-#if defined(CONFIG_VIGS)
- vigs_backend = g_strdup(optarg);
-#else
- fprintf(stderr, "VIGS support is disabled,"
- " ignoring -vigs-backend\n");
-#endif
- break;
case QEMU_OPTION_M:
case QEMU_OPTION_machine:
olist = qemu_find_opts("machine");
machine_class = select_machine();
object_set_machine_compat_props(machine_class->compat_props);
-#if defined(CONFIG_MARU)
- if (is_maru_machine(machine_class)) {
- preallocated_ram_ptr = qemu_anon_ram_alloc(ram_size, NULL, true);
- if (preallocated_ram_ptr) {
- preallocated_ram_size = ram_size;
- }
- }
-#endif //CONFIG_MARU
-
have_custom_ram_size = set_memory_options(&ram_slots, &maxram_size,
machine_class);
"ignoring option");
}
#if defined(CONFIG_MARU)
- if (set_maru_display_option() == false) {
- error_report("-display maru_qt is failed to parse resolution option, "
+ if (dpy.type == DISPLAY_TYPE_MARU_QT) {
+ if (set_maru_display_option() == false) {
+ error_report("-display maru_qt is failed to parse resolution option, "
"ignoring option");
- }
+ }
+ } else if (dpy.type == DISPLAY_TYPE_NONE) {
+ nodisplay = true;
+ }
#endif //CONFIG_MARU
qemu_display_early_init(&dpy);
qemu_console_early_init();
current_machine->cpu_type = parse_cpu_option(cpu_option);
}
-#if defined(CONFIG_MARU)
- if (is_maru_machine(machine_class)) {
- kernel_cmdline = qemu_opt_get(machine_opts, "append");
- // Returned variable points different address from input variable.
- kernel_cmdline = prepare_maru(kernel_cmdline);
- qemu_opt_set(qemu_get_machine_opts(), "append",
- kernel_cmdline, &error_abort);
-
- current_machine->kernel_cmdline = (char *)kernel_cmdline;
- if (dpy.type == DISPLAY_TYPE_NONE) {
- nodisplay = true;
- }
- }
-#endif //CONFIG_MARU
-
if (current_machine->ram_memdev_id) {
Object *backend;
ram_addr_t backend_size;
}
}
+#if defined(CONFIG_MARU)
+ if (is_maru_machine(machine_class)) {
+ // Returned variable points different address from input variable.
+ kernel_cmdline = prepare_maru(kernel_cmdline);
+ qemu_opt_set(qemu_get_machine_opts(), "append",
+ kernel_cmdline, &error_abort);
+
+ current_machine->kernel_cmdline = (char *)kernel_cmdline;
+ }
+#endif //CONFIG_MARU
+
parse_numa_opts(current_machine);
if (machine_class->default_ram_id && current_machine->ram_size &&
prepare_maru_after_device_init();
}
#endif
-#ifdef CONFIG_VIGS
- // To support legacy VIGS options
- if (vigs_enabled) {
- PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
- if (pci_bus == NULL) {
- LOG_INFO("Failed to get PCI bus of VIGS\n");
- }
- PCIDevice *pci_dev = pci_create(pci_bus, -1, "vigs");
- if (pci_dev == NULL) {
- LOG_INFO("Failed to get PCI DEVICE of VIGS\n");
- }
- if (vigs_backend) {
- qdev_prop_set_string(&pci_dev->qdev, "backend", vigs_backend);
- } else {
- qdev_prop_set_string(&pci_dev->qdev, "backend", "gl");
- }
- qdev_prop_set_string(&pci_dev->qdev, "wsi", "wsi0");
- qdev_init_nofail(&pci_dev->qdev);
- }
-#endif
-#ifdef CONFIG_YAGL
- // To support legacy YaGL options
- if (yagl_enabled) {
- PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
- if (pci_bus == NULL) {
- LOG_INFO("Failed to get PCI bus of YAGL\n");
- }
- PCIDevice *pci_dev = pci_create(pci_bus, -1, "yagl");
- LOG_INFO("Failed to get PCI DEVICE of YAGL\n");
- if (vigs_enabled) {
- qdev_prop_set_string(&pci_dev->qdev, "wsi", "wsi0");
- }
- qdev_init_nofail(&pci_dev->qdev);
- }
-#endif
/* Did we create any drives that we failed to create a device for? */
drive_check_orphaned();
monitor_cleanup();
qemu_chr_cleanup();
user_creatable_cleanup();
+#if defined(CONFIG_MARU)
+ if (dpy.type == DISPLAY_TYPE_MARU_QT) {
+ maru_qt5_display_fini();
+ }
+#endif
/* TODO: unref root container, check all devices are ok */
}
// emulator log file
static const char *log_redirect_file = NULL;
-#ifdef CONFIG_WIN32
-// for checking Windows version
-extern OSVERSIONINFO osvi;
-#endif
-
const char *get_log_redirect_file(void)
{
int result = -1;
result = fcntl(STDOUT_FILENO, F_GETPATH, log_filename);
#elif defined(CONFIG_WIN32)
// works only vista or newer...
- if (osvi.dwMajorVersion >= 6) {
- char win32_log_filename_normalized[PATH_MAX];
- HANDLE handle_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
- DWORD ret = GetFinalPathNameByHandle(handle_stdout,
- win32_log_filename_normalized,
- PATH_MAX, FILE_NAME_NORMALIZED);
- // strip "\\?\"
- if (ret > 0) {
- g_stpcpy(log_filename, win32_log_filename_normalized + 4);
- result = 0;
- } else {
- result = -1;
- }
+ char win32_log_filename_normalized[PATH_MAX];
+ HANDLE handle_stdout = GetStdHandle(STD_OUTPUT_HANDLE);
+ DWORD ret = GetFinalPathNameByHandle(handle_stdout,
+ win32_log_filename_normalized,
+ PATH_MAX, FILE_NAME_NORMALIZED);
+ // strip "\\?\"
+ if (ret > 0) {
+ g_stpcpy(log_filename, win32_log_filename_normalized + 4);
+ result = 0;
+ } else {
+ result = -1;
}
#endif
if (log_redirect_file) {
g_free((void *)log_redirect_file);
+ log_redirect_file = NULL;
}
if (result >= 0) {