Untangled headers, enabled sdl,fixed pci and vritio devices. 02/273402/1
authorvarinder.p <varinder.p@samsung.com>
Mon, 21 Mar 2022 17:52:01 +0000 (23:22 +0530)
committerVarinder Pratap Singh <varinder.p@samsung.com>
Tue, 5 Apr 2022 08:29:30 +0000 (13:59 +0530)
Change-Id: I6763b9cfecc56ed83f729b6a485d806b7e87afc9
Signed-off-by: varinder.p <varinder.p@samsung.com>
94 files changed:
configure
hw/Makefile.objs
hw/audio/soundhw.c
hw/vigs/Makefile.objs
hw/vigs/vigs_device.c
hw/vigs/vigs_fenceman.c
hw/vigs/vigs_qt5.cpp
hw/vigs/vigs_server.c
hw/virtio/virtio-pci.c
hw/yagl/yagl_device.c
hw/yagl/yagl_process.c
hw/yagl/yagl_server.c
net/net.c
net/tap.c
package/build.common
package/build.linux
softmmu/vl.c
tizen/emulator_configure.sh
tizen/src/ecs/Makefile.objs
tizen/src/ecs/ecs-json-streamer.c
tizen/src/ecs/ecs.c
tizen/src/ecs/ecs.h
tizen/src/ecs/ecs_eventcast.c
tizen/src/ecs/ecs_hds.c
tizen/src/ecs/ecs_hds.h
tizen/src/ecs/ecs_internal.h
tizen/src/ecs/ecs_mon.c
tizen/src/ecs/ecs_msg.c
tizen/src/ecs/ecs_msg_device.c
tizen/src/ecs/ecs_msg_injector.c
tizen/src/ecs/ecs_nfc.c
tizen/src/ecs/ecs_sdcard.c
tizen/src/ecs/ecs_sensor.c
tizen/src/ecs/ecs_sensor.h
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/emulator.h
tizen/src/emulator_common.h
tizen/src/emulator_options.c
tizen/src/emulator_options.h
tizen/src/eventcast/common.c
tizen/src/eventcast/sensor.c
tizen/src/eventcast/touch.c
tizen/src/hw/arm/maru_arm_vpci.c
tizen/src/hw/maru_board.c
tizen/src/hw/pci/maru_brightness.c
tizen/src/hw/pci/maru_brillcodec.c
tizen/src/hw/pci/maru_brillcodec.h
tizen/src/hw/pci/maru_brillcodec_device.c
tizen/src/hw/pci/maru_brillcodec_plugin.h
tizen/src/hw/pci/maru_camera.c
tizen/src/hw/pci/maru_camera_qtimage.cpp
tizen/src/hw/pci/maru_camera_virtual.c
tizen/src/hw/pci/maru_dtv_audio.c
tizen/src/hw/pci/maru_external_input_pci.c
tizen/src/hw/pci/maru_tuner.c
tizen/src/hw/pci/maru_tuner_decoder.c
tizen/src/hw/pci/maru_tuner_decoder.h
tizen/src/hw/virtio/maru_virtio_nfc.c
tizen/src/hw/virtio/maru_virtio_nfc.h
tizen/src/hw/virtio/maru_virtio_pci.c
tizen/src/hw/virtio/maru_virtio_power.c
tizen/src/hw/virtio/maru_virtio_sensor.c
tizen/src/ns_event.h
tizen/src/ui/displaybase.cpp
tizen/src/ui/displayglwidget.h
tizen/src/ui/displayswwidget.cpp
tizen/src/ui/input/keyboardshortcut.cpp
tizen/src/ui/mainwindow.cpp
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/contextmenu.h
tizen/src/ui/menu/screenshotdialog.cpp
tizen/src/ui/menu/sdbhelper.cpp
tizen/src/ui/qt5.c
tizen/src/ui/qt5.h
tizen/src/ui/qt5_supplement.cpp
tizen/src/ui/uiutil.h
tizen/src/util/device_hotplug.c
tizen/src/util/device_hotplug.h
tizen/src/util/error_handler.c
tizen/src/util/error_handler.h
tizen/src/util/extra_pkgs_install.h
tizen/src/util/hds.c
tizen/src/util/hds.h
tizen/src/util/net_helper.c
tizen/src/util/net_helper.h
tizen/src/util/osutil.h
tizen/src/util/qt5_error_report.c
tizen/src/util/qt5_error_report.h
tizen/src/util/tap_helper.h
tizen/src/util/ui_operations.c
tizen/src/util/ui_operations.h
tizen/standalone-src/Makefile

index f03100329c4a11eaa67c524aca663098205ae2ec..d9730ab9f4910a2dc82e209799b9224314bd9f67 100755 (executable)
--- a/configure
+++ b/configure
@@ -628,6 +628,7 @@ QEMU_INCLUDES="-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel/tcg -iq
 QEMU_INCLUDES="$QEMU_INCLUDES -iquote \$(SRC_PATH)/disas/libvixl"
 if test "$debug_info" = "yes"; then
     CFLAGS="-g $CFLAGS"
+    LDFLAGS="-g $LDFLAGS"
 fi
 
 # running configure in the source tree?
@@ -1960,7 +1961,6 @@ disabled with --disable-FEATURE, default is enabled if available:
   libpmem         libpmem support
   xkbcommon       xkbcommon support
   qt              Qt5 UI
-  hax             HAX acceleration support
   yagl            YaGL device
   yagl-stats      YaGL stats
   vigs            VIGS device
@@ -3262,11 +3262,11 @@ if test "$qt" != "no"; then
                 libs_softmmu="$qt_libs $x11_libs $libs_softmmu"
             fi
 
-            qt_cflags_private=`pkg-config --modversion Qt5Gui`
+            qt_cflags_private=`$pkg_config --modversion Qt5Gui`
             if test "$darwin" = "yes" ; then
-                qt_cflags_private=`pkg-config --cflags Qt5Gui | sed "s,QtGui.framework/Headers,&/$qt_cflags_private/QtGui,g"`
+                qt_cflags_private=`$pkg_config --cflags Qt5Gui | sed "s,QtGui.framework/Headers,&/$qt_cflags_private/QtGui,g"`
             else
-                qt_cflags_private=`pkg-config --cflags Qt5Gui | sed "s,QtGui,&/$qt_cflags_private/QtGui,g"`
+                qt_cflags_private=`$pkg_config --cflags Qt5Gui | sed "s,QtGui,&/$qt_cflags_private/QtGui,g"`
             fi
 
             qt_cflags="$qt_cflags $qt_cflags_private"
@@ -5239,6 +5239,8 @@ if test "$libtizenusb" != "no" ; then
         else
             error_exit "libtizenusb not found (you might not be set PKG_CONFIG_PATH"
         fi
+        QEMU_CFLAGS="$QEMU_CFLAGS $libtizenusb_cflags"
+        libs_softmmu="$libs_softmmu $libtizenusb_libs"
 fi
 
 # check for libusb
@@ -6690,8 +6692,8 @@ if test "$want_tools" = "yes" ; then
   fi
 fi
 if test "$softmmu" = yes ; then
-  if test "$linux" = yes; then
-    if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
+  if test "$virtfs" != no; then
+    if test "$cap_ng" = yes && test "$linux" = yes && test "$attr" = yes ; then
       virtfs=yes
       tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
     elif test "$maru" = yes && test "$darwin" = yes ; then
@@ -7060,7 +7062,6 @@ echo "fuzzing support   $fuzzing"
 
 #TIZEN
 echo "Qt support        $qt"
-echo "HAX support       $hax"
 echo "YaGL support      $yagl"
 echo "YaGL stats        $yagl_stats"
 echo "VIGS support      $vigs"
index bd7fb3a2c77ec9f8d353b349497068225bea29be..2d668357b6106ca9ff67498ea7aac08a95f902a6 100644 (file)
@@ -40,11 +40,9 @@ devices-dirs-$(CONFIG_MEM_DEVICE) += mem/
 devices-dirs-$(CONFIG_NUBUS) += nubus/
 devices-dirs-y += semihosting/
 devices-dirs-y += smbios/
-ifeq ($(CONFIG_MARU), y)
 devices-dirs-$(CONFIG_BUILD_VIGS) += yagl/
 devices-dirs-$(CONFIG_BUILD_VIGS) += vigs/
 endif
-endif
 
 common-obj-y += $(devices-dirs-y)
 obj-y += $(devices-dirs-y)
index c750473c8f0c48d7b9a25ea440964c9a2ba9cd76..7cf242087a914781f325f72860f8ec7ce4910e94 100644 (file)
@@ -40,7 +40,8 @@ struct soundhw {
     } init;
 };
 
-static struct soundhw soundhw[9];
+//Increase number of hw supported or disable registration for not required sound hw 
+static struct soundhw soundhw[11];
 static int soundhw_count;
 
 void isa_register_soundhw(const char *name, const char *descr,
index 40b5786a321f57765add3cd26fea4d63e7a3c6e7..123bc8e2598a90381bd96006319a7f047dd44136 100644 (file)
@@ -23,7 +23,7 @@ obj-y += work_queue.o
 obj-y += winsys.o
 obj-y += display.o
 
-$(obj)/vigs_qt5.o: QEMU_CXXFLAGS := $(QT_CFLAGS)
+$(obj)/vigs_qt5.o: QEMU_CXXFLAGS += $(QT_CFLAGS) $(QEMU_INCLUDES)
 
 # GL GLX backend
 ifdef CONFIG_LINUX
index b69d3bb88d7debb12b5025699171e9608cdc6673..4e487788e9245bae26c60d250370c53756dd21cb 100644 (file)
@@ -93,6 +93,10 @@ typedef struct VIGSState
 
 #define TYPE_VIGS_DEVICE "vigs"
 
+#define VIGS_DEVICE_PCI(obj) OBJECT_CHECK(VIGSState, (obj), \
+                                        TYPE_VIGS_DEVICE)
+
+
 static void vigs_update_irq(VIGSState *s)
 {
     bool raise = false;
@@ -370,7 +374,7 @@ static void vigs_vblank_timer_init(VIGSState *s) {
 //TODO: varinder.p return proper error
 static void vigs_device_init(PCIDevice *dev, Error **err)
 {
-    VIGSState *s = DO_UPCAST(VIGSState, dev, dev);
+    VIGSState *s = VIGS_DEVICE_PCI(dev);
     DisplayObject *dobj = NULL;
     WorkQueueObject *wqobj = NULL;
     WSIObject *wsiobj = NULL;
@@ -433,16 +437,16 @@ static void vigs_device_init(PCIDevice *dev, Error **err)
     }
 
     if (s->wsi) {
-        
+        Error *local_err = NULL; 
         wsiobj = WSIOBJECT(object_new(TYPE_WSIOBJECT));
 
         object_property_add_child(container_get(object_get_root(), "/objects"),
-                                  s->wsi, &wsiobj->base, err);
+                                  s->wsi, &wsiobj->base, &local_err);
 
         object_unref(&wsiobj->base);
 
         if (err) {
-            error_report_err(*err);
+            error_propagate(err, local_err);
             return;
         }
     }
@@ -548,10 +552,12 @@ fail:
 
     if (s->fence_ack_bh) {
         qemu_bh_delete(s->fence_ack_bh);
+        s->fence_ack_bh = NULL;
     }
 
     if (s->fenceman) {
         vigs_fenceman_destroy(s->fenceman);
+        s->fenceman = NULL;
     }
 
     vigs_log_cleanup();
@@ -561,7 +567,7 @@ fail:
 
 static void vigs_device_reset(DeviceState *d)
 {
-    VIGSState *s = container_of(d, VIGSState, dev.qdev);
+    VIGSState *s = VIGS_DEVICE_PCI(d);
 
     vigs_server_reset(s->server);
 
@@ -577,13 +583,16 @@ static void vigs_device_reset(DeviceState *d)
 
 static void vigs_device_exit(PCIDevice *dev)
 {
-    VIGSState *s = DO_UPCAST(VIGSState, dev, dev);
+    VIGSState *s = VIGS_DEVICE_PCI(dev);
 
     s->server->destroy(s->server);
+    s->server = NULL;
 
     qemu_bh_delete(s->fence_ack_bh);
+    s->fence_ack_bh = NULL;
 
     vigs_fenceman_destroy(s->fenceman);
+    s->fenceman = NULL;
 
     VIGS_LOG_INFO("VIGS deinitialized");
 
@@ -625,10 +634,9 @@ static TypeInfo vigs_device_info =
     .instance_size = sizeof(VIGSState),
     .class_init    = vigs_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },    
+          { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+          { },
+    },
 };
 
 static void vigs_register_types(void)
index 634493f972098e6b318825b323f2414cdb622949..737bb0aa6cd92496c3a74b7e37e790191f49101b 100644 (file)
@@ -65,6 +65,8 @@ struct vigs_fenceman *vigs_fenceman_create(void)
 
 void vigs_fenceman_destroy(struct vigs_fenceman *fenceman)
 {
+    if (fenceman == NULL)
+        return;
     vigs_fenceman_reset(fenceman);
     qemu_mutex_destroy(&fenceman->mutex);
     g_free(fenceman);
@@ -73,6 +75,8 @@ void vigs_fenceman_destroy(struct vigs_fenceman *fenceman)
 void vigs_fenceman_reset(struct vigs_fenceman *fenceman)
 {
     struct vigs_fence_ack *ack, *tmp;
+    if (fenceman == NULL)
+        return;
 
     qemu_mutex_lock(&fenceman->mutex);
 
index 598200b3eaeb688cbdabd1645b86e858ac3e6c6f..223210d8625850cc78835d5655e3e662403c9415 100644 (file)
 
 #include <QGuiApplication>
 #include <QOpenGLContext>
-#include "qpa/qplatformnativeinterface.h"
+#include <qpa/qplatformnativeinterface.h>
 #include "vigs_qt5.h"
 
+extern "C" {
+#define QObject qemu_QObject
+#define QList qemu_QList
+#include "qemu/osdep.h"
+#undef QObject
+#undef QList
+}
+
 extern bool qt5IsOnscreen;
 extern QApplication *qt5App;
 extern QOpenGLContext *qt5GLContext;
index 993ce31c9cae0f0a9f94623c7ce750fd9858f3a5..dba531c4b17992bae8e624c5000b62f8aae760d5 100644 (file)
@@ -644,6 +644,10 @@ static void vigs_server_dispatch_reset(void *user_data)
     GHashTableIter iter;
     gpointer key, value;
 
+    if (server == NULL || server->initialized == false) {
+        return;
+    }
+
     work_queue_wait(server->render_queue);
 
     if (!server->initialized) {
@@ -816,6 +820,10 @@ void vigs_server_reset(struct vigs_server *server)
     GHashTableIter iter;
     gpointer key, value;
 
+    if (server == NULL || server->initialized == false) {
+        return;
+    }
+
     work_queue_wait(server->render_queue);
 
     server->backend->batch_start(server->backend);
index 44e436aaec100df9fb8615c5f8edb368e6ddb006..f10638a6845693761e8c4080cd1275d6923e9701 100644 (file)
@@ -1919,7 +1919,6 @@ static const TypeInfo virtio_pci_info = {
     .class_size    = sizeof(VirtioPCIClass),
     .abstract      = true,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index fa28f678e9870daa2fd9a98690e0ab00128494aa..c6fe8c1e805b75adccbfacdc3991d486f4570c95 100644 (file)
@@ -86,6 +86,10 @@ typedef struct YaGLState
 
 #define TYPE_YAGL_DEVICE "yagl"
 
+#define YAGL_DEVICE_PCI(obj) OBJECT_CHECK(YaGLState, (obj), \
+                                        TYPE_YAGL_DEVICE)
+
+
 static void yagl_device_operate(YaGLState *s, int user_index, hwaddr buff_pa)
 {
     yagl_pid target_pid;
@@ -226,7 +230,7 @@ static const MemoryRegionOps yagl_device_ops =
 //TODO: varinder.p return proper error
 static void yagl_device_init(PCIDevice *dev, Error **err)
 {
-    YaGLState *s = DO_UPCAST(YaGLState, dev, dev);
+    YaGLState *s = YAGL_DEVICE_PCI(dev);
     DisplayObject *dobj = NULL;
     WorkQueueObject *wqobj = NULL;
     WSIObject *wsiobj = NULL;
@@ -375,7 +379,7 @@ fail:
 
 static void yagl_device_reset(DeviceState *d)
 {
-    YaGLState *s = container_of(d, YaGLState, dev.qdev);
+    YaGLState *s = YAGL_DEVICE_PCI(d);
     int i;
 
     YAGL_LOG_FUNC_ENTER(yagl_device_reset, NULL);
@@ -393,11 +397,12 @@ static void yagl_device_reset(DeviceState *d)
 
 static void yagl_device_exit(PCIDevice *dev)
 {
-    YaGLState *s = DO_UPCAST(YaGLState, dev, dev);
+    YaGLState *s = YAGL_DEVICE_PCI(dev);
 
     YAGL_LOG_FUNC_ENTER(yagl_device_exit, NULL);
 
     yagl_server_state_destroy(s->ss);
+    s->ss = NULL;
 
     yagl_handle_gen_cleanup();
 
@@ -437,7 +442,6 @@ static TypeInfo yagl_device_info =
     .instance_size = sizeof(YaGLState),
     .class_init    = yagl_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index 383e09869c75b1aacbde6c1ec3b2fadac50bc30f..477448509e700decd9ed2466ea55fefc0c291932 100644 (file)
@@ -61,6 +61,10 @@ void yagl_process_state_destroy(struct yagl_process_state *ps)
 {
     struct yagl_thread_state *ts, *next;
 
+    if (ps == NULL) {
+        return;
+    }
+
     YAGL_LOG_FUNC_ENTER(yagl_process_state_destroy, NULL);
 
     QLIST_FOREACH_SAFE(ts, &ps->threads, entry, next) {
@@ -73,6 +77,7 @@ void yagl_process_state_destroy(struct yagl_process_state *ps)
     assert(QLIST_EMPTY(&ps->threads));
 
     yagl_object_map_destroy(ps->object_map);
+    ps->object_map = NULL;
 
     g_free(ps);
 
index 3e65ac12ffa13d418f9d6a9d02505082b04712cd..b74846809df5cfeb08ffe8cb64d33d770508e56d 100644 (file)
@@ -139,6 +139,10 @@ void yagl_server_reset(struct yagl_server_state *ss)
 {
     struct yagl_process_state *ps, *next;
 
+    if (ss == NULL) {
+        return;
+    }
+
     work_queue_wait(ss->render_queue);
 
     QLIST_FOREACH_SAFE(ps, &ss->processes, entry, next) {
index 2c20aabebb0bd59fa88b645aad30a7459f16bbc8..0f0ccf09743d389d232977b9c8763364927f89c3 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1416,6 +1416,7 @@ static void net_vm_change_state_handler(void *opaque, int running,
     }
 }
 
+#if defined(CONFIG_MARU)
 LinkInfo *qmp_get_link(const char *name, Error **errp)
 {
     NetClientState *ncs[MAX_QUEUE_NUM];
@@ -1438,6 +1439,7 @@ LinkInfo *qmp_get_link(const char *name, Error **errp)
     }
     return info;
 }
+#endif
 
 void net_cleanup(void)
 {
index ddfff17fcf4ee71a4ab2229acfb78a9f49b16a1c..166fe7c44c34bd07a33fb8867c5e31bed0d1c8e1 100644 (file)
--- a/net/tap.c
+++ b/net/tap.c
@@ -478,13 +478,10 @@ static void launch_script(const char *setup_script, const char *ifname,
         *parg++ = (char *)sudo_path;
 #endif
         *parg++ = (char *)setup_script;
-#if defined(CONFIG_MARU)        
+        *parg++ = (char *)ifname;
         if (host_ifname) {
             *parg++ = (char *)host_ifname;
         }
-#else
-        *parg++ = (char *)ifname;        
-#endif        
         *parg = NULL;
 
 #if defined(CONFIG_MARU)
index 215629c054b3bcc53f861a6372f0a6585c0e6714..217fe23fecca6a037acd5dd3472e26301bb939e7 100644 (file)
@@ -78,7 +78,7 @@ install_common()
 
                echo "Removing old builds: " $VER-emulator-qemu-x86_${QEMU_VERSION}_${TARGET_OS}.zip
                rm -f ${SRCDIR}/$VER-emulator-qemu-x86_${QEMU_VERSION}_${TARGET_OS}.zip
-               rm -f ${SRCDIR}/$VER-emulator-common-x86_${QEMU_VERSION}_${TARGET_OS}.zip
+               rm -f ${SRCDIR}/$VER-emulator-qemu-common_${QEMU_VERSION}_${TARGET_OS}.zip
 
        done
 }
index fad94e72e653b291c43a7ef8c84f9ed996f961bc..e8231546bbd90fca0641137e49571d065cd3f4bf 100755 (executable)
@@ -39,7 +39,7 @@ prepare()
 
                REQUIRED_PKG="ant python3 zlib1g-dev libglib2.0-dev \
                        libasound2-dev libx11-dev libv4l-dev libxcomposite-dev \
-                       libswresample-dev libswscale-dev libpixman-1-dev libcurl4-gnutls-dev libcap-dev libattr1-dev"
+                       libswscale-dev libpixman-1-dev libcurl4-gnutls-dev libcap-dev libattr1-dev"
 
                echo "Checking required packages before compling!!"
                for pkg in ${REQUIRED_PKG}
index d89cf39531a13b0a560bf8c9fc6b5523b0e6c08d..23e4759fc49bb51ae3c4bffe0442d34c23c37175 100644 (file)
@@ -27,6 +27,7 @@
 #include "qemu/units.h"
 #include "hw/boards.h"
 #include "hw/qdev-properties.h"
+#include "hw/pci/pci_bus.h"
 #include "qapi/error.h"
 #include "qemu-version.h"
 #include "qemu/cutils.h"
 #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");
@@ -2916,6 +2920,13 @@ void qemu_init(int argc, char **argv, char **envp)
     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;
@@ -3520,6 +3531,30 @@ void qemu_init(int argc, char **argv, char **envp)
                 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");
@@ -4480,7 +4515,42 @@ void qemu_init(int argc, char **argv, char **envp)
     if (is_maru_machine(machine_class)) {
         prepare_maru_after_device_init();
     }
-#endif //CONFIG_MARU
+#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();
@@ -4584,6 +4654,10 @@ void qemu_init(int argc, char **argv, char **envp)
     accel_setup_post(current_machine);
     os_setup_post();
 
+#ifdef CONFIG_MARU
+    enable_print_backtrace_at_normal_exit();
+#endif
+
     return;
 }
 
index b82238fa9a17e13757b2a5135b773897dc6c2809..fd684630fe164e8b7d220ab9bce55234b9ed8475 100755 (executable)
@@ -127,9 +127,9 @@ CONFIGURE_APPEND="
  --enable-yagl
  --enable-vigs
  --enable-qt
- --disable-libav
+ --enable-libav
  --enable-libpng
- --disable-virtfs
+ --enable-virtfs
  --disable-bzip2
  --disable-curl
  --disable-lzo
@@ -144,7 +144,6 @@ CONFIGURE_APPEND="
  --disable-curses
  --disable-xen
  --disable-tpm
- --disable-sdl
  --disable-sheepdog
  --enable-debug
  --enable-debug-info
@@ -155,6 +154,7 @@ CONFIGURE_APPEND_WIN="
  --extra-ldflags=-static-libstdc++
  --audio-drv-list=dsound
  --winver=0x0600
+ --enable-sdl
  --enable-hax"
 
 # append platform specific options
@@ -164,6 +164,7 @@ CONFIGURE_APPEND="
  --extra-ldflags=-rdynamic
  --extra-ldflags=-Wl,-rpath,'\$\$ORIGIN'
  --audio-drv-list=alsa
+ --enable-sdl
  --enable-kvm
  $CONFIGURE_APPEND
 "
index 9c276bc0fa031fe2e75d0199d7783e4013d941c6..0662176a672de45ecdc75b2b2cc40ccafde84c55 100644 (file)
@@ -7,4 +7,6 @@ obj-y += ecs_sensor.o
 obj-$(CONFIG_VIRTFS) += ecs_hds.o
 obj-y += ecs_nfc.o
 ecs_nfc.o-cflags += -Wno-stringop-truncation
-obj-y += ecs_sdcard.o
\ No newline at end of file
+obj-y += ecs_sdcard.o
+ecs_msg_device.o-cflags += $(LIBAV_CFLAGS)
+ecs_msg.o-cflags += $(LIBAV_CFLAGS)
index 71d5592c86af110b885d07b94c392016c7980181..1db50d84b8524014129756759da55372a76e3df2 100644 (file)
@@ -121,16 +121,14 @@ void ecs_json_message_parser_init(ECSJSONMessageParser *parser,
 int ecs_json_message_parser_feed(ECSJSONMessageParser *parser,
                              const char *buffer, size_t size)
 {
-     //TIZEN_VERIFY:
-     json_lexer_feed(&parser->lexer, buffer, size);
-     return 0;
+    json_lexer_feed(&parser->lexer, buffer, size);
+    return 0;
 }
 
 int ecs_json_message_parser_flush(ECSJSONMessageParser *parser)
 {
-    //TIZEN_VERIFY:
-     json_lexer_flush(&parser->lexer);
-     return 0;
+    json_lexer_flush(&parser->lexer);
+    return 0;
 }
 
 void ecs_json_message_parser_destroy(ECSJSONMessageParser *parser)
index 8fb5cf1e58e791d36e8cea544896f6a6c02abb1a..eec866df550cde7e07d924478a174355ea416ff6 100644 (file)
  *
  */
 
-#include <stdbool.h>
-#include <stdlib.h>
-
-#include "qemu/osdep.h"
-#include "hw/qdev.h"
-#include "net/net.h"
-#include "ui/console.h"
-
-#include "qemu-common.h"
+#include "emulator.h"
+#include "emul_state.h"
 #include "qemu/queue.h"
 #include "qemu/sockets.h"
 #include "qemu/option.h"
 #include "chardev/char.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qnum.h"
+#include "hw/qdev.h"
+#include "net/net.h"
+#include "ui/console.h"
 
-#include "emulator.h"
 #include "util/net_helper.h"
 #include "ecs.h"
-#include "emul_state.h"
+#include "ecs_internal.h"
 
 #include "hw/virtio/maru_virtio_sensor.h"
 #include "hw/virtio/maru_virtio_nfc.h"
@@ -340,9 +335,9 @@ static EcsMonitor *monitor_create(void)
 {
     EcsMonitor *mon;
 
-    mon = g_malloc0(sizeof(*mon));
+    mon = g_malloc0(sizeof(EcsMonitor));
     if (NULL == mon) {
-        LOG_SEVERE("monitor allocation failed.\n");
+        LOG_SEVERE("EcsMonitor allocation failed.\n");
         return NULL;
     }
 
@@ -421,11 +416,11 @@ static ssize_t ecs_recv(int fd, char *buf, size_t len)
 }
 #endif
 
-static void reset_sbuf(sbuf *sbuf)
+static void reset_ecsbuffer(ecsbuffer *sbuff)
 {
-    memset(sbuf->_buf, 0, 4096);
-    sbuf->_use = 0;
-    sbuf->_netlen = 0;
+    memset(sbuff->_buf, 0, 4096);
+    sbuff->_use = 0;
+    sbuff->_netlen = 0;
 }
 
 static bool handle_protobuf_msg(ECS_Client *cli, char *data, int len)
@@ -541,7 +536,7 @@ static void ecs_read(ECS_Client *cli)
         goto fail;
     }
 
-    if (cli->sbuf._netlen == 0) {
+    if (cli->sbuff._netlen == 0) {
         if (to_read_bytes < 4) {
             return;
         }
@@ -556,7 +551,7 @@ static void ecs_read(ECS_Client *cli)
 
         payloadsize = ntohl(payloadsize);
 
-        cli->sbuf._netlen = payloadsize;
+        cli->sbuff._netlen = payloadsize;
 
         LOG_TRACE("payload size: %ld\n", payloadsize);
 
@@ -567,18 +562,18 @@ static void ecs_read(ECS_Client *cli)
         return;
     }
 
-    to_read_bytes = min(to_read_bytes, cli->sbuf._netlen - cli->sbuf._use);
+    to_read_bytes = min(to_read_bytes, cli->sbuff._netlen - cli->sbuff._use);
 
-    read = ecs_recv(cli->client_fd, (char *)(cli->sbuf._buf + cli->sbuf._use), to_read_bytes);
+    read = ecs_recv(cli->client_fd, (char *)(cli->sbuff._buf + cli->sbuff._use), to_read_bytes);
     if (read == 0) {
         goto fail;
     }
 
-    cli->sbuf._use += read;
+    cli->sbuff._use += read;
 
-    if (cli->sbuf._netlen == cli->sbuf._use) {
-        handle_protobuf_msg(cli, (char *)cli->sbuf._buf, cli->sbuf._use);
-        reset_sbuf(&cli->sbuf);
+    if (cli->sbuff._netlen == cli->sbuff._use) {
+        handle_protobuf_msg(cli, (char *)cli->sbuff._buf, cli->sbuff._use);
+        reset_ecsbuffer(&cli->sbuff);
     }
 
     return;
@@ -635,15 +630,15 @@ static int ecs_add_client(ECS_State *cs, int fd)
         return -1;
     }
 
-    reset_sbuf(&clii->sbuf);
+    reset_ecsbuffer(&clii->sbuff);
 
     qemu_set_nonblock(fd);
 
     clii->client_fd = fd;
     clii->cs = cs;
     clii->client_type = TYPE_NONE;
-    //TIZEN_Verify
-    ecs_json_message_parser_init(&clii->parser, ecs_handle_qmp_command, clii,NULL);
+
+    ecs_json_message_parser_init(&clii->parser, ecs_handle_qmp_command, clii, NULL);
 
 #ifdef CONFIG_LINUX
     epoll_cli_add(cs, fd);
@@ -926,7 +921,7 @@ static void *ecs_initialize(void *args)
 
     mon = monitor_create();
     if (NULL == mon) {
-        LOG_SEVERE("monitor initialization failed.\n");
+        LOG_SEVERE("EcsMonitor initialization failed.\n");
         ecs_close(cs);
         return NULL;
     }
index 1eda628c0d3e196e36206cf1d16febd560eaaac7..72dbc3f22298121c2d2060e4723f8fa03fda0717 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef __ECS_H__
 #define __ECS_H__
 
-#include "ecs_internal.h"
+#include "emulator_common.h"
 
 #define COMMANDS_TYPE           "type"
 #define COMMANDS_DATA           "data"
index 49524ea835cbd14415d83bf811c7853a631d321c..3aee5250377e6a099727253f71b75ce3bed5645e 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
-#include "ui/console.h"
-
 #include "ecs.h"
+#include "ecs_internal.h"
 #include "ecs_sensor.h"
 #include "ecs_eventcast.h"
 #include "eventcast/common.h"
 #include "eventcast/sensor.h"
 #include "eventcast/touch.h"
 #include "hw/virtio/maru_virtio_input.h"
+#include "ui/console.h"
 
 #include "util/new_debug_ch.h"
 
@@ -226,8 +225,8 @@ static bool send_eventcast_ntf(const char *data)
     ECS__EventCastNtf ntf = ECS__EVENT_CAST_NTF__INIT;
 
     ntf.category = (char *) g_malloc(catsize + 1);
-    strncpy(ntf.category, cat, 10);
-    ntf.category[10] = 0;
+    strncpy(ntf.category, cat, catsize);
+    ntf.category[catsize] = 0;
     ntf.length = length;
     ntf.group = group;
     ntf.action = action;
index 614cc62e6c2b325f51ea8c9d124a507472608907..339ddd15cb0e3ca16d25ea6882fc927d05a0fd4e 100644 (file)
  *
  */
 
-#include <string.h>
-
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator_common.h"
 #include "qemu/thread.h"
 #include "fsdev/qemu-fsdev.h"
-
 #include "emul_state.h"
+#include "ecs.h"
 #include "ecs_hds.h"
 #include "util/hds.h"
 #include "util/device_hotplug.h"
index c76468c86df82ad299eb22387924084511de8c6c..80f7a27df1da05e81352580e2a40aad9e3457cc4 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef __ECS_HDS_H__
 #define __ECS_HDS_H__
 
-#include "ecs.h"
+#include "ecs_internal.h"
 
 #define ECS_HDS_HIDDEN_RESERVED 4
 
index c7f2c6b6f3add6dfcb572081edc07ad9b195e8c3..99671fd7688c6ba5a7f8f14012e00e01f8bb7c98 100644 (file)
 #ifndef __ECS_INTERNAL_H__
 #define __ECS_INTERNAL_H__
 
-#ifdef CONFIG_LINUX
-#include <sys/epoll.h>
-#endif
 
+#include "emulator_common.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
-#include "qapi/qmp/qerror.h"
 #include "ecs-json-streamer.h"
 #include "genmsg/ecs.pb-c.h"
 #include "genmsg/ecs_ids.pb-c.h"
-#include "ecs_sensor.h"
+
 
 #define TIMER_ALIVE_S           60
 #define TYPE_DATA_SELF          "self"
@@ -88,11 +84,11 @@ enum injector_level {
     level_pedo = 23,
 };
 
-typedef struct sbuf {
+typedef struct _sbuffer {
     int _netlen;
     int _use;
     char _buf[OUT_BUF_SIZE];
-} sbuf;
+} ecsbuffer;
 
 typedef struct mon_fd_t mon_fd_t;
 struct mon_fd_t {
@@ -138,7 +134,7 @@ typedef struct ECS_Client {
     int keep_alive;
     const char *type;
 
-    sbuf sbuf;
+    ecsbuffer sbuff;
 
     ECS_State *cs;
     ECSJSONMessageParser parser;
index 73130faebf1d8bececcd828eb054c738dacf393c..4866fbf2a2a8b7e1ac1ff5bb0e92c33af4c90890 100644 (file)
@@ -47,6 +47,7 @@
 #include "qapi/qmp/dispatch.h"
 
 #include "ecs.h"
+#include "ecs_internal.h"
 #include "hw/virtio/maru_virtio_evdi.h"
 #include "hw/virtio/maru_virtio_sensor.h"
 #include "hw/virtio/maru_virtio_nfc.h"
index ead8be94acc39e307a823fa43d3c8a47d6a2d267..89f5a596fc1f4a7b8addedbc7dcb59bcc2e5e525 100644 (file)
@@ -28,8 +28,7 @@
  *
  */
 
-#include "qemu/osdep.h"
-#include <stdbool.h>
+#include "emulator_common.h"
 #include "hw/qdev.h"
 #include "net/net.h"
 #include "net/slirp.h"
@@ -45,6 +44,8 @@
 #include "qemu/main-loop.h"
 #include "qapi/qmp/qstring.h"
 #include "qapi/qmp/qdict.h"
+#include "ecs.h"
+#include "ecs_internal.h"
 
 #ifdef CONFIG_LINUX
 #include <sys/epoll.h>
 #include <arpa/inet.h>
 #endif
 
-#include "qemu-common.h"
 #include "ecs-json-streamer.h"
 
 #include "hw/virtio/maru_virtio_vmodem.h"
 #include "hw/virtio/maru_virtio_evdi.h"
 
-#include "ecs.h"
-
 #include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, ecs);
index 933122d0db4ab42cfdbb6959525a3507aae9ac76..96f4ca3e69708feea5c4a4c3b3ffb5e706854c92 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator_common.h"
 #include "qemu/option.h"
-#include "qemu/config-file.h"
 
 #include "net/slirp.h"
 #include "monitor/qdev.h"
 #include "hw/virtio/maru_virtio_nfc.h"
 
 #include "util/ui_operations.h"
+#include "ecs.h"
+#include "emul_state.h"
 #include "ecs_sensor.h"
 #include "ecs_hds.h"
-#include "emul_state.h"
-#include "ecs.h"
-#include "debug_ch.h"
 #include "ecs_sdcard.h"
+#include "debug_ch.h"
 
 #if defined(CONFIG_LIBAV)
 #include "ecs_tuner.h"
@@ -172,6 +170,15 @@ static void msgproc_device_req_sensor(ECS_Client *ccli, ECS__DeviceReq *msg, cha
 
 #define MSG_NET_GROUP       0
 #define MSG_NET_ACTION      123
+
+
+static int net_slirp_redir(const char *redir_str)
+{
+    //TODO call slirp_hostfwd(QTAILQ_FIRST(&slirp_stacks), redir_str, 1); instead
+    return 0;
+}
+
+
 static void msgproc_device_req_network(ECS_Client *ccli, ECS__DeviceReq *msg, char *cmd)
 {
     char *data = NULL;
@@ -183,13 +190,12 @@ static void msgproc_device_req_network(ECS_Client *ccli, ECS__DeviceReq *msg, ch
 
     if (data != NULL) {
         LOG_TRACE(">>> Network msg: '%s'\n", data);
-        //TIZEN_VERIFY
-        //if (net_slirp_redir(data) < 0) {
+        if (net_slirp_redir(data) < 0) {
             LOG_SEVERE("redirect [%s] fail\n", data);
             make_send_device_ntf(cmd, MSG_NET_GROUP, MSG_NET_ACTION, ret);
-       // } else {
-        //    LOG_TRACE("redirect [%s] success\n", data);
-        //}
+        } else {
+            LOG_TRACE("redirect [%s] success\n", data);
+        }
     } else {
         LOG_SEVERE("Network redirection data is null.\n");
     }
index e17548ce065bc93c073430585e8d48181bf7d7d9..0489955a494caa83aaf64cac729ddf09065396cd 100644 (file)
  *
  */
 
-#include <string.h>
-#include <stdlib.h>
-
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator_common.h"
 #include "qemu/error-report.h"
 #include "qemu/thread.h"
 
@@ -41,6 +37,7 @@
 #include "hw/virtio/maru_virtio_jack.h"
 #include "hw/virtio/maru_virtio_power.h"
 
+#include "ecs.h"
 #include "emul_state.h"
 #include "ecs_hds.h"
 #include "ecs_sensor.h"
@@ -474,14 +471,12 @@ static void show_error_popup(char *data)
     char *addon = strtok(data, token);
 
     memset(fail_msg, 0, sizeof(fail_msg));
-    strncpy(fail_msg, FAILED_TO_INSTALL_EXTRAPACKAGE_1, strlen(FAILED_TO_INSTALL_EXTRAPACKAGE_1));
-    fail_msg[strlen(FAILED_TO_INSTALL_EXTRAPACKAGE_1)] = 0;
-
+    strncpy(fail_msg, FAILED_TO_INSTALL_EXTRAPACKAGE_1, sizeof(fail_msg));
     if (addon != NULL && (strlen(addon)+strlen(fail_msg)) < MAX_PKGS_LIST) {
-        strncat(fail_msg, addon, strlen(addon) + 1);
+        strncat(fail_msg, addon, strlen(addon));
     }
     if ((strlen(FAILED_TO_INSTALL_EXTRAPACKAGE_2)+strlen(fail_msg)) < MAX_PKGS_LIST) {
-        strncat(fail_msg, FAILED_TO_INSTALL_EXTRAPACKAGE_2, strlen(FAILED_TO_INSTALL_EXTRAPACKAGE_2) + 1);
+        strncat(fail_msg, FAILED_TO_INSTALL_EXTRAPACKAGE_2, strlen(FAILED_TO_INSTALL_EXTRAPACKAGE_2));
     }
 
     error_report("%s", fail_msg);
index c028b27c185c8350f8e09d952111b6275a4860e5..c37936b92c9c617e1af2fe6cb267e45313a2407e 100644 (file)
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 
-#include "hw/virtio/maru_virtio_nfc.h"
-
 #include "ecs.h"
+#include "ecs_internal.h"
+
+#include "hw/virtio/maru_virtio_nfc.h"
 
 #include "debug_ch.h"
 
index 19f28c354ad716c44615b22ce27d2ecf83b8a11b..cc2bbc838d1d51c06c2b3aca8a82d44842e960f8 100644 (file)
  *
  */
 
-#include "ecs_sdcard.h"
+#include "emulator_common.h"
+#include "emul_state.h"
 #include "ecs.h"
+#include "ecs_internal.h"
+#include "ecs_sdcard.h"
 #include "util/osutil.h"
 #include "util/device_hotplug.h"
+#include "qapi/qapi-commands-block.h"
+#include "qapi/qapi-visit-block-core.h"
 #include "debug_ch.h"
-#include "emul_state.h"
 
 MULTI_DEBUG_CHANNEL(qemu, ecs);
 
@@ -92,7 +96,7 @@ static char *get_human_readable_size(char *buf, int buf_size, int64_t size)
     }
     return buf;
 }
-extern BlockInfoList *qmp_query_block(Error **errp);
+
 static void send_sdcard_status(void)
 {
     BlockInfoList *block_list, *info;
index 269c035424c7c7f26a5c36aadc0d86a143c2fe20..3ddcd75b7de5df75538dcaf37ccddf130a427e19 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-
-#include <math.h>
-
 #include "ecs.h"
+#include "ecs_internal.h"
+#include "ecs_sensor.h"
 #include "hw/virtio/maru_virtio_sensor.h"
 #include "hw/virtio/maru_virtio_power.h"
 #include "hw/virtio/maru_virtio_jack.h"
-
 #include "debug_ch.h"
+#include <math.h>
 
 MULTI_DEBUG_CHANNEL(qemu, ecs);
 
@@ -70,18 +67,6 @@ static int _accel_min_max(char *tmp)
     return accel_min_max(atof(tmp));
 }
 
-#if defined(CONFIG_JAVA_UI)
-void req_set_sensor_accel(int x, int y, int z)
-{
-    char tmp[TEMP_BUF_SIZE] = { 0, };
-
-    sprintf(tmp, "%d, %d, %d", x, y, z);
-
-    set_sensor_accel(tmp, strlen(tmp));
-}
-#endif
-
-#if defined(CONFIG_QT)
 static int convert_abs_angle(int angle)
 {
     if (angle < SENSOR_ANGLE_MIN) {
@@ -144,7 +129,6 @@ void req_set_sensor_accel_angle(int angle)
 
     set_sensor_accel(accel, strlen(accel));
 }
-#endif
 
 static void _req_set_sensor_accel(int len, const char *data)
 {
index 4b07745703fcceb139e8cfe6b20f0e32c11754b5..4a2e374d0f989618b50984d717642b96913a50c9 100644 (file)
 #ifndef __ECS_SENSOR_H__
 #define __ECS_SENSOR_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 /* skin rotation request */
 int accel_min_max(double value);
-#if defined(CONFIG_QT)
 void req_set_sensor_accel_angle(int angle);
-#elif defined(CONFIG_JAVA_UI)
-void req_set_sensor_accel(int x, int y, int z);
-#endif
-
 void ecs_sensor_set_injector_data(const char *data);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __ECS_SENSOR_H__ */
index 85d0fe3399dce83d3a460d20a54f7c83dc69129c..03ec9a992c21cbae30192276fd5bba37d1b10e49 100644 (file)
  *
  */
 
-#include "emul_state.h"
-
-#include <libgen.h>
-#include "emulator_common.h"
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator.h"
+#include "emul_state.h"
+#include "qemu/option.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc.h"
 #include "ui/console.h"
@@ -47,8 +44,8 @@
 #include "fsdev/qemu-fsdev.h"
 #endif
 
-#include "emulator.h"
 #include "emulator_options.h"
+#include "hw/maru_device_ids.h"
 #include "hw/virtio/maru_virtio_input.h"
 #include "hw/virtio/maru_virtio_evdi.h"
 #include "util/net_helper.h"
@@ -447,9 +444,9 @@ bool is_gpu_accel_enabled(void)
 }
 
 // ram size
-uint64_t get_ram_size(void)
+unsigned long int get_ram_size(void)
 {
-    return ram_size;
+    return (unsigned long int)ram_size;
 }
 
 // VM base port
index 91a427a95214c9245f8fa8a088b10821a38199a4..4fe321da5fe729a9d243ac414ea7cc8e6bb6f1f6 100644 (file)
@@ -33,9 +33,6 @@
 #ifndef __EMUL_STATE_H__
 #define __EMUL_STATE_H__
 
-#include "emulator_common.h"
-#include "hw/maru_device_ids.h"
-
 #define MAX_ADDR_LEN    256
 #define MAX_PORT_LEN    256
 
 
 #define DEFAULT_STATIC_HDS_ID   "fsdef0"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 enum {
     RESET = 0,
     BOOT_COMPLETED = 1,
@@ -142,7 +143,7 @@ bool is_mouse_enabled(void);
 bool is_touchscreen_enabled(void);
 bool is_netclient_tap_attached(void);
 
-uint64_t get_ram_size(void);
+unsigned long int get_ram_size(void);
 
 int get_vm_base_port(void);
 int get_vm_device_serial_number(void);
@@ -161,4 +162,8 @@ const char* get_platform_default_home(void);
 void set_platform_default_home(const char *path);
 
 void init_emul_state(void);
+
+#ifdef __cplusplus
+}
+#endif
 #endif /* __EMUL_STATE_H__ */
index ce57eda9db223c5073a20adabe379a0005a3c199..bfe3d6248046cfc75c6c335d5a794ca8bd562763 100644 (file)
  *
  */
 
-#include <stdlib.h>
-#include <getopt.h>
-#include <libgen.h>
-
-#include "qemu/osdep.h"
+#include "emulator.h"
+#include "emul_state.h"
 #include "qemu/config-file.h"
 #include "qemu/sockets.h"
 #include "qemu/error-report.h"
 #include "qemu/thread.h"
-
+#include "qemu/option.h"
+#include "sysemu/sysemu.h"
 #include "sysemu/runstate.h"
-
 #include "build_info.h"
-#include "emulator.h"
-#include "emul_state.h"
 #include "emulator_options.h"
 #include "util/error_handler.h"
 #include "util/osutil.h"
 #include "util/net_helper.h"
 #include "ecs/ecs.h"
+#include "ecs/ecs_internal.h"
 #include "util/device_hotplug.h"
 #include "util/exported_strings.h"
-#ifdef CONFIG_WIN32
-#include <windows.h>
-#include <sddl.h>
-#endif
 #ifdef CONFIG_QT
-#include <ui/qt5_supplement.h>
+#include "ui/qt5_supplement.h"
 #endif
 
 #ifdef CONFIG_SDL
index a48c0833489fca863af98fb3b8ad8fd086b1ab51..157b89bb69300498ccee95601c9f497f4350ea2a 100644 (file)
 #define __EMULATOR_H__
 
 #include "emulator_common.h"
-#include "qapi/qmp/qlist.h"
-#include "qemu/option.h"
-#include "sysemu/sysemu.h"
+#include "qemu/notify.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 const char *prepare_maru(const gchar * const kernel_cmdline);
 void prepare_maru_after_device_init(void);
 void print_system_info(void);
 void emulator_add_exit_notifier(Notifier *notify);
 void qemu_system_graceful_shutdown_request(unsigned int sec);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __EMULATOR_H__ */
index ed418e2ba4b259a9c051d0fa361159f07aa250c8..3b3b20df00fda5a498b1eafecdfe35c1d6ecb6d3 100644 (file)
 #ifndef __EMULATOR_COMMON_H__
 #define __EMULATOR_COMMON_H__
 
-#include <stdio.h>
-#include <string.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <errno.h>
+#include "qemu/osdep.h"
+#include "qemu-common.h"
 
 #ifdef CONFIG_DARWIN
 #include "sys/syslimits.h"
 #endif
 
-#ifdef CONFIG_WIN32
+#if defined (CONFIG_LINUX)
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <sys/epoll.h>
+#endif
+
+#if defined(CONFIG_WIN32)
 #if defined(__MINGW64_VERSION_MAJOR)
 #define __MINGW_W64__
 #endif
+#include <sddl.h>
 #endif
 
-#if !defined(PATH_MAX)
-#if defined(MAX_PATH)
-#define PATH_MAX    MAX_PATH
-#else
-#define PATH_MAX    256
-#endif
-#endif
 
 #endif /* __EMULATOR_COMMON_H__ */
index 29804323957504db821c76e80366db967a61f756..7615fd9971562ad223b43606af5fd0185ab8e4f2 100644 (file)
  *
  */
 
-#include <string.h>
-#include <assert.h>
-#include <locale.h>
-
-#include "qemu/osdep.h"
+#include "emulator_common.h"
 #include "qemu/queue.h"
 
 #include "emulator_options.h"
index 4e4538e02e005de5bc3188e2abaaed35f9d44ee0..c4507d0a0a9743d1797cd4d58bfd6a4efa5e08ea 100644 (file)
 
 #ifndef __EMULATOR_OPTIONS_H__
 #define __EMULATOR_OPTIONS_H__
-
-#include "emulator_common.h"
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void set_variable(const char * const arg1, const char * const arg2, bool override);
 const char *get_variable(const char * const name);
 void reset_variables(void);
 bool load_conf(const char * const conf);
 bool assemble_emulator_args(int *qemu_argc, char **qemu_argv);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __EMULATOR_OPTIONS_H__ */
index 61ba748cf12c3c70982358fe856a2135b00e40d0..6672e65f058f4629ccb854e314694c258370ecbd 100644 (file)
  *
  */
 
-#ifndef __WIN32
-#include <sys/ioctl.h>
-#else
-#define EISCONN WSAEISCONN
-#define EALREADY WSAEALREADY
-#endif
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator.h"
 #include "qemu/main-loop.h"
 #include "qemu/sockets.h"
 #include "qemu/thread.h"
-#include "ui/console.h"
-
-#include "emulator.h"
 #include "common.h"
 #include "sensor.h"
 #include "touch.h"
 #include "emul_state.h"
+#include "ui/console.h"
 #include "ecs/ecs_eventcast.h"
 #include "genmsg/eventcast.pb-c.h"
 
 #include "util/new_debug_ch.h"
 
+#ifndef __WIN32
+#include <sys/ioctl.h>
+#else
+#define EISCONN WSAEISCONN
+#define EALREADY WSAEALREADY
+#endif
+
+
 DECLARE_DEBUG_CHANNEL(eventcast);
 
 #define EVENTCAST_MSG_HANDSHAKE_KEY     100
index ef20fa643d7a1de9bb9e6bcdbb77a9a08bd3d864..f8b805eab304200d22ec85ce9b13f5d25a516ee9 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "emulator_common.h"
 #include "emul_state.h"
-
 #include "sensor.h"
 #include "common.h"
 #include "ecs/ecs_eventcast.h"
index 4f0428e4707807449c9f5cc838d180880fb2acf4..94c6137b9f18f8a5dcd377949de9b6c4d13e09f5 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include "qemu/osdep.h"
 #include "emulator_common.h"
 #include "emul_state.h"
 #include "common.h"
index e0f5ea18f6a444ca33d551cab29a2ab6f6552054..3bf3196578ba428a3ecfb97800e72bc9a57eb1a5 100644 (file)
@@ -175,7 +175,6 @@ static TypeInfo tizen_vpci_host_info = {
     .instance_size = sizeof(PCIDevice),
     .class_init    = tizen_vpci_host_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index 99eadff06d6fb66398c04d19458263426e027169..16e5802fc3efa873d050c52e6853b165d1c94909 100644 (file)
  * add some TIZEN-speciaized device...
  */
 
-#include "qemu/osdep.h"
+#include "emulator_common.h"
 #include "hw/boards.h"
 #include "hw/i386/pc.h"
 
-#include "emulator_common.h"
 #include "maru_pm.h"
 
 /* maru specialized device init */
@@ -60,9 +59,7 @@ static void maru_x86_machine_options(MachineClass *m)
     m->no_cdrom = 1;
     m->no_sdcard = 1;
     m->default_boot_order = "c";
-#ifdef CONFIG_HAX    
     compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len);
-#endif //CONFIG_HAX
 }
 
 DEFINE_PC_MACHINE(maru, "maru-x86-machine", maru_x86_board_init,
index 04d6b545ce8e4e2495251c0174dba75e6efe707f..c070ef6e5bda9a59516e70aa48cdc27d07f50095 100644 (file)
@@ -238,7 +238,6 @@ static TypeInfo brightness_info = {
     .instance_size = sizeof(BrightnessState),
     .class_init = brightness_classinit,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index b584c53d27b1d11ebd8d63e9697b19f48a916b86..b825242fdc394f4bbab7c0a0188298fcd52800b8 100644 (file)
 
 #include "maru_brillcodec.h"
 
+#include "libavresample/avresample.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavformat/avformat.h"
 #include "libavutil/pixdesc.h"
-#include "libswresample/swresample.h"
+
 #include "util/new_debug_ch.h"
 
 /* define debug channel */
@@ -229,8 +230,8 @@ typedef struct CodecDataStg {
 } CodecDataStg;
 
 // define two queue to store input and output buffers.
-union codec_wq codec_wq = QTAILQ_HEAD_INITIALIZER(codec_wq);
-static QTAILQ_HEAD(codec_rq, CodecDataStg) codec_rq =
+union Codec_wq codec_wq = QTAILQ_HEAD_INITIALIZER(codec_wq);
+static QTAILQ_HEAD(Codec_rq, CodecDataStg) codec_rq =
    QTAILQ_HEAD_INITIALIZER(codec_rq);
 
 // codec functions
@@ -1270,12 +1271,12 @@ static AVFrame *resample_audio(AVCodecContext *avctx, AVFrame *sample_frame,
                             AVFrame *resample_frame, int *resample_buffer_size,
                             int resample_sample_fmt)
 {
-    SwrContext *avr = NULL;
+    AVAudioResampleContext *avr = NULL;
     uint8_t *resample_buffer = NULL;
     int buffer_size = 0;
     int resample_nb_samples = sample_frame->nb_samples;
 
-    avr = swr_alloc();
+    avr = avresample_alloc_context();
     if (!avr) {
         LOG_SEVERE("failed to allocate avresample context\n");
         return NULL;
@@ -1293,9 +1294,9 @@ static AVFrame *resample_audio(AVCodecContext *avctx, AVFrame *sample_frame,
     av_opt_set_int(avr, "out_sample_rate", avctx->sample_rate, 0);
 
     LOG_TRACE("open avresample context\n");
-    if (swr_init(avr) < 0) {
+    if (avresample_open(avr) < 0) {
         LOG_SEVERE("failed to open avresample context\n");
-        swr_free(&avr);
+        avresample_free(&avr);
         return NULL;
     }
 
@@ -1309,31 +1310,31 @@ static AVFrame *resample_audio(AVCodecContext *avctx, AVFrame *sample_frame,
     *resample_buffer_size = av_samples_get_buffer_size(NULL, avctx->channels, resample_nb_samples, resample_sample_fmt, 0);
     if (*resample_buffer_size < 0) {
         LOG_SEVERE("failed to get size of resample buffer %d\n", *resample_buffer_size);
-        swr_close(avr);
-        swr_free(&avr);
+        avresample_close(avr);
+        avresample_free(&avr);
         return NULL;
     }
 
     resample_buffer = av_mallocz(*resample_buffer_size);
     if (!resample_buffer) {
         LOG_SEVERE("failed to allocate resample buffer\n");
-        swr_close(avr);
-        swr_free(&avr);
+        avresample_close(avr);
+        avresample_free(&avr);
         return NULL;
     }
 
     fill_audio_into_frame(avctx, resample_frame, resample_buffer,
                         *resample_buffer_size, resample_nb_samples, resample_sample_fmt);
 
-    buffer_size = swr_convert(avr, resample_frame->data,
+    buffer_size = avresample_convert(avr, resample_frame->data,
                                     *resample_buffer_size, resample_nb_samples,
                                     sample_frame->data, sample_buffer_size,
                                     sample_frame->nb_samples);
 
     LOG_TRACE("resample_audio buffer_size %d\n", buffer_size);
 
-    swr_close(avr);
-    swr_free(&avr);
+    avresample_close(avr);
+    avresample_free(&avr);
 
     return resample_frame;
 }
@@ -1619,6 +1620,11 @@ static enum PixelFormat get_format(AVCodecContext *avctx,
     CodecContext *context = (CodecContext *)avctx->opaque;
     MaruBrillCodecState *s = context->state;
 
+    if (!s->hwaccel_plugin ||
+        !check_av_hw_accel(avctx->codec_id)) {
+        goto end;
+    }
+
     for (i = 0; pi_fmt[i] != PIX_FMT_NONE; ++i) {
         const AVPixFmtDescriptor *dsc = av_pix_fmt_desc_get(pi_fmt[i]);
         if (dsc == NULL) {
index 66cd647ce0cfd505529e300efb75189f998cf0d8..aaf3d874295915efc5603da93dd3fea7fafe1e25 100644 (file)
 #define __MARU_BRILLCODEC_H__
 
 #include "qemu/osdep.h"
-#include "hw/pci/pci.h"
 #include "qemu/thread.h"
+#include "hw/pci/pci.h"
+
+#include "libavcodec/avcodec.h"
 
 #include "maru_brillcodec_plugin.h"
 
@@ -136,8 +138,8 @@ typedef struct DeviceMemEntry {
     QTAILQ_ENTRY(DeviceMemEntry) node;
 } DeviceMemEntry;
 
-QTAILQ_HEAD(codec_wq, DeviceMemEntry);
-extern union codec_wq codec_wq;
+QTAILQ_HEAD(Codec_wq, DeviceMemEntry);
+extern union Codec_wq codec_wq;
 
 extern DeviceMemEntry *entry[CODEC_CONTEXT_MAX];
 
index 25edb3272a063f8306be44cc66b18cc95491938a..db77dd7910062bf29ea4c4558bf478a793d9fa8d 100644 (file)
@@ -261,9 +261,13 @@ static const MemoryRegionOps brillcodec_mmio_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
+
+#define CODEC_DEVICE_PCI(obj) OBJECT_CHECK(MaruBrillCodecState, (obj), \
+                                        CODEC_DEVICE_NAME)
+
 static void brillcodec_initfn(PCIDevice *dev, Error **errp)
 {
-    MaruBrillCodecState *s = DO_UPCAST(MaruBrillCodecState, dev, dev);
+    MaruBrillCodecState *s = CODEC_DEVICE_PCI(dev);
     uint8_t *pci_conf = s->dev.config;
 
     LOG_INFO("device initialization.\n");
@@ -313,7 +317,7 @@ static void brillcodec_initfn(PCIDevice *dev, Error **errp)
 
 static void brillcodec_exitfn(PCIDevice *dev)
 {
-    MaruBrillCodecState *s = DO_UPCAST(MaruBrillCodecState, dev, dev);
+    MaruBrillCodecState *s = CODEC_DEVICE_PCI(dev);
     LOG_INFO("device exit\n");
 
     qemu_mutex_destroy(&s->context_mutex);
@@ -350,7 +354,7 @@ static void brillcodec_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_VIRTUAL_BRILL_CODEC;
     k->class_id = PCI_CLASS_OTHERS;
     dc->reset = brillcodec_reset;
-    device_class_set_props(dc,brillcodec_props);
+    device_class_set_props(dc, brillcodec_props);
     dc->desc = "Virtual new codec device for Tizen emulator";
 }
 
@@ -360,7 +364,6 @@ static TypeInfo codec_device_info = {
     .instance_size = sizeof(MaruBrillCodecState),
     .class_init    = brillcodec_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index 885628e5fc04bbf46c1cd21f19264c238ccdb112..71cc316b9cf9717d7a8acd3ffa8c5f537c3c5fd3 100644 (file)
@@ -45,8 +45,8 @@ extern void set_plugin_context(AVCodecContext *avctx, void *plugin_context);
 
 typedef struct CodecPlugin {
     char const          *name;
-    enum AVPixelFormat    pix_fmt;
-    enum AVPixelFormat    output_pix_fmt;
+    enum PixelFormat    pix_fmt;
+    enum PixelFormat    output_pix_fmt;
     bool                (*probe)(void);
     void                *(*setup)(AVCodecContext *, int , int);
     void                (*cleanup)(void *);
@@ -90,7 +90,6 @@ static inline CodecPlugin *probe_plugin(void) {
     return NULL;
 }
 
-#if 0 //AV hwaccel deprecated
 static inline bool check_av_hw_accel(enum AVCodecID id)
 {
     AVHWAccel *av_hw = NULL;
@@ -107,5 +106,5 @@ static inline bool check_av_hw_accel(enum AVCodecID id)
 
     return is_exist;
 }
-#endif //0 
+
 #endif //__MARU_BRILLCODEC_PLUGIN_H__
index a01afa5fb384d8eca5158c73401de41034339f4c..d992216e37d804a777f516978838d01ff10028f3 100644 (file)
@@ -364,7 +364,6 @@ static TypeInfo maru_camera_info = {
     .instance_size = sizeof(MaruCamState),
     .class_init    = maru_camera_pci_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index 26e76d0f9cc047a45918cd1c23c6bc16f80d3856..b725aa1d8931af2b1bd62bc278e04ac9f359c69a 100644 (file)
@@ -28,7 +28,7 @@
  * with Qt5 QImage class
  */
 
-#include <stdio.h>
+#include <QFileInfo>
 #include <QDirIterator>
 #include <QImageReader>
 #define QObject qemu_QObject
index 5754408b2ada5325980e17ac7766d289b0a5344a..000c578336b12617cad9fa4a635efdf780dbf24d 100644 (file)
@@ -28,8 +28,7 @@
  * with Qt5 QImage class
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator_common.h"
 #include "qemu/timer.h"
 #include "qemu/cutils.h"
 #include "sysemu/kvm.h"
index 84a14007e29198b6d0eb06d6014cf0781cb3572a..22924085b9dfafe3f013b08450d701c1eb1b5235 100644 (file)
@@ -1547,7 +1547,6 @@ static const TypeInfo maru_dtv_audio_info = {
     .instance_size = sizeof (MaruDtvAudioState),
     .class_init    = maru_dtv_audio_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
index 967576126e085c1d285fbac392377d9dec5c5614..ee1a3dbb7bf99251e82019cbbf3d791293375da2 100644 (file)
@@ -1068,11 +1068,9 @@ static TypeInfo maru_external_input_info = {
     .instance_size = sizeof(MaruExtInputState),
     .class_init    = maru_external_input_pci_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
+          { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+          { },
     },
-
 };
 
 static void maru_external_input_pci_register_types(void)
index fd949b8b6407cff4f7a6cabad3a973f16c15c697..f9ec9e01b9e1a2c1084659f80fb3aea9979ae60e 100644 (file)
  *
  */
 
-#include <stdio.h>
-#include <stddef.h>
-#include <pthread.h>
-
 #include "qemu/osdep.h"
 #include "qemu/thread.h"
-
 #include "exec/memory.h"
 #include "exec/memory-internal.h"
 #include "tizen/src/emulator.h"
@@ -43,6 +38,7 @@
 #include "qapi/qmp/qdict.h"
 #include "hw/maru_device_ids.h"
 #include "hw/qdev-properties.h"
+#include "hw/pci/maru_tuner.h"
 #include "maru_tuner.h"
 #include "ecs/ecs.h"
 #include "util/new_debug_ch.h"
@@ -1608,11 +1604,9 @@ static TypeInfo marutuner_info = {
     .instance_size = sizeof(MaruTunerState),
     .class_init = marutuner_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     },
-
 };
 
 static void tuner_register_types(void)
index 3e79410ca8b8247a614c6543eef57a34cdf038fa..8e937fb5b8e7fc95920111d5e7a40e284f363e83 100644 (file)
@@ -368,10 +368,10 @@ static enum PixelFormat maru_tuner_dec_get_format( AVCodecContext *dec_ctx,
     int i = 0;
     uint8_t flag_hwaccel = 0;
 
-    // if (!s->hwaccel_plugin ||
-    //     !check_av_hw_accel(dec_ctx->codec_id)) {
-    //     goto end;
-    // }
+    if (!s->hwaccel_plugin ||
+        !check_av_hw_accel(dec_ctx->codec_id)) {
+        goto end;
+    }
 
     /* Enumerate available formats */
     for(i = 0; pi_fmt[i] != PIX_FMT_NONE; i++)
@@ -524,9 +524,9 @@ int maru_tuner_dec_init_ctx(MaruTunerDecoderState* s, AVStream* stream)
     }
     LOG_TRACE("decoder name : %s\n", dec->long_name);
 
-    // if (check_av_hw_accel(dec_ctx->codec_id)) {
-    //     dec_ctx->thread_type &= ~FF_THREAD_SLICE;
-    // }
+    if (check_av_hw_accel(dec_ctx->codec_id)) {
+        dec_ctx->thread_type &= ~FF_THREAD_SLICE;
+    }
 
     /* init the decoder */
     ret = avcodec_open2(dec_ctx, dec, NULL);
@@ -569,7 +569,7 @@ static void pcm_save(int16_t *samples, int size)
 
 static uint8_t *resample_audio(AVCodecContext * avctx, AVFrame *samples, int *out_size)
 {
-    SwrContext *avr = NULL;
+    AVAudioResampleContext *avr = NULL;
     uint8_t *resample_audio = NULL;
     int buffer_size = 0, out_linesize = 0;
     int nb_samples = samples->nb_samples;
@@ -582,7 +582,7 @@ static uint8_t *resample_audio(AVCodecContext * avctx, AVFrame *samples, int *ou
     LOG_TRACE("sample_rate=%d\n", avctx->sample_rate);
 #endif
 
-    avr = swr_alloc();
+    avr = avresample_alloc_context();
     if (!avr) {
         LOG_SEVERE("failed to allocate avresample context\n");
         return NULL;
@@ -596,9 +596,9 @@ static uint8_t *resample_audio(AVCodecContext * avctx, AVFrame *samples, int *ou
     av_opt_set_int(avr, "out_sample_rate", avctx->sample_rate, 0);
 
     LOG_TRACE("open avresample context\n");
-    if (swr_init(avr) < 0) {
+    if (avresample_open(avr) < 0) {
         LOG_SEVERE("failed to open avresample context\n");
-        swr_free(&avr);
+        avresample_free(&avr);
         return NULL;
     }
 
@@ -614,15 +614,15 @@ static uint8_t *resample_audio(AVCodecContext * avctx, AVFrame *samples, int *ou
         return NULL;
     }
 
-    buffer_size = swr_convert(avr, &resample_audio,
+    buffer_size = avresample_convert(avr, &resample_audio,
         out_linesize, nb_samples,
         samples->data, samples->linesize[0],
         samples->nb_samples);
 
     LOG_TRACE("resample_audio out_size %d buffer_size %d\n", *out_size, buffer_size);
 
-    swr_close(avr);
-    swr_free(&avr);
+    avresample_close(avr);
+    avresample_free(&avr);
 
     return resample_audio;
 }
@@ -2433,11 +2433,9 @@ static TypeInfo tuner_decoder_device_info = {
     .instance_size = sizeof(MaruTunerDecoderState),
     .class_init    = maru_tuner_decoder_class_init,
     .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
+          { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+          { },
     },
-
 };
 
 static void tuner_decoder_register_types(void)
index 614762abced51541bd5ec3235aaa55624272ecb2..7e820424bec481eb5d302476caa6bc038c634d4c 100644 (file)
@@ -34,9 +34,7 @@
 */
 
 /// @cond
-#include <stdio.h>
-#include <sys/types.h>
-
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "sysemu/kvm.h"
 #include "hw/pci/pci.h"
@@ -52,8 +50,9 @@
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "libswscale/swscale.h"
-#include "libswresample/swresample.h"
+#include "libavresample/avresample.h"
 
+#include <pixman.h>
 
 /* Tuner Image */
 extern uint8_t tuner_video_power;
index ef4d01bce9355f8c71440ea9d6264727298eedc9..bbb43bc63f85daefe9faf046414d3c6c7fdc3e4e 100644 (file)
  *
  */
 
-#include <pthread.h>
-
 #include "qemu/osdep.h"
 #include "qemu/iov.h"
 #include "hw/maru_device_ids.h"
 #include "maru_virtio_nfc.h"
 #include "ecs/ecs.h"
+#include "ecs/ecs_internal.h"
 #include "hw/qdev-properties.h"
 #include "block/aio.h"
 #include "qemu/main-loop.h"
index ae6c170ff1c4861a02865e5cb2265f96653eae82..56ac1b5f97fd74a9a2c3c10efd168400a2eaef18 100644 (file)
@@ -35,7 +35,6 @@ extern "C" {
 
 #include "hw/virtio/virtio.h"
 
-
 enum request_cmd_nfc {
     request_nfc_get = 0,
     request_nfc_set,
index 570dc9faf4a92dee5b0565f97a1b843634ba18a7..4e244fd7d54345d125f62b0e5c007571e38a7dd0 100644 (file)
@@ -203,7 +203,7 @@ static Property virtio_touchscreen_pci_properties[] = {
 
 static void virtio_touchscreen_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOTouchscreenPCI *dev = VIRTIO_MARU_TOUCHSCREEN_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -241,18 +241,13 @@ static TypeInfo virtio_touchscreen_pci_info = {
     .instance_size = sizeof(VirtIOTouchscreenPCI),
     .instance_init = virtio_touchscreen_pci_instance_init,
     .class_init    = virtio_touchscreen_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-            { INTERFACE_PCIE_DEVICE },
-            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-            { }
-        },
 };
 
 /* virtio-maru-keyboard-pci */
 
 static void virtio_keyboard_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOKeyboardPCI *dev = VIRTIO_MARU_KEYBOARD_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -286,19 +281,13 @@ static TypeInfo virtio_keyboard_pci_info = {
     .instance_size = sizeof(VirtIOKeyboardPCI),
     .instance_init = virtio_keyboard_pci_instance_init,
     .class_init    = virtio_keyboard_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-esm-pci */
 
 static void virtio_esm_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOESMPCI *dev = VIRTIO_MARU_ESM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -332,19 +321,13 @@ static TypeInfo virtio_esm_pci_info = {
     .instance_size = sizeof(VirtIOESMPCI),
     .instance_init = virtio_esm_pci_instance_init,
     .class_init    = virtio_esm_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-hwkey-pci */
 
 static void virtio_hwkey_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOHWKeyPCI *dev = VIRTIO_MARU_HWKEY_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -378,19 +361,13 @@ static TypeInfo virtio_hwkey_pci_info = {
     .instance_size = sizeof(VirtIOHWKeyPCI),
     .instance_init = virtio_hwkey_pci_instance_init,
     .class_init    = virtio_hwkey_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-tablet-pci */
 
 static void virtio_tablet_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOTabletPCI *dev = VIRTIO_MARU_TABLET_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -424,12 +401,6 @@ static TypeInfo virtio_tablet_pci_info = {
     .instance_size = sizeof(VirtIOTabletPCI),
     .instance_init = virtio_tablet_pci_instance_init,
     .class_init    = virtio_tablet_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-evdi-pci */
@@ -440,7 +411,7 @@ static Property virtio_evdi_pci_properties[] = {
 
 static void virtio_evdi_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOEVDIPCI *dev = VIRTIO_MARU_EVDI_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -476,11 +447,6 @@ static TypeInfo virtio_evdi_pci_info = {
     .instance_size = sizeof(VirtIOEVDIPCI),
     .instance_init = virtio_evdi_pci_instance_init,
     .class_init    = virtio_evdi_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
 };
 
 /* virtio-maru-sensor-pci */
@@ -491,7 +457,7 @@ static Property virtio_sensor_pci_properties[] = {
 
 static void virtio_sensor_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOSENSORPCI *dev = VIRTIO_MARU_SENSOR_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -527,18 +493,13 @@ static TypeInfo virtio_sensor_pci_info = {
     .instance_size = sizeof(VirtIOSENSORPCI),
     .instance_init = virtio_sensor_pci_instance_init,
     .class_init    = virtio_sensor_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
 };
 
 /* virtio maru NFC */
 
 static void virtio_nfc_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIONFCPCI *dev = VIRTIO_MARU_NFC_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -572,11 +533,6 @@ static TypeInfo virtio_nfc_pci_info = {
     .instance_size = sizeof(VirtIONFCPCI),
     .instance_init = virtio_nfc_pci_instance_init,
     .class_init    = virtio_nfc_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
 };
 
 /* virtio-maru-jack-pci */
@@ -587,7 +543,7 @@ static Property virtio_jack_pci_properties[] = {
 
 static void virtio_jack_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOJACKPCI *dev = VIRTIO_MARU_JACK_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -623,19 +579,13 @@ static TypeInfo virtio_jack_pci_info = {
     .instance_size = sizeof(VirtIOJACKPCI),
     .instance_init = virtio_jack_pci_instance_init,
     .class_init    = virtio_jack_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-power-pci */
 
 static void virtio_power_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOPOWERPCI *dev = VIRTIO_MARU_POWER_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -669,19 +619,13 @@ static TypeInfo virtio_power_pci_info = {
     .instance_size = sizeof(VirtIOPOWERPCI),
     .instance_init = virtio_power_pci_instance_init,
     .class_init    = virtio_power_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-vmodem-pci */
 
 static void virtio_vmodem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIOVModemPCI *dev = VIRTIO_MARU_VMODEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -715,19 +659,13 @@ static TypeInfo virtio_vmodem_pci_info = {
     .instance_size = sizeof(VirtIOVModemPCI),
     .instance_init = virtio_vmodem_pci_instance_init,
     .class_init    = virtio_vmodem_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-
 };
 
 /* virtio-maru-rotary-pci */
 
 static void virtio_rotary_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
 {
-    object_property_set_bool(OBJECT(vpci_dev), true, "disable-modern", errp);
+    virtio_pci_disable_modern(vpci_dev);
 
     VirtIORotaryPCI *dev = VIRTIO_MARU_ROTARY_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
@@ -761,11 +699,6 @@ static TypeInfo virtio_rotary_pci_info = {
     .instance_size = sizeof(VirtIORotaryPCI),
     .instance_init = virtio_rotary_pci_instance_init,
     .class_init    = virtio_rotary_pci_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
 };
 
 static void maru_virtio_pci_register_types(void)
index 4710d4ebe17a8429c5a6b0af47f2672b9c944b5d..9deefe64a0f7ef5bfdd6830dcb2d3df8c907cea4 100644 (file)
@@ -255,13 +255,7 @@ static const TypeInfo virtio_device_info = {
     .name = TYPE_VIRTIO_MARU_POWER,
     .parent = TYPE_VIRTIO_DEVICE,
     .instance_size = sizeof(VirtIOPOWER),
-    .class_init = virtio_power_class_init,
-    .interfaces = (InterfaceInfo[]) {
-        { INTERFACE_PCIE_DEVICE },
-        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
-        { }
-    },
-    
+    .class_init = virtio_power_class_init,    
 };
 
 static void virtio_register_types(void)
index bf0c764cffa038f7582ecde4c6277717cd049bc0..05b1621d93687559266aaed9c31c4293ddd14e48 100644 (file)
@@ -40,6 +40,7 @@
 #include "maru_virtio_sensor.h"
 #include "debug_ch.h"
 #include "ecs/ecs.h"
+#include "ecs/ecs_internal.h"
 
 MULTI_DEBUG_CHANNEL(qemu, sensor);
 
index 1ca3ff9dfefb94d75be477542578c04da07e9653..b78443c9179803340bfc1c5b51b6570046011f35 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef _NS_EVENT_H_
 #define _NS_EVENT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 void ns_event_loop(int* keepRunning);
 
 void ns_run_in_event_loop(void (*func)());
@@ -8,5 +11,7 @@ void ns_run_in_event_loop(void (*func)());
 void ns_run_in_event_loop_with_bool(void (*func)(bool bArg), bool isTrue);
 
 void set_application_icon(char *path);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* _NS_EVENT_H_ */
index c9fe65aa182fa0a78e1b2cfaedec9ce63343be7a..b592e481b3b47f548c2223ad9229e63dd712929e 100644 (file)
 #include "mainwindow.h"
 #include "resource/ui_strings.h"
 #include "menu/sdbhelper.h"
-
-extern "C" {
 #include "util/ui_operations.h"
-
-void qt5_graphic_hw_invalidate(void);
-void req_set_sensor_accel_angle(int angle);
-}
+#include "qt5_supplement.h"
+#include "emul_state.h"
+#include "ecs/ecs_sensor.h"
 
 DisplayBase::DisplayBase(DisplayType *displayForm, QSize resolution, qreal scaleFactor,
     QWidget *w) : resolution(resolution), widget(w)
index f6883ff5927fb08792a36df8a6eacef91fa4d02a..1de2ddf0de36eda9dfa9c3d885861e08801216e3 100644 (file)
@@ -86,7 +86,6 @@ private:
     void* current;
     void* next;
     QMutex textureListMutex;
-    
 
     GLuint mtTexture;
     QMatrix4x4 mOrtho;
index 97c968ee32f6cf753b32ac63c1701d3d495fa2bb..3f16cd2185bcd8ff119ea8b3a4458654a1d74b6c 100644 (file)
 #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,
index 101d1ff199caffdda9ce8383f5dee45bb379afe3..13ecaf89ab1a3dafed2280e10f6f58325f60776b 100644 (file)
@@ -33,6 +33,7 @@
 #include "mainwindow.h"
 
 extern "C" {
+#include "emul_state.h"    
 #include "util/ui_operations.h"
 }
 
index 7250da9209b1a7a4ea25b77173c062ab90d3a6d4..0dcad5206f9d2b0b1cfb961db8eb9ae78977607b 100644 (file)
 #include "uiutil.h"
 
 extern "C" {
+#define QObject qemu_QObject
+#define QList qemu_QList
+#include "emulator.h"
 #include "util/ui_operations.h"
-
-void qt5_graphic_hw_update(void);
-// FIXME: To avoid very complex header inclusion chains
-void qemu_system_graceful_shutdown_request(unsigned int sec);
+#include "qt5_supplement.h"
+#undef QObject
+#undef QList
 }
 
 MainWindow::MainWindow(UiInformation *uiInfo, bool useGL, QWidget *parent) :
index 31819f4df61ae71cad6a2dd719b2799212ca9003..e4051c0bfeb6972f967fe8d8999d1cbfdccd0110 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "contextmenu.h"
 #include "resource/ui_strings.h"
-#include "emulator_common.h"
 #include "mainwindow.h"
 #include "uiutil.h"
 #include "menu/advancedmenuitem.h"
 #include "emul_state.h"
 
 extern "C" {
-// FIXME: To avoid very complex header inclusion chains
-void qemu_system_graceful_shutdown_request(unsigned int sec);
-void qemu_system_reset_request(void);
-#define MENU_ACTION_REBOOT      1
-void send_shutdown_request(int action);
-
 #define QObject qemu_QObject
-#include "util/net_helper.h"
+#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
 }
 
-#undef connect
-
 ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
 {
     this->parent = (MainWindow *)parent;
@@ -1189,7 +1184,7 @@ void ContextMenu::slotAbout()
 void ContextMenu::slotDeviceReset()
 {
     qDebug("System reset request.");
-    qemu_system_reset_request();
+    qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
     qDebug("Done for system reset request.");
 }
 
@@ -1201,7 +1196,7 @@ void ContextMenu::slotSystemReset()
     if (result == QMessageBox::Yes) {
         qDebug() << "Reboot.";
 
-        send_shutdown_request(MENU_ACTION_REBOOT);
+        send_shutdown_request(ECS_SYSTEM_ACTION_REBOOT);
 
         rebootTimer->start();
     } else {
index 2a8837cd6a997d8c879b738bb780dcc4a571a340..3fad2cac42f19f0afa83f83020ccc54d0e3c2509 100644 (file)
 #ifndef CONTEXTMENU_H
 #define CONTEXTMENU_H
 
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "qemu/typedefs.h"
-#undef QObject
-#undef QList
-
 #include <QtWidgets>
 
-#include "emulator_common.h"
 #include "detailedinfodialog.h"
 #include "aboutdialog.h"
 #include "screenshotdialog.h"
 
 class MainWindow;
 
-extern "C" {
-#include "emul_state.h"
-}
-
 #define CLOSE_POWER_KEY_INTERVAL 1200 /* milli-seconds */
 #define HARDWARE_REBOOT_INTERVAL 1000 /* milli-seconds */
 
index be5e7b7e3e03a52768bb665a8aae339a6ef75c5f..e9be457dd0b8855c606d39cc0c7599b4484dbdba 100644 (file)
@@ -34,6 +34,7 @@
 #include "resource/ui_strings.h"
 #include "screenshotview.h"
 #include "mainwindow.h"
+#include "emul_state.h"
 
 ScreenShotDialog::ScreenShotDialog(QWidget *parent) :
     QDialog(parent, Qt::Window)
index c4203b70aa49eb7f6a84fd3cb269feef7a6ddb8f..a8e386eb4468011a290e0b57db2591b14989809d 100644 (file)
 #include "resource/ui_strings.h"
 
 extern "C" {
-#include "qemu/osdep.h"
+#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
 }
 
 SdbHelper::SdbHelper(MainWindow *parent, DisplayBase *displaybase)
index 8d3a3aeb6ba8352ff6679fd2931f52e3cf177f9a..bb58705ead8aa862e5f542adabfa9ddc73cd1d4e 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
-#include "ui/console.h"
-
-#include "qt5.h"
+#include "emulator_common.h"
 #include "emul_state.h"
+#include "qt5.h"
 #include "qt5_supplement.h"
+#include "ui/console.h"
 #include "hw/pci/maru_brightness.h"
 #include "resource/ui_strings.h"
 
@@ -233,4 +232,4 @@ static void register_maru_qt5_app(void)
     qemu_display_register(&qemu_display_maru_qt5_app);
 }
 
-type_init(register_maru_qt5_app);
\ No newline at end of file
+type_init(register_maru_qt5_app);
index 89707d50b44a799f27622334ebd76dfb3886f251..690fe69b2115123361fa4e8cf3e8bc8a773fc80f 100644 (file)
 #ifndef __QT5_H__
 #define __QT5_H__
 
-#include <stdbool.h>
-
-#include "qemu/osdep.h"
-#include "sysemu/sysemu.h"
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void maru_qt5_display_fini(void);
 
 void set_display_pixel_density(int dpi);
 int get_display_pixel_density(void);
 
 void maru_qt5_set_force_legacy(bool isLegacy);
-
+#ifdef __cplusplus
+}
+#endif
 #endif // __QT5_H__
index bc3e44fd99a23ab1f4c695a455cc2d026953c922..63b35de3b48f4a2906113cdade8b0f8213987e9c 100644 (file)
  *
  */
 
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "qemu/osdep.h"
-#include "emul_state.h"
-#include "emulator_options.h"
-#undef QObject
-#undef QList
-}
 #include <QApplication>
 #include <QOpenGLContext>
 
@@ -49,6 +40,17 @@ extern "C" {
 #include "resource/ui_strings.h"
 #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
+}
+
 // XXX: all modules in ui/* are controlled by channel name "qt5_ui"
 DECLARE_DEBUG_CHANNEL(qt5_ui);
 
@@ -62,8 +64,8 @@ QApplication *qt5App = NULL;
 QOpenGLContext *qt5GLContext;
 bool isForceLegacy;
 
-static int argc = 1;
-static char *argv[2] = { NULL, NULL} ;
+static int argc = 0;
+static char *argv[0];
 
 #define MAX_DPY_BLANK_FRAME_CNT 10
 static unsigned int dpy_blank_cnt;
@@ -471,21 +473,16 @@ void qt5_early_prepare(bool isOnscreen)
             sfcFormat.setProfile(QSurfaceFormat::CoreProfile);
         }
         QSurfaceFormat::setDefaultFormat(sfcFormat);
-        qDebug("Called QSurfaceFormat::setDefaultFormat()");
     }
 
-    argv[0] = new char[12];
-    strcpy(argv[0], "qt5_msgbox");
     qt5App = new QApplication(argc, argv);
-    qDebug("Created new  QApplication");
+
     // add the path in the application's main() function,
     // right after the QApplication object is created.
     // TODO: consider a symbolic link
     qt5App->addLibraryPath(QDir::currentPath());
-    qDebug("Set  addLibraryPath to  QApplication");
 
     qInstallMessageHandler(qMessageOutput);
-    qDebug("Set  qInstallMessageHandler");
 #ifdef CONFIG_WIN32
     eventFilter = new EventFilter();
     qt5App->installNativeEventFilter(eventFilter);
index 5df4837408268a72a82a0ecf57eefe77a5a7fb9c..23a129562c29bf64ae3d99c05410ae88f44dffb2 100644 (file)
 #include <QScreen>
 #include <QRect>
 
-#include "emulator_common.h"
-
-#ifdef CONFIG_WIN32
-#include <windows.h>
-#elif defined (CONFIG_LINUX)
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#endif
-
 class UiUtil
 {
 public:
index 7ed6bb4134560630be7ce43a0027045d531a6d25..3f6c0bd3d452ca52013fa03c659371a5a929a20b 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
+#include "emulator.h"
+#include "emul_state.h"
+#include "qemu/option.h"
 #include "qemu/main-loop.h"
 #include "qemu/config-file.h"
 #include "hw/qdev.h"
 #include "qemu/event_notifier.h"
 #include "qapi/qmp/qstring.h"
 #include "sysemu/block-backend.h"
+#include "sysemu/sysemu.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/error.h"
@@ -42,8 +45,7 @@
 #include "fsdev/qemu-fsdev.h"
 #endif
 
-#include "emulator.h"
-#include "emul_state.h"
+#include "ecs/ecs.h"
 #include "device_hotplug.h"
 #include "ecs/ecs_hds.h"
 #include "hds.h"
index 538c4013b533abdfcb3a60c773f5ed77d0753911..669df169576b263c46208977c5be1704a7ddd589 100644 (file)
@@ -28,7 +28,9 @@
 
 #ifndef _MARU_DEVICE_HOTPLUG_H_
 #define _MARU_DEVICE_HOTPLUG_H_
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 enum command {
     ATTACH_HOST_KEYBOARD,
     DETACH_HOST_KEYBOARD,
@@ -44,5 +46,7 @@ void do_hotplug(int command, void *opaque, size_t size);
 
 bool is_host_keyboard_attached(void);
 bool is_sdcard_attached(void);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* _MARU_DEVICE_HOTPLUG_H_ */
index 4bda0540b19d1faf6215edddac61612d00872e57..efa9d776337a5acf4adfdf0fc1b8a10b78a960ac 100644 (file)
@@ -28,8 +28,7 @@
  *
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator.h"
 #include "qemu/thread.h"
 
 #ifdef CONFIG_WIN32
@@ -42,8 +41,7 @@
 #include "qemu/error-report.h"
 
 #include "error_handler.h"
-#include "emulator_common.h"
-#include "emulator.h"
+
 
 #ifdef CONFIG_QT
 #include "qt5_error_report.h"
index 783dd00dc3be2e8ce5bdcbd69502fb0dae11a683..ee67300b911d61eaa87a86f4de953abc27ac8131 100644 (file)
 
 #ifndef __ERROR_HANDLER_H__
 #define __ERROR_HANDLER_H__
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void init_error_handler(void);
 void enable_print_backtrace_at_normal_exit(void);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __ERROR_HANDLER_H__ */
index 95db8f896f21a6dd0f037535227760da0e9f137e..c665a1fe8fb642cc1ee1fde0bbbfe955f5ae424b 100644 (file)
 
 #define MAX_PKG_LIST        1024
 #define MAX_PATH_PKG_LIST   256
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void epi_init(void);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* _EXTRA_PKGS_INSTALL_ */
index cdcc585c0a96f5c5adc3faa7820bd941ed4337f2..c07e96277c469679e15c94c457c14f0901096fad 100644 (file)
  *
  */
 
-#include "hds.h"
+
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qapi/qapi-commands-misc.h"
 #include "hw/pci/pci.h"
+#include "hds.h"
 #include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(qemu, hds);
index 5980b1411fe733bd35a602c54ed5917d221869f5..3c99b7edfce16ec2bdfde0a21b8464b6736e8354 100644 (file)
@@ -37,8 +37,9 @@
 #define MAX_HDS_ID_LEN              32
 #define MAX_HDS_LIST_LEN            4096
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 enum hds_level {
     hds_level_normal = 0,
@@ -63,5 +64,7 @@ char *get_hds_lists(void);
 
 int hds_get_pci_available_slot_num(void);
 int hds_get_num_hidden_conn(void);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* _HDS_ */
index 5e0d7cc55177aa7b0a67451a8f5fd92914d17c1a..b12e22d8533bf2882bea57a0e4e4e11833f4d541 100644 (file)
  *
  */
 
+#include "emulator.h"
+#include "emul_state.h"
 #include "net_helper.h"
-
-#include "qemu/osdep.h"
 #include "qemu/sockets.h"
 #include "net/slirp.h"
 #include "block/nbd.h"
 #include "qemu/error-report.h"
 
-#include "emulator.h"
-#include "emulator_common.h"
-#include "emul_state.h"
 
 #include "hw/virtio/maru_virtio_input.h"
 #include "hw/maru_pm.h"
 #include "ecs/ecs.h"
+#include "ecs/ecs_internal.h"
 #include "new_debug_ch.h"
 #include "sysemu/runstate.h"
 
index dd3cc9ff6bd5c564908c3e5fbd0ce69205732e16..806fa551ce70663e805ff0b77f530275e8c5887b 100644 (file)
@@ -61,7 +61,9 @@
 
 #define SDB_GUEST_PORT  (START_VM_BASE_PORT + SDB_TCP_INDEX)
 #define GDB_GUEST_PORT  (START_VM_BASE_PORT + GDB_TCP_INDEX)
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void init_sdb_and_vm_base_port(void);
 int inet_strtoip(const char*  str, uint32_t  *ip);
 int socket_send(int fd, const void*  buf, int  buflen);
@@ -73,6 +75,8 @@ extern int emul_vm_base_socket;
 #define STATE_RUNNING 0
 #define STATE_SUSPEND 1
 void notify_all_sdb_clients(int state);
-
+#ifdef __cplusplus
+}
+#endif
 #endif
 
index d478155f282d3f306cb5eec3850dab422e7bedd7..cd3b28309d85d0d11aa833c5ec077465da134946 100644 (file)
 #ifndef __OSUTIL_H__
 #define __OSUTIL_H__
 
-#include "qemu/osdep.h"
 #include "emulator_common.h"
 
-#ifdef CONFIG_WIN32
-#include "sysemu/os-win32.h"
-#else
-#include "sysemu/os-posix.h"
-#endif
-
 #define ERR_SUCCESS 0
 #define ERR_NODEV   4   /* ACT_SDCARD_DETACH_FAIL. No sdcard attached. */
 #define ERR_BUSY    5   /* ACT_SDCARD_ATTACH_FAIL. Already sdcard attached. */
 #define ERR_NOENT   6   /* ACT_SDCARD_NO_ATTACH_FOUND. Other sdcard attached. */
 #define VMLOCK_FILE "vm.lock"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern const char *pac_tempfile;
 
 void make_vm_lock_os(gchar *vms_path);
@@ -100,5 +97,8 @@ static inline void get_java_path(const char **java_path)
 #endif
 }
 
+#ifdef __cplusplus
+}
+#endif
 #endif // __OS_UTIL_H__
 
index 56d44b8bb8042fc3f25c3dcc494d004bd207c1ba..665ffd08ec5be14b7ca262cf09b69a7943c3c5b4 100644 (file)
  *
  */
 
+#include "emulator_common.h"
 #include "qt5_error_report.h"
-#include <glib.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
 #include "debug_ch.h"
 #include "emul_state.h"
 
-#ifdef CONFIG_WIN32
-#include <stdio.h>
-#include <windows.h>
-#endif
-
 #define MAX_MESSAGE_LEN 2048
 
 MULTI_DEBUG_CHANNEL(qemu, qt5_msgbox);
index f1aecac3173b846bab13ccc0e07a28be19807f3e..f9e0a843dc36082cb0f36ed2ecc5873b3025b62c 100644 (file)
 #ifndef __ERROR_REPORT_H__
 #define __ERROR_REPORT_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum {
     NO_ICON = 0,
     INFORMATION_ICON = 1,
@@ -41,5 +45,7 @@ typedef enum {
 
 char *get_app_path(void);
 void start_qt5_msgbox(qt5_msgbox_icon icon, const char *message);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __ERROR_REPORT_H__ */
index a14169ef2ba605540bc1a4717e9ba66951a36e91..f03ccb444354d981de0f1671a0627cccad0ce7f3 100644 (file)
 
 #ifndef __TAP_HELPER_H__
 #define __TAP_HELPER_H__
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 void tap_create(char *);
-
+#ifdef __cplusplus
+}
+#endif
 #endif //__TAP_HELPER_H__
index 75f9cdf3ff2b2fc60475b75f79c0cafe7092aa13..9644fd781cbc5bddd45768a1d0d6fb46233476cc 100644 (file)
@@ -162,7 +162,7 @@ void do_mouse_event(int button_type, int event_type,
     }
 }
 
-void do_rotary_event(int32_t delta, int32_t type)
+void do_rotary_event(int delta, int type)
 {
     LOG_TRACE("rotaty event: delta(%d), type(%d)\n", delta, type);
     maru_rotary_event(delta, type);
index 910f1fb8d1082e8dd002945b1e9800cae2aebe91..a131bb6d9e4636b01ba585f7c1d733d8f9a2b14e 100644 (file)
 #ifndef __UI_OPERATIONS_H__
 #define __UI_OPERATIONS_H__
 
-#include "tizen/src/emulator_common.h"
-
 #define TIMEOUT_FOR_SHUTDOWN 10 /* seconds */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 void do_hw_key_event(int event_type, int keycode);
 void do_mouse_event(int button_type, int event_type,
     int origin_x, int origin_y, int x, int y, int z);
-void do_rotary_event(int32_t delta, int32_t type);
+void do_rotary_event(int delta, int type);
 void do_qt_keyboard_key_event(int event_type, int keycode);
-
+#ifdef __cplusplus
+}
+#endif
 #endif // __UI_OPERATIONS_H___
index 9b882d6836e7cad728fba5e7aaee0602ddfc649a..3413469db32a9fa7b2d3e2ba901d135f950685e6 100644 (file)
@@ -1,10 +1,6 @@
 ifeq ($(wildcard ../../config-host.mak),../../config-host.mak)
 include ../../config-host.mak
 
-# Set project directory one level above the Makefile directory. 
-#$(CURDIR) is a GNU make variable containing the path to the current working directory
-BUILD_PATH := $(realpath $(CURDIR))
-
 TARGET_EXE += qt5_msgbox$(EXESUF)
 
 ifdef CONFIG_QT
@@ -12,7 +8,6 @@ EMUL_DIR=../emulator
 
 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