From 1bed96cdfe002563febcd22acb46f9711d6c0f9e Mon Sep 17 00:00:00 2001 From: "varinder.p" Date: Sat, 2 Apr 2022 18:39:36 +0530 Subject: [PATCH] Fixed headers to build for windows-64 but without virtfs. Change-Id: Ibd750818ff0eeb0f306e3d5bc224b789b75d8523 Signed-off-by: varinder.p --- Makefile | 8 ++++++-- configure | 26 ++++++++++++++------------ hw/9pfs/9p.c | 1 - hw/9pfs/9p.h | 22 ++++++++++++++++++++++ hw/vigs/vigs_qt5.cpp | 9 +++++---- include/qemu/xattr.h | 6 ++++++ linux-user/x86_64/vsyscall.h | 19 +++++++++++++++++++ package/build.linux | 2 +- pc-bios/optionrom/Makefile | 2 +- rules.mak | 4 ++++ test_tizen_emulator.sh | 3 +-- tizen/emulator_configure.sh | 1 - tizen/src/ecs/ecs.c | 10 ++++++++++ tizen/src/ecs/ecs.h | 12 +++++++++--- tizen/src/ecs/ecs_eventcast.c | 2 +- tizen/src/ecs/ecs_hds.c | 2 ++ tizen/src/ecs/ecs_nfc.c | 4 +--- tizen/src/ecs/ecs_sensor.c | 1 + tizen/src/emulator.c | 2 +- tizen/src/eventcast/common.c | 7 ------- tizen/src/hw/pci/maru_tuner.c | 4 ++-- tizen/src/ui/Makefile.objs | 2 +- tizen/src/ui/displayglwidget.cpp | 2 ++ tizen/src/ui/displayswwidget.cpp | 8 -------- tizen/src/ui/displayswwidget.h | 3 +-- tizen/src/ui/mainwindow.cpp | 12 ++++-------- tizen/src/ui/mainwindow.h | 2 -- tizen/src/ui/menu/contextmenu.cpp | 18 +++++------------- tizen/src/ui/menu/contextmenu.h | 2 -- tizen/src/ui/menu/sdbhelper.cpp | 9 +-------- tizen/src/ui/menu/sdbhelperthread.cpp | 3 --- tizen/src/ui/qt5_supplement.cpp | 11 +---------- tizen/src/util/net_helper.c | 8 ++++++++ tizen/src/util/net_helper.h | 17 ----------------- tizen/src/util/new_debug_ch.c | 17 +++++++++++++++++ tizen/src/util/osutil-linux.c | 1 + tizen/src/util/osutil-win32.c | 6 ++---- tizen/src/util/osutil.h | 19 +------------------ tizen/standalone-src/Makefile | 4 +++- tizen/standalone-src/qt5_msgbox.rc | 2 +- 40 files changed, 154 insertions(+), 139 deletions(-) create mode 100644 linux-user/x86_64/vsyscall.h diff --git a/Makefile b/Makefile index 8a9113e666..4b03ed08c0 100644 --- a/Makefile +++ b/Makefile @@ -329,7 +329,7 @@ Makefile: ; 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)) @@ -927,7 +927,11 @@ ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 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 diff --git a/configure b/configure index d9730ab9f4..62818fc2aa 100755 --- a/configure +++ b/configure @@ -462,7 +462,7 @@ guest_agent_ntddscsi="no" guest_agent_msi="" vss_win32_sdk="" win_sdk="no" -want_tools="yes" +want_tools="" libiscsi="" libnfs="" coroutine="" @@ -490,7 +490,7 @@ qemu_private_xts="yes" auth_pam="" vte="" virglrenderer="" -tpm="yes" +tpm="" libssh="" live_block_migration="yes" numa="" @@ -528,7 +528,7 @@ libtizenusb="no" # for TIZEN-maru maru="no" -winver="0x600" +winver="0x0600" libav="" libpng="no" dxva2="" @@ -830,6 +830,7 @@ MINGW32*) else audio_drv_list="" fi + QEMU_INCLUDES="-I\$(SRC_PATH)/hosts/w32/include $QEMU_INCLUDES" supported_os="yes" pie="no" ;; @@ -1973,7 +1974,7 @@ TIZEN-maru options: --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 @@ -6692,16 +6693,10 @@ if test "$want_tools" = "yes" ; then 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" @@ -6717,6 +6712,13 @@ if test "$softmmu" = yes ; then 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" diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 1b729af6e8..63529724ca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -28,7 +28,6 @@ #include "sysemu/qtest.h" #include "qemu/xxhash.h" #include -#include int open_fd_hw; int total_open_fd; diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h index 656527beb9..b4d6c4f6b3 100644 --- a/hw/9pfs/9p.h +++ b/hw/9pfs/9p.h @@ -3,7 +3,11 @@ #include #include + +#if !defined(CONFIG_MARU) || !defined(CONFIG_WIN32) #include +#endif + #include "fsdev/file-op-9p.h" #include "fsdev/9p-iov-marshal.h" #include "qemu/thread.h" @@ -119,7 +123,25 @@ typedef enum P9ProtoVersion { #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 } /* diff --git a/hw/vigs/vigs_qt5.cpp b/hw/vigs/vigs_qt5.cpp index 223210d862..91b743ee92 100644 --- a/hw/vigs/vigs_qt5.cpp +++ b/hw/vigs/vigs_qt5.cpp @@ -27,10 +27,6 @@ * */ -#include -#include -#include -#include "vigs_qt5.h" extern "C" { #define QObject qemu_QObject @@ -40,6 +36,11 @@ extern "C" { #undef QList } +#include +#include +#include +#include "vigs_qt5.h" + extern bool qt5IsOnscreen; extern QApplication *qt5App; extern QOpenGLContext *qt5GLContext; diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h index a83fe8e749..99862735dc 100644 --- a/include/qemu/xattr.h +++ b/include/qemu/xattr.h @@ -22,8 +22,14 @@ #ifdef CONFIG_LIBATTR # include #else +#ifndef ENOATTR # define ENOATTR ENODATA +#endif +# ifdef CONFIG_MARU +# ifndef CONFIG_WIN32 # include +# endif +# endif #endif #endif diff --git a/linux-user/x86_64/vsyscall.h b/linux-user/x86_64/vsyscall.h new file mode 100644 index 0000000000..11dcc07a39 --- /dev/null +++ b/linux-user/x86_64/vsyscall.h @@ -0,0 +1,19 @@ +#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 */ diff --git a/package/build.linux b/package/build.linux index e8231546bb..066e059b29 100755 --- a/package/build.linux +++ b/package/build.linux @@ -18,7 +18,7 @@ prepare() 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 diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index cbc425d6f2..542bb6bf87 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -13,7 +13,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom) 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 diff --git a/rules.mak b/rules.mak index 694865b63e..ea1a86b59b 100644 --- a/rules.mak +++ b/rules.mak @@ -103,7 +103,11 @@ LINK = $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@ \ %.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 diff --git a/test_tizen_emulator.sh b/test_tizen_emulator.sh index 9f9c132af1..8a6de7b83c 100755 --- a/test_tizen_emulator.sh +++ b/test_tizen_emulator.sh @@ -14,8 +14,7 @@ test() 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 diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index fd684630fe..d31e1cc6ae 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -154,7 +154,6 @@ CONFIGURE_APPEND_WIN=" --extra-ldflags=-static-libstdc++ --audio-drv-list=dsound --winver=0x0600 - --enable-sdl --enable-hax" # append platform specific options diff --git a/tizen/src/ecs/ecs.c b/tizen/src/ecs/ecs.c index f675b6abcf..501dc34bef 100644 --- a/tizen/src/ecs/ecs.c +++ b/tizen/src/ecs/ecs.c @@ -39,6 +39,7 @@ #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" @@ -49,6 +50,10 @@ #include "hw/virtio/maru_virtio_sensor.h" #include "hw/virtio/maru_virtio_nfc.h" +#ifndef _WIN32 +#include +#endif + #include "debug_ch.h" MULTI_DEBUG_CHANNEL(qemu, ecs); @@ -994,3 +999,8 @@ int start_ecs(void) return 0; } + + +void ecs_qemu_system_reset_request(void) { + qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); +} diff --git a/tizen/src/ecs/ecs.h b/tizen/src/ecs/ecs.h index 72dbc3f222..7f862d211a 100644 --- a/tizen/src/ecs/ecs.h +++ b/tizen/src/ecs/ecs.h @@ -32,8 +32,6 @@ #ifndef __ECS_H__ #define __ECS_H__ -#include "emulator_common.h" - #define COMMANDS_TYPE "type" #define COMMANDS_DATA "data" @@ -59,6 +57,10 @@ #define NFC_MAX_BUF_SIZE 4096 +#ifdef __cplusplus +extern "C" { +#endif + typedef struct nfc_msg_info { unsigned char client_id; unsigned char client_type; @@ -78,6 +80,8 @@ enum ecs_system_action { 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); @@ -97,5 +101,7 @@ void ecs_suspend_lock_state(int state); /* Device capabilities check */ const char* ecs_get_device_capabilities(void); void ecs_set_device_capabilities(const char* cap); - +#ifdef __cplusplus +} +#endif #endif /* __ECS_H__ */ diff --git a/tizen/src/ecs/ecs_eventcast.c b/tizen/src/ecs/ecs_eventcast.c index 3aee525037..a118e4e778 100644 --- a/tizen/src/ecs/ecs_eventcast.c +++ b/tizen/src/ecs/ecs_eventcast.c @@ -26,7 +26,7 @@ * - S-Core Co., Ltd * */ - +#include "emulator_common.h" #include "ecs.h" #include "ecs_internal.h" #include "ecs_sensor.h" diff --git a/tizen/src/ecs/ecs_hds.c b/tizen/src/ecs/ecs_hds.c index 339ddd15cb..da4bb1b2b6 100644 --- a/tizen/src/ecs/ecs_hds.c +++ b/tizen/src/ecs/ecs_hds.c @@ -29,7 +29,9 @@ #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" diff --git a/tizen/src/ecs/ecs_nfc.c b/tizen/src/ecs/ecs_nfc.c index c37936b92c..fe2bfd0308 100644 --- a/tizen/src/ecs/ecs_nfc.c +++ b/tizen/src/ecs/ecs_nfc.c @@ -27,9 +27,7 @@ * */ -#include "qemu/osdep.h" -#include "qemu-common.h" - +#include "emulator_common.h" #include "ecs.h" #include "ecs_internal.h" diff --git a/tizen/src/ecs/ecs_sensor.c b/tizen/src/ecs/ecs_sensor.c index 3ddcd75b7d..0d030b70e5 100644 --- a/tizen/src/ecs/ecs_sensor.c +++ b/tizen/src/ecs/ecs_sensor.c @@ -29,6 +29,7 @@ * */ +#include "emulator_common.h" #include "ecs.h" #include "ecs_internal.h" #include "ecs_sensor.h" diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index bfe3d62480..27b8d9f4f4 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -295,7 +295,7 @@ static int emulator_main(int argc, char *argv[], char **envp) } 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 [-- ]...\n" " %*s [{-q|--qemu} ...]\n", executable, (int)strlen(executable), ""); diff --git a/tizen/src/eventcast/common.c b/tizen/src/eventcast/common.c index 6672e65f05..7e4179f69e 100644 --- a/tizen/src/eventcast/common.c +++ b/tizen/src/eventcast/common.c @@ -45,9 +45,6 @@ #ifndef __WIN32 #include -#else -#define EISCONN WSAEISCONN -#define EALREADY WSAEALREADY #endif @@ -104,10 +101,6 @@ static eventcast_recv_buf recv_buf; 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; diff --git a/tizen/src/hw/pci/maru_tuner.c b/tizen/src/hw/pci/maru_tuner.c index f9ec9e01b9..5c48dd0610 100644 --- a/tizen/src/hw/pci/maru_tuner.c +++ b/tizen/src/hw/pci/maru_tuner.c @@ -27,14 +27,13 @@ * */ -#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" @@ -42,6 +41,7 @@ #include "maru_tuner.h" #include "ecs/ecs.h" #include "util/new_debug_ch.h" +#include DECLARE_DEBUG_CHANNEL(tuner); diff --git a/tizen/src/ui/Makefile.objs b/tizen/src/ui/Makefile.objs index 786e1cf987..220a6bfddb 100644 --- a/tizen/src/ui/Makefile.objs +++ b/tizen/src/ui/Makefile.objs @@ -2,7 +2,7 @@ TIZEN_SRC = $(SRC_PATH)/tizen/src 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 diff --git a/tizen/src/ui/displayglwidget.cpp b/tizen/src/ui/displayglwidget.cpp index a9d33929ca..aeded3e09d 100644 --- a/tizen/src/ui/displayglwidget.cpp +++ b/tizen/src/ui/displayglwidget.cpp @@ -32,12 +32,14 @@ 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 diff --git a/tizen/src/ui/displayswwidget.cpp b/tizen/src/ui/displayswwidget.cpp index 3f16cd2185..72b7e2fef5 100644 --- a/tizen/src/ui/displayswwidget.cpp +++ b/tizen/src/ui/displayswwidget.cpp @@ -31,15 +31,7 @@ #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) : diff --git a/tizen/src/ui/displayswwidget.h b/tizen/src/ui/displayswwidget.h index 01dc7876dd..037205814e 100644 --- a/tizen/src/ui/displayswwidget.h +++ b/tizen/src/ui/displayswwidget.h @@ -32,9 +32,8 @@ #ifndef DISPLAYSWWIDGET_H #define DISPLAYSWWIDGET_H -#include - #include "displaybase.h" +#include class DisplaySWWidget : public QLabel, public DisplayBase diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp index 0dcad5206f..469a7ef77d 100644 --- a/tizen/src/ui/mainwindow.cpp +++ b/tizen/src/ui/mainwindow.cpp @@ -31,6 +31,7 @@ * */ +#include "uiutil.h" #include "mainwindow.h" #include "generalskinview.h" #include "phoneshapeskinview.h" @@ -38,16 +39,11 @@ #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) : diff --git a/tizen/src/ui/mainwindow.h b/tizen/src/ui/mainwindow.h index 84159c7cae..9d09ed3fc8 100644 --- a/tizen/src/ui/mainwindow.h +++ b/tizen/src/ui/mainwindow.h @@ -34,8 +34,6 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include - #include "menu/contextmenu.h" #include "mainview.h" #include "displaybase.h" diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index e4051c0bfe..56f9a17936 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -28,27 +28,19 @@ * - 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) { @@ -1184,7 +1176,7 @@ void ContextMenu::slotAbout() 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."); } diff --git a/tizen/src/ui/menu/contextmenu.h b/tizen/src/ui/menu/contextmenu.h index 3fad2cac42..1a1088c850 100644 --- a/tizen/src/ui/menu/contextmenu.h +++ b/tizen/src/ui/menu/contextmenu.h @@ -32,8 +32,6 @@ #ifndef CONTEXTMENU_H #define CONTEXTMENU_H -#include - #include "detailedinfodialog.h" #include "aboutdialog.h" #include "screenshotdialog.h" diff --git a/tizen/src/ui/menu/sdbhelper.cpp b/tizen/src/ui/menu/sdbhelper.cpp index a8e386eb44..03a647385a 100644 --- a/tizen/src/ui/menu/sdbhelper.cpp +++ b/tizen/src/ui/menu/sdbhelper.cpp @@ -33,16 +33,9 @@ #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) { diff --git a/tizen/src/ui/menu/sdbhelperthread.cpp b/tizen/src/ui/menu/sdbhelperthread.cpp index 1d68109224..801b6c8643 100644 --- a/tizen/src/ui/menu/sdbhelperthread.cpp +++ b/tizen/src/ui/menu/sdbhelperthread.cpp @@ -32,10 +32,7 @@ #include "sdbhelper.h" #include "displaybase.h" #include "resource/ui_strings.h" - -extern "C" { #include "emul_state.h" -} SdbHelperThread::SdbHelperThread(SdbHelper *parent) { diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp index 63b35de3b4..4f89ddabd1 100644 --- a/tizen/src/ui/qt5_supplement.cpp +++ b/tizen/src/ui/qt5_supplement.cpp @@ -41,15 +41,9 @@ #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); @@ -205,9 +199,6 @@ static void qMessageOutput(QtMsgType type, const QMessageLogContext &context, 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; diff --git a/tizen/src/util/net_helper.c b/tizen/src/util/net_helper.c index b12e22d853..9266e6a36b 100644 --- a/tizen/src/util/net_helper.c +++ b/tizen/src/util/net_helper.c @@ -44,6 +44,14 @@ #include "new_debug_ch.h" #include "sysemu/runstate.h" +#ifdef _WIN32 +//#include +#else /* !_WIN32 */ +#include +#include +#include +#endif /* !_WIN32 */ + DECLARE_DEBUG_CHANNEL(net_helper); #define BUF_SIZE 64 diff --git a/tizen/src/util/net_helper.h b/tizen/src/util/net_helper.h index 806fa551ce..8742da5378 100644 --- a/tizen/src/util/net_helper.h +++ b/tizen/src/util/net_helper.h @@ -31,23 +31,6 @@ #ifndef SDB_SERVER_H_ #define SDB_SERVER_H_ -#include -#include -#include - -#ifdef _WIN32 -#include -#include -#include -#else /* !_WIN32 */ -#include -#include -#include -#include -#include -#endif /* !_WIN32 */ - - #define SDB_HOST_PORT 26099 #define START_VM_BASE_PORT 26100 diff --git a/tizen/src/util/new_debug_ch.c b/tizen/src/util/new_debug_ch.c index 833f203573..bce9c02cc8 100644 --- a/tizen/src/util/new_debug_ch.c +++ b/tizen/src/util/new_debug_ch.c @@ -286,6 +286,23 @@ static void debug_init(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); +} + int dbg_log(enum _debug_class cls, struct _debug_channel *channel, int line, const char *format, ...) { diff --git a/tizen/src/util/osutil-linux.c b/tizen/src/util/osutil-linux.c index c46e46123f..200b3763f0 100644 --- a/tizen/src/util/osutil-linux.c +++ b/tizen/src/util/osutil-linux.c @@ -32,6 +32,7 @@ @brief Collection of utilities for linux */ +#include #include #include #include diff --git a/tizen/src/util/osutil-win32.c b/tizen/src/util/osutil-win32.c index 7a6fcfc3e8..e94899a72b 100644 --- a/tizen/src/util/osutil-win32.c +++ b/tizen/src/util/osutil-win32.c @@ -31,13 +31,11 @@ @brief Collection of utilities for win32 */ -#include - -#include "png.h" - #include "qemu/osdep.h" #include "qemu-common.h" +#include #include "qemu/error-report.h" +#include "png.h" #include "osutil.h" #include "emulator.h" #include "emul_state.h" diff --git a/tizen/src/util/osutil.h b/tizen/src/util/osutil.h index cd3b28309d..84347b9751 100644 --- a/tizen/src/util/osutil.h +++ b/tizen/src/util/osutil.h @@ -29,7 +29,7 @@ #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. */ @@ -71,23 +71,6 @@ typedef struct sdcard_info 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 diff --git a/tizen/standalone-src/Makefile b/tizen/standalone-src/Makefile index 3413469db3..2922b05ad5 100644 --- a/tizen/standalone-src/Makefile +++ b/tizen/standalone-src/Makefile @@ -6,12 +6,14 @@ TARGET_EXE += qt5_msgbox$(EXESUF) 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 diff --git a/tizen/standalone-src/qt5_msgbox.rc b/tizen/standalone-src/qt5_msgbox.rc index 45f4761c79..394427f215 100644 --- a/tizen/standalone-src/qt5_msgbox.rc +++ b/tizen/standalone-src/qt5_msgbox.rc @@ -1,4 +1,4 @@ -#include "../../config-host.h" +#include "config-host.h" #ifdef CONFIG_MARU ID_ICON ICON "../src/ui/resource/icons/emulator_icon.ico" -- 2.34.1