configure: ;
.PHONY: all clean cscope distclean html info install install-doc \
- pdf txt recurse-all dist msi FORCE
+ pdf txt recurse-all dist msi install-tools FORCE
$(call set-vpath, $(SRC_PATH))
install-includedir:
$(INSTALL_DIR) "$(DESTDIR)$(includedir)"
-install: all $(if $(BUILD_DOCS),install-doc) \
+install-tools: tools
+ $(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+ # qemu-ga is included in TOOLS, but we need special install rules for w32
+
+install: all $(if $(BUILD_DOCS),install-doc) $(if $(BUILD_TOOLS),install-tools) \
install-datadir install-localstatedir install-includedir \
$(if $(INSTALL_BLOBS),$(edk2-decompressed)) \
recurse-install
guest_agent_msi=""
vss_win32_sdk=""
win_sdk="no"
-want_tools="yes"
+want_tools=""
libiscsi=""
libnfs=""
coroutine=""
auth_pam=""
vte=""
virglrenderer=""
-tpm="yes"
+tpm=""
libssh=""
live_block_migration="yes"
numa=""
# for TIZEN-maru
maru="no"
-winver="0x600"
+winver="0x0600"
libav=""
libpng="no"
dxva2=""
else
audio_drv_list=""
fi
+ QEMU_INCLUDES="-I\$(SRC_PATH)/hosts/w32/include $QEMU_INCLUDES"
supported_os="yes"
pie="no"
;;
--enable-libpng enable png library
--enable-dxva2 enable dxva2 support
--disable-dxva2 disable dxva2 support
- --ensable-vaapi enable vaapi support
+ --enable-vaapi enable vaapi support
--disable-vaapi disable vaapi support
--extension-path=PATH set extension path
fi
fi
if test "$softmmu" = yes ; then
- if test "$virtfs" != no; then
- if test "$cap_ng" = yes && test "$linux" = yes && test "$attr" = yes ; then
+ if test "$linux" = yes; then
+ if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
virtfs=yes
tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
- elif test "$maru" = yes && test "$darwin" = yes ; then
- echo "Enable VirtFS on Darwin"
- virtfs=yes
- elif test "$maru" = yes && test "$mingw32" = yes ; then
- echo "Enable VirtFS on Windows"
- virtfs=yes
else
if test "$virtfs" = yes; then
error_exit "VirtFS requires libcap-ng devel and libattr devel"
mpath=no
fi
tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+ elif test "$maru" = yes && test "$darwin" = yes ; then
+ echo "Enable VirtFS on Darwin"
+ virtfs=yes
+ elif test "$maru" = yes && test "$mingw32" = yes ; then
+ echo "Enable VirtFS on Windows"
+ #virtfs=yes TODO : can;t do this shit now
+ virtfs=no
else
if test "$virtfs" = yes; then
error_exit "VirtFS is supported only on Linux"
#include "sysemu/qtest.h"
#include "qemu/xxhash.h"
#include <math.h>
-#include <linux/limits.h>
int open_fd_hw;
int total_open_fd;
#include <dirent.h>
#include <utime.h>
+
+#if !defined(CONFIG_MARU) || !defined(CONFIG_WIN32)
#include <sys/resource.h>
+#endif
+
#include "fsdev/file-op-9p.h"
#include "fsdev/9p-iov-marshal.h"
#include "qemu/thread.h"
#define FID_NON_RECLAIMABLE 0x2
static inline char *rpath(FsContext *ctx, const char *path)
{
+#if defined(CONFIG_MARU) && defined(CONFIG_WIN32)
+ char *buffer;
+ unsigned int len;
+
+ buffer = g_strdup_printf("%s\\%s", ctx->fs_root, path);
+ len = strlen(buffer);
+
+ // TODO : need to remove backslash??
+ while (len && buffer[len-1] == '\\') {
+ if (len > 1 && buffer[len-2] == ':') {
+ return buffer;
+ }
+ buffer[--len] = '\0';
+
+ }
+ return buffer;
+#else
return g_strdup_printf("%s/%s", ctx->fs_root, path);
+#endif
}
/*
*
*/
-#include <QGuiApplication>
-#include <QOpenGLContext>
-#include <qpa/qplatformnativeinterface.h>
-#include "vigs_qt5.h"
extern "C" {
#define QObject qemu_QObject
#undef QList
}
+#include <QGuiApplication>
+#include <QOpenGLContext>
+#include <qpa/qplatformnativeinterface.h>
+#include "vigs_qt5.h"
+
extern bool qt5IsOnscreen;
extern QApplication *qt5App;
extern QOpenGLContext *qt5GLContext;
#ifdef CONFIG_LIBATTR
# include <attr/xattr.h>
#else
+#ifndef ENOATTR
# define ENOATTR ENODATA
+#endif
+# ifdef CONFIG_MARU
+# ifndef CONFIG_WIN32
# include <sys/xattr.h>
+# endif
+# endif
#endif
#endif
--- /dev/null
+#ifndef VSYSCALL_H
+#define VSYSCALL_H
+
+/* This is based on asm/syscall.h in kernel 2.6.29. */
+
+enum vsyscall_num {
+ __NR_vgettimeofday,
+ __NR_vtime,
+ __NR_vgetcpu,
+};
+
+#define TARGET_VSYSCALL_START (-10UL << 20)
+#define TARGET_VSYSCALL_SIZE 1024
+#define TARGET_VSYSCALL_END (-2UL << 20)
+#define TARGET_VSYSCALL_MAPPED_PAGES 1
+#define TARGET_VSYSCALL_ADDR(vsyscall_nr) \
+ (TARGET_VSYSCALL_START+TARGET_VSYSCALL_SIZE*(vsyscall_nr))
+
+#endif /* !VSYSCALL_H */
export PATH=/opt/mingw32/bin:$PATH
export CROSS_PREFIX=i686-w64-mingw32
else
- export PATH=/opt/mingw64/bin:$PATH
+ export PATH=/usr/x86_64-w64-mingw32/bin:$PATH
export CROSS_PREFIX=x86_64-w64-mingw32
fi
ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
override CFLAGS += -O2
endif
-override CFLAGS += -march=i486 #-fcf-protection=none
+override CFLAGS += -march=i486 -fcf-protection=none
# Drop -fstack-protector and the like
QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding
%.o: %.dtrace
$(call quiet-command,dtrace -o $@ -G -s $<,"GEN","$(TARGET_DIR)$@")
+ifdef CONFIG_WIN32
+DSO_OBJ_CFLAGS := -DBUILD_DSO
+else
DSO_OBJ_CFLAGS := -fPIC -DBUILD_DSO
+endif
module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
%$(DSOSUF): QEMU_LDFLAGS += $(LDFLAGS_SHARED)
%$(DSOSUF): %.mo
mkdir -p ./tizen_test_binaries/
UNZIP_PATH=`which unzip`
- if $UNZIP_PATH==""
- then
+ if $UNZIP_PATH==""; then
echo "Install unzip utility"
echo "sudo apt install unzip"
exit
--extra-ldflags=-static-libstdc++
--audio-drv-list=dsound
--winver=0x0600
- --enable-sdl
--enable-hax"
# append platform specific options
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "hw/qdev.h"
+#include "sysemu/runstate.h"
#include "net/net.h"
#include "ui/console.h"
#include "hw/virtio/maru_virtio_sensor.h"
#include "hw/virtio/maru_virtio_nfc.h"
+#ifndef _WIN32
+#include <sys/ioctl.h>
+#endif
+
#include "debug_ch.h"
MULTI_DEBUG_CHANNEL(qemu, ecs);
return 0;
}
+
+
+void ecs_qemu_system_reset_request(void) {
+ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+}
#ifndef __ECS_H__
#define __ECS_H__
-#include "emulator_common.h"
-
#define COMMANDS_TYPE "type"
#define COMMANDS_DATA "data"
#define NFC_MAX_BUF_SIZE 4096
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct nfc_msg_info {
unsigned char client_id;
unsigned char client_type;
ECS_SYSTEM_ACTION_REBOOT
};
+void ecs_qemu_system_reset_request(void);
+
void send_shutdown_request(int action);
void make_send_device_ntf(char *cmd, int group, int action, char *data);
/* Device capabilities check */
const char* ecs_get_device_capabilities(void);
void ecs_set_device_capabilities(const char* cap);
-
+#ifdef __cplusplus
+}
+#endif
#endif /* __ECS_H__ */
* - S-Core Co., Ltd
*
*/
-
+#include "emulator_common.h"
#include "ecs.h"
#include "ecs_internal.h"
#include "ecs_sensor.h"
#include "emulator_common.h"
#include "qemu/thread.h"
+#ifdef CONFIG_VIRTFS
#include "fsdev/qemu-fsdev.h"
+#endif
#include "emul_state.h"
#include "ecs.h"
#include "ecs_hds.h"
*
*/
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-
+#include "emulator_common.h"
#include "ecs.h"
#include "ecs_internal.h"
*
*/
+#include "emulator_common.h"
#include "ecs.h"
#include "ecs_internal.h"
#include "ecs_sensor.h"
}
if (!launch_conf_file && qemu_arg_index == 0) {
- char *executable = basename(argv[0]);
+ char *executable = g_path_get_basename(argv[0]);
fprintf(stderr, "Usage: %s {-c|--conf} conf_file [--<key> <value>]...\n"
" %*s [{-q|--qemu} <QEMU_ARGS>...]\n",
executable, (int)strlen(executable), "");
#ifndef __WIN32
#include <sys/ioctl.h>
-#else
-#define EISCONN WSAEISCONN
-#define EALREADY WSAEALREADY
#endif
static void end_eventcast_socket(int sockfd);
static void set_eventcast_connection_status(int status);
-#if 0
-static void set_eventcast_app_state(bool state);
-static bool get_eventcast_app_state(void);
-#endif
static bool is_notifier = false;
*
*/
-#include "qemu/osdep.h"
+#include "emulator_common.h"
#include "qemu/thread.h"
#include "exec/memory.h"
#include "exec/memory-internal.h"
#include "tizen/src/emulator.h"
#include "qemu/config-file.h"
#include "qemu/main-loop.h"
-#include "qemu-common.h"
#include "qapi/qmp/qdict.h"
#include "hw/maru_device_ids.h"
#include "hw/qdev-properties.h"
#include "maru_tuner.h"
#include "ecs/ecs.h"
#include "util/new_debug_ch.h"
+#include <pthread.h>
DECLARE_DEBUG_CHANNEL(tuner);
TIZEN_UI = $(SRC_PATH)/tizen/src/ui
obj-$(CONFIG_QT) += qt5.o
-qt5.o-cflags += $(QEMU_CFLAGS) $(QT_CFLAGS) -I$(TIZEN_UI)
+qt5.o-cflags += $(QT_CFLAGS) -I$(TIZEN_UI)
QEMU_CXXFLAGS += -I$(TIZEN_UI) -I$(TIZEN_SRC) $(QEMU_INCLUDES) $(QT_CFLAGS) -Wno-expansion-to-defined
extern "C" {
#define QObject qemu_QObject
#define QList qemu_QList
+#define bind qemu_bind
//declare _Static_assert as there is none for cpp file in qemu
#define _Static_assert(x , msg) //Q_ASSERT_X(x , "tizen/ui/displayglwidget.o", msg)
#include "qemu/osdep.h"
#include "qemu/thread.h"
#undef QObject
#undef QList
+#undef bind
}
#include <QtOpenGL>
#include "displayswwidget.h"
#include "input/multitouchtracker.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"
#include "emul_state.h"
-#undef QObject
-#undef QList
-};
DisplaySWWidget::DisplaySWWidget(QWidget *parent,
DisplayType *displayForm, QSize resolution, qreal scaleFactor) :
#ifndef DISPLAYSWWIDGET_H
#define DISPLAYSWWIDGET_H
-#include <QtWidgets>
-
#include "displaybase.h"
+#include <QPainter>
class DisplaySWWidget : public QLabel,
public DisplayBase
*
*/
+#include "uiutil.h"
#include "mainwindow.h"
#include "generalskinview.h"
#include "phoneshapeskinview.h"
#include "displayglwidget.h"
#include "displayswwidget.h"
#include "resource/ui_strings.h"
-#include "uiutil.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator.h"
#include "util/ui_operations.h"
#include "qt5_supplement.h"
-#undef QObject
-#undef QList
+
+extern "C" {
+extern void qemu_system_graceful_shutdown_request(unsigned int sec);
}
MainWindow::MainWindow(UiInformation *uiInfo, bool useGL, QWidget *parent) :
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include <QWidget>
-
#include "menu/contextmenu.h"
#include "mainview.h"
#include "displaybase.h"
* - S-Core Co., Ltd
*
*/
-
+#include "config-host.h"
#include "contextmenu.h"
#include "resource/ui_strings.h"
#include "mainwindow.h"
#include "uiutil.h"
#include "menu/advancedmenuitem.h"
#include "menu/scalemenuitem.h"
+#include "ecs/ecs.h"
#include "emul_state.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "util/osutil.h"
-#include "util/net_helper.h"
#include "util/device_hotplug.h"
#include "util/ui_operations.h"
-#include "sysemu/runstate.h"
-#include "ecs/ecs.h"
-#undef QObject
-#undef QList
-}
+#include "util/net_helper.h"
+#include "util/osutil.h"
ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
{
void ContextMenu::slotDeviceReset()
{
qDebug("System reset request.");
- qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+ ecs_qemu_system_reset_request();
qDebug("Done for system reset request.");
}
#ifndef CONTEXTMENU_H
#define CONTEXTMENU_H
-#include <QtWidgets>
-
#include "detailedinfodialog.h"
#include "aboutdialog.h"
#include "screenshotdialog.h"
#include "sdbhelper.h"
#include "sdbhelperthread.h"
#include "resource/ui_strings.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"
#include "emul_state.h"
#include "util/net_helper.h"
-#undef QObject
-#undef QList
-}
+#include "glib-compat.h"
SdbHelper::SdbHelper(MainWindow *parent, DisplayBase *displaybase)
{
#include "sdbhelper.h"
#include "displaybase.h"
#include "resource/ui_strings.h"
-
-extern "C" {
#include "emul_state.h"
-}
SdbHelperThread::SdbHelperThread(SdbHelper *parent)
{
#include "displaybase.h"
#include "util/new_debug_ch.h"
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"
#include "emul_state.h"
#include "emulator_options.h"
-#undef QObject
-#undef QList
-}
+#include "glib-compat.h"
// XXX: all modules in ui/* are controlled by channel name "qt5_ui"
DECLARE_DEBUG_CHANNEL(qt5_ui);
QTextStream out(stdout);
out.setFieldAlignment(QTextStream::AlignRight);
out << qSetFieldWidth(12) << timestamp;
- out << qSetFieldWidth(1) << "|";
- out << qSetFieldWidth(5) << qemu_get_thread_id();
- out << qSetFieldWidth(1) << "|";
out << qSetFieldWidth(1) << typeChar;
out << qSetFieldWidth(1) << "|";
out << qSetFieldWidth(10) << path;
#include "new_debug_ch.h"
#include "sysemu/runstate.h"
+#ifdef _WIN32
+//#include <ws2tcpip.h>
+#else /* !_WIN32 */
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#endif /* !_WIN32 */
+
DECLARE_DEBUG_CHANNEL(net_helper);
#define BUF_SIZE 64
#ifndef SDB_SERVER_H_
#define SDB_SERVER_H_
-#include <errno.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else /* !_WIN32 */
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#endif /* !_WIN32 */
-
-
#define SDB_HOST_PORT 26099
#define START_VM_BASE_PORT 26100
}
}
+static inline int get_timeofday(char *buf, size_t size)
+{
+ qemu_timeval tv;
+ time_t ti;
+ struct tm *ptm = NULL;
+ int ret;
+
+ qemu_gettimeofday(&tv);
+ ti = tv.tv_sec;
+
+ /* In this case, localtime_r() function is not necessary. */
+ ptm = localtime(&ti);
+ ret = strftime(buf, size, "%H:%M:%S", ptm);
+
+ return ret + g_snprintf(buf + ret, size - ret, ".%03ld", (long)tv.tv_usec/1000);
+}
+
int dbg_log(enum _debug_class cls, struct _debug_channel *channel,
int line, const char *format, ...)
{
@brief Collection of utilities for linux
*/
+#include <stdbool.h>
#include <linux/version.h>
#include <sys/utsname.h>
#include <sys/sysinfo.h>
@brief Collection of utilities for win32
*/
-#include <windows.h>
-
-#include "png.h"
-
#include "qemu/osdep.h"
#include "qemu-common.h"
+#include <glib/gprintf.h>
#include "qemu/error-report.h"
+#include "png.h"
#include "osutil.h"
#include "emulator.h"
#include "emul_state.h"
#ifndef __OSUTIL_H__
#define __OSUTIL_H__
-#include "emulator_common.h"
+#include "glib-compat.h"
#define ERR_SUCCESS 0
#define ERR_NODEV 4 /* ACT_SDCARD_DETACH_FAIL. No sdcard attached. */
void print_system_info_os(void);
int get_number_of_processors(void);
-static inline int get_timeofday(char *buf, size_t size)
-{
- qemu_timeval tv;
- time_t ti;
- struct tm *ptm = NULL;
- int ret;
-
- qemu_gettimeofday(&tv);
- ti = tv.tv_sec;
-
- /* In this case, localtime_r() function is not necessary. */
- ptm = localtime(&ti);
- ret = strftime(buf, size, "%H:%M:%S", ptm);
-
- return ret + g_snprintf(buf + ret, size - ret, ".%03ld", (long)tv.tv_usec/1000);
-}
-
static inline void get_java_path(const char **java_path)
{
#ifdef CONFIG_WIN32
ifdef CONFIG_QT
EMUL_DIR=../emulator
+BUILD_DIR=../..
+
COMMON_FLAGS=$(QT_CFLAGS) $(QEMU_INCLUDES) $(libs_softmmu) -DQT_NO_OPENGL -lstdc++
# for building qt5_msgbox
$(TARGET_EXE): $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.cpp
ifdef CONFIG_WIN32
- $(shell $(WINDRES) $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.rc -O coff -o qt5_msgbox.res)
+ $(shell $(WINDRES) $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.rc -I$(BUILD_DIR) -O coff -o qt5_msgbox.res)
$(CXX) -o $(TARGET_EXE) qt5_msgbox.res $< $(COMMON_FLAGS)
endif
ifdef CONFIG_DARWIN
-#include "../../config-host.h"
+#include "config-host.h"
#ifdef CONFIG_MARU
ID_ICON ICON "../src/ui/resource/icons/emulator_icon.ico"