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?
libpmem libpmem support
xkbcommon xkbcommon support
qt Qt5 UI
- hax HAX acceleration support
yagl YaGL device
yagl-stats YaGL stats
vigs VIGS device
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"
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
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
#TIZEN
echo "Qt support $qt"
-echo "HAX support $hax"
echo "YaGL support $yagl"
echo "YaGL stats $yagl_stats"
echo "VIGS support $vigs"
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)
} 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,
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
#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;
//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;
}
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;
}
}
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();
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);
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");
.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)
void vigs_fenceman_destroy(struct vigs_fenceman *fenceman)
{
+ if (fenceman == NULL)
+ return;
vigs_fenceman_reset(fenceman);
qemu_mutex_destroy(&fenceman->mutex);
g_free(fenceman);
void vigs_fenceman_reset(struct vigs_fenceman *fenceman)
{
struct vigs_fence_ack *ack, *tmp;
+ if (fenceman == NULL)
+ return;
qemu_mutex_lock(&fenceman->mutex);
#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;
GHashTableIter iter;
gpointer key, value;
+ if (server == NULL || server->initialized == false) {
+ return;
+ }
+
work_queue_wait(server->render_queue);
if (!server->initialized) {
GHashTableIter iter;
gpointer key, value;
+ if (server == NULL || server->initialized == false) {
+ return;
+ }
+
work_queue_wait(server->render_queue);
server->backend->batch_start(server->backend);
.class_size = sizeof(VirtioPCIClass),
.abstract = true,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
#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;
//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;
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);
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();
.instance_size = sizeof(YaGLState),
.class_init = yagl_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
{
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) {
assert(QLIST_EMPTY(&ps->threads));
yagl_object_map_destroy(ps->object_map);
+ ps->object_map = NULL;
g_free(ps);
{
struct yagl_process_state *ps, *next;
+ if (ss == NULL) {
+ return;
+ }
+
work_queue_wait(ss->render_queue);
QLIST_FOREACH_SAFE(ps, &ss->processes, entry, next) {
}
}
+#if defined(CONFIG_MARU)
LinkInfo *qmp_get_link(const char *name, Error **errp)
{
NetClientState *ncs[MAX_QUEUE_NUM];
}
return info;
}
+#endif
void net_cleanup(void)
{
*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)
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
}
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}
#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");
Error *main_loop_err = NULL;
Error *err = NULL;
bool list_data_dirs = false;
+#ifdef CONFIG_YAGL
+ static bool yagl_enabled = false;
+#endif /* CONFIG_YAGL */
+#ifdef CONFIG_VIGS
+ static bool vigs_enabled = false;
+ static char *vigs_backend = NULL;
+#endif /* CONFIG_VIGS */
char *dir, **dirs;
const char *mem_path = NULL;
bool have_custom_ram_size;
olist = qemu_find_opts("machine");
qemu_opts_parse_noisily(olist, "accel=kvm", false);
break;
+ case QEMU_OPTION_enable_yagl:
+#if defined(CONFIG_YAGL)
+ yagl_enabled = true;
+#else
+ fprintf(stderr, "YaGL openGLES passthrough support is disabled,"
+ " ignoring -enable-yagl\n");
+#endif
+ break;
+ case QEMU_OPTION_enable_vigs:
+#if defined(CONFIG_VIGS)
+ vigs_enabled = true;
+#else
+ fprintf(stderr, "VIGS support is disabled,"
+ " ignoring -enable-vigs\n");
+#endif
+ break;
+ case QEMU_OPTION_vigs_backend:
+#if defined(CONFIG_VIGS)
+ vigs_backend = g_strdup(optarg);
+#else
+ fprintf(stderr, "VIGS support is disabled,"
+ " ignoring -vigs-backend\n");
+#endif
+ break;
case QEMU_OPTION_M:
case QEMU_OPTION_machine:
olist = qemu_find_opts("machine");
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();
accel_setup_post(current_machine);
os_setup_post();
+#ifdef CONFIG_MARU
+ enable_print_backtrace_at_normal_exit();
+#endif
+
return;
}
--enable-yagl
--enable-vigs
--enable-qt
- --disable-libav
+ --enable-libav
--enable-libpng
- --disable-virtfs
+ --enable-virtfs
--disable-bzip2
--disable-curl
--disable-lzo
--disable-curses
--disable-xen
--disable-tpm
- --disable-sdl
--disable-sheepdog
--enable-debug
--enable-debug-info
--extra-ldflags=-static-libstdc++
--audio-drv-list=dsound
--winver=0x0600
+ --enable-sdl
--enable-hax"
# append platform specific options
--extra-ldflags=-rdynamic
--extra-ldflags=-Wl,-rpath,'\$\$ORIGIN'
--audio-drv-list=alsa
+ --enable-sdl
--enable-kvm
$CONFIGURE_APPEND
"
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)
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)
*
*/
-#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"
{
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;
}
}
#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)
goto fail;
}
- if (cli->sbuf._netlen == 0) {
+ if (cli->sbuff._netlen == 0) {
if (to_read_bytes < 4) {
return;
}
payloadsize = ntohl(payloadsize);
- cli->sbuf._netlen = payloadsize;
+ cli->sbuff._netlen = payloadsize;
LOG_TRACE("payload size: %ld\n", payloadsize);
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;
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);
mon = monitor_create();
if (NULL == mon) {
- LOG_SEVERE("monitor initialization failed.\n");
+ LOG_SEVERE("EcsMonitor initialization failed.\n");
ecs_close(cs);
return NULL;
}
#ifndef __ECS_H__
#define __ECS_H__
-#include "ecs_internal.h"
+#include "emulator_common.h"
#define COMMANDS_TYPE "type"
#define COMMANDS_DATA "data"
*
*/
-#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"
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;
*
*/
-#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"
#ifndef __ECS_HDS_H__
#define __ECS_HDS_H__
-#include "ecs.h"
+#include "ecs_internal.h"
#define ECS_HDS_HIDDEN_RESERVED 4
#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"
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 {
int keep_alive;
const char *type;
- sbuf sbuf;
+ ecsbuffer sbuff;
ECS_State *cs;
ECSJSONMessageParser parser;
#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"
*
*/
-#include "qemu/osdep.h"
-#include <stdbool.h>
+#include "emulator_common.h"
#include "hw/qdev.h"
#include "net/net.h"
#include "net/slirp.h"
#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);
*
*/
-#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"
#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;
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");
}
*
*/
-#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"
#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"
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);
#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"
*
*/
-#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);
}
return buf;
}
-extern BlockInfoList *qmp_query_block(Error **errp);
+
static void send_sdcard_status(void)
{
BlockInfoList *block_list, *info;
*
*/
-#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);
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) {
set_sensor_accel(accel, strlen(accel));
}
-#endif
static void _req_set_sensor_accel(int len, const char *data)
{
#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__ */
*
*/
-#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"
#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"
}
// 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
#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,
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);
void set_platform_default_home(const char *path);
void init_emul_state(void);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* __EMUL_STATE_H__ */
*
*/
-#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
#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__ */
#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__ */
*
*/
-#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"
#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__ */
*
*/
-#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
#include "emulator_common.h"
#include "emul_state.h"
-
#include "sensor.h"
#include "common.h"
#include "ecs/ecs_eventcast.h"
*
*/
-#include "qemu/osdep.h"
#include "emulator_common.h"
#include "emul_state.h"
#include "common.h"
.instance_size = sizeof(PCIDevice),
.class_init = tizen_vpci_host_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
* 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 */
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,
.instance_size = sizeof(BrightnessState),
.class_init = brightness_classinit,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
#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 */
} 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
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;
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;
}
*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;
}
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) {
#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"
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];
.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");
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);
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";
}
.instance_size = sizeof(MaruBrillCodecState),
.class_init = brillcodec_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
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 *);
return NULL;
}
-#if 0 //AV hwaccel deprecated
static inline bool check_av_hw_accel(enum AVCodecID id)
{
AVHWAccel *av_hw = NULL;
return is_exist;
}
-#endif //0
+
#endif //__MARU_BRILLCODEC_PLUGIN_H__
.instance_size = sizeof(MaruCamState),
.class_init = maru_camera_pci_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
* with Qt5 QImage class
*/
-#include <stdio.h>
+#include <QFileInfo>
#include <QDirIterator>
#include <QImageReader>
#define QObject qemu_QObject
* 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"
.instance_size = sizeof (MaruDtvAudioState),
.class_init = maru_dtv_audio_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
.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)
*
*/
-#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"
#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"
.instance_size = sizeof(MaruTunerState),
.class_init = marutuner_class_init,
.interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
{ INTERFACE_CONVENTIONAL_PCI_DEVICE },
{ }
},
-
};
static void tuner_register_types(void)
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++)
}
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);
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;
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;
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;
}
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;
}
.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)
*/
/// @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"
#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;
*
*/
-#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"
#include "hw/virtio/virtio.h"
-
enum request_cmd_nfc {
request_nfc_get = 0,
request_nfc_set,
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);
.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);
.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);
.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);
.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);
.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 */
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);
.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 */
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);
.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);
.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 */
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);
.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);
.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);
.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);
.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)
.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)
#include "maru_virtio_sensor.h"
#include "debug_ch.h"
#include "ecs/ecs.h"
+#include "ecs/ecs_internal.h"
MULTI_DEBUG_CHANNEL(qemu, sensor);
#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)());
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_ */
#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)
void* current;
void* next;
QMutex textureListMutex;
-
GLuint mtTexture;
QMatrix4x4 mOrtho;
#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,
#include "mainwindow.h"
extern "C" {
+#include "emul_state.h"
#include "util/ui_operations.h"
}
#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) :
#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;
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.");
}
if (result == QMessageBox::Yes) {
qDebug() << "Reboot.";
- send_shutdown_request(MENU_ACTION_REBOOT);
+ send_shutdown_request(ECS_SYSTEM_ACTION_REBOOT);
rebootTimer->start();
} else {
#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 */
#include "resource/ui_strings.h"
#include "screenshotview.h"
#include "mainwindow.h"
+#include "emul_state.h"
ScreenShotDialog::ScreenShotDialog(QWidget *parent) :
QDialog(parent, Qt::Window)
#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)
*
*/
-#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"
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);
#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__
*
*/
-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>
#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);
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;
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);
#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:
*
*/
-#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"
#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"
#ifndef _MARU_DEVICE_HOTPLUG_H_
#define _MARU_DEVICE_HOTPLUG_H_
-
+#ifdef __cplusplus
+extern "C" {
+#endif
enum command {
ATTACH_HOST_KEYBOARD,
DETACH_HOST_KEYBOARD,
bool is_host_keyboard_attached(void);
bool is_sdcard_attached(void);
-
+#ifdef __cplusplus
+}
+#endif
#endif /* _MARU_DEVICE_HOTPLUG_H_ */
*
*/
-#include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "emulator.h"
#include "qemu/thread.h"
#ifdef CONFIG_WIN32
#include "qemu/error-report.h"
#include "error_handler.h"
-#include "emulator_common.h"
-#include "emulator.h"
+
#ifdef CONFIG_QT
#include "qt5_error_report.h"
#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__ */
#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_ */
*
*/
-#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);
#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,
int hds_get_pci_available_slot_num(void);
int hds_get_num_hidden_conn(void);
-
+#ifdef __cplusplus
+}
+#endif
#endif /* _HDS_ */
*
*/
+#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"
#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);
#define STATE_RUNNING 0
#define STATE_SUSPEND 1
void notify_all_sdb_clients(int state);
-
+#ifdef __cplusplus
+}
+#endif
#endif
#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);
#endif
}
+#ifdef __cplusplus
+}
+#endif
#endif // __OS_UTIL_H__
*
*/
+#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);
#ifndef __ERROR_REPORT_H__
#define __ERROR_REPORT_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
NO_ICON = 0,
INFORMATION_ICON = 1,
char *get_app_path(void);
void start_qt5_msgbox(qt5_msgbox_icon icon, const char *message);
-
+#ifdef __cplusplus
+}
+#endif
#endif /* __ERROR_REPORT_H__ */
#ifndef __TAP_HELPER_H__
#define __TAP_HELPER_H__
-
+#ifdef __cplusplus
+extern "C" {
+#endif
void tap_create(char *);
-
+#ifdef __cplusplus
+}
+#endif
#endif //__TAP_HELPER_H__
}
}
-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);
#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___
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
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