qemu-img.o: qemu-img-cmds.h
++<<<<<<< HEAD
+tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
+ qemu-timer-common.o main-loop.o notify.o \
+ iohandler.o cutils.o iov.o async.o
+tools-obj-$(CONFIG_POSIX) += compatfd.o
+tools-obj-$(CONFIG_HAX_BACKEND) += hax-stub.o
+
+qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
+qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
+qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
++=======
+ qemu-img$(EXESUF): qemu-img.o $(block-obj-y) libqemuutil.a libqemustub.a
+ qemu-nbd$(EXESUF): qemu-nbd.o $(block-obj-y) libqemuutil.a libqemustub.a
+ qemu-io$(EXESUF): qemu-io.o cmd.o $(block-obj-y) libqemuutil.a libqemustub.a
++>>>>>>> test1.5
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
endif # CONFIG_SOFTMMU
+ # Workaround for http://gcc.gnu.org/PR55489, see configure.
+ %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
+
nested-vars += obj-y
+# Makefile for TIZEN-maru
+ifdef CONFIG_MARU
+include $(SRC_PATH)/tizen/src/Makefile.tizen
+endif
+##
+
+ifdef CONFIG_BUILD_YAGL
+
+# YaGL
+QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl_inc
+
+$(call set-vpath, $(SRC_PATH)/hw/yagl_apis/egl: \
+ $(SRC_PATH)/hw/yagl_apis/gles: \
+ $(SRC_PATH)/hw/yagl_apis/gles1: \
+ $(SRC_PATH)/hw/yagl_apis/gles2: \
+ $(SRC_PATH)/hw/yagl_drivers/egl_glx: \
+ $(SRC_PATH)/hw/yagl_drivers/egl_wgl: \
+ $(SRC_PATH)/hw/yagl_drivers/gles_ogl: \
+ $(SRC_PATH)/hw/yagl_drivers/gles1_ogl: \
+ $(SRC_PATH)/hw/yagl_drivers/gles2_ogl)
+
+obj-y += yagl_device.o
+obj-y += yagl_log.o
+obj-y += yagl_process.o
+obj-y += yagl_thread.o
+obj-y += yagl_server.o
+obj-y += yagl_ref.o
+obj-y += yagl_mem.o
+obj-y += yagl_mem_egl.o
+obj-y += yagl_mem_gl.o
+obj-y += yagl_mem_transfer.o
+obj-y += yagl_event.o
+obj-y += yagl_handle_gen.o
+obj-y += yagl_dyn_lib.o
+obj-y += yagl_api.o
+obj-y += yagl_vector.o
+obj-y += yagl_avl.o
+obj-y += yagl_range_list.o
+obj-y += yagl_egl_driver.o
+obj-y += yagl_gles_driver.o
+obj-y += yagl_gles1_driver.o
+obj-y += yagl_gles2_driver.o
+obj-y += yagl_egl_interface.o
+obj-y += yagl_client_interface.o
+obj-y += yagl_client_context.o
+obj-y += yagl_resource.o
+obj-y += yagl_resource_list.o
+obj-y += yagl_object.o
+obj-y += yagl_namespace.o
+obj-y += yagl_sharegroup.o
+obj-y += yagl_stats.o
+obj-y += yagl_compiled_transfer.o
+obj-y += yagl_egl_native_config.o
+obj-y += yagl_egl_surface_attribs.o
+# EGL api
+obj-y += yagl_egl_api.o
+obj-y += yagl_egl_api_ps.o
+obj-y += yagl_egl_api_ts.o
+obj-y += yagl_egl_calls.o
+obj-y += yagl_egl_display.o
+obj-y += yagl_egl_config.o
+obj-y += yagl_egl_surface.o
+obj-y += yagl_egl_context.o
+obj-y += yagl_egl_validate.o
+obj-y += yagl_host_egl_calls.o
+# GLES common api
+obj-y += yagl_gles_context.o
+obj-y += yagl_gles_array.o
+obj-y += yagl_gles_buffer.o
+obj-y += yagl_gles_texture.o
+obj-y += yagl_gles_framebuffer.o
+obj-y += yagl_gles_renderbuffer.o
+obj-y += yagl_gles_texture_unit.o
+obj-y += yagl_gles_validate.o
+obj-y += yagl_host_gles_calls.o
+# GLESv1_CM api
+obj-y += yagl_gles1_calls.o
+obj-y += yagl_host_gles1_calls.o
+# GLESv2 api
+obj-y += yagl_gles2_api.o
+obj-y += yagl_gles2_api_ps.o
+obj-y += yagl_gles2_api_ts.o
+obj-y += yagl_gles2_calls.o
+obj-y += yagl_gles2_context.o
+obj-y += yagl_gles2_shader.o
+obj-y += yagl_gles2_program.o
+obj-y += yagl_gles2_validate.o
+obj-y += yagl_host_gles2_calls.o
+# EGL GLX driver
+ifdef CONFIG_YAGL_EGL_GLX
+obj-y += yagl_egl_glx.o
+endif
+# EGL WGL driver
+ifdef CONFIG_YAGL_EGL_WGL
+obj-y += yagl_egl_wgl.o
+endif
+# GLES OpenGL common driver
+obj-y += yagl_gles_ogl.o
+# GLESv1_CM OpenGL driver
+obj-y += yagl_gles1_ogl.o
+# GLESv2 OpenGL driver
+obj-y += yagl_gles2_ogl.o
+
+endif
+
# This resolves all nested paths, so it must come last
include $(SRC_PATH)/Makefile.objs
s->type = FTYPE_FILE;
++<<<<<<< HEAD
+#ifndef CONFIG_MARU
+ if (flags & BDRV_O_RDWR) {
+ access_flags = GENERIC_READ | GENERIC_WRITE;
+ } else {
+ access_flags = GENERIC_READ;
+ }
+
+ overlapped = FILE_ATTRIBUTE_NORMAL;
+ if (flags & BDRV_O_NOCACHE)
+ overlapped |= FILE_FLAG_NO_BUFFERING;
+ if (!(flags & BDRV_O_CACHE_WB))
+ overlapped |= FILE_FLAG_WRITE_THROUGH;
+ s->hfile = CreateFile(filename,
+ access_flags,
++=======
+ opts = qemu_opts_create_nofail(&raw_runtime_opts);
+ qemu_opts_absorb_qdict(opts, options, &local_err);
+ if (error_is_set(&local_err)) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ ret = -EINVAL;
+ goto fail;
+ }
+
+ filename = qemu_opt_get(opts, "filename");
+
+ raw_parse_flags(flags, &access_flags, &overlapped);
+
+ if ((flags & BDRV_O_NATIVE_AIO) && aio == NULL) {
+ aio = win32_aio_init();
+ if (aio == NULL) {
+ ret = -EINVAL;
+ goto fail;
+ }
+ }
+
+ s->hfile = CreateFile(filename, access_flags,
++>>>>>>> test1.5
FILE_SHARE_READ, NULL,
OPEN_EXISTING, overlapped, NULL);
- if (s->hfile == INVALID_HANDLE_VALUE) {
+ if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();
- if (err == ERROR_ACCESS_DENIED)
- return -EACCES;
- return -1;
+ if (err == ERROR_ACCESS_DENIED) {
+ ret = -EACCES;
+ } else {
+ ret = -EINVAL;
+ }
+ goto fail;
}
++<<<<<<< HEAD
+#else
+#include <errno.h>
+ int open_flags = O_BINARY;
+ open_flags &= ~O_ACCMODE;
+ if (flags & BDRV_O_RDWR) {
+ open_flags |= O_RDWR;
+ } else {
+ open_flags |= O_RDONLY;
+ }
+
+ /* Use O_DSYNC for write-through caching, no flags for write-back caching,
+ * and O_DIRECT for no caching. */
+ /*
+ if ((flags & BDRV_O_NOCACHE)) {
+ open_flags |= O_DIRECT;
+ }
+ if (!(flags & BDRV_O_CACHE_WB)) {
+ open_flags |= O_DSYNC;
+ }
+ */
+
+ int ret = qemu_open(filename, open_flags, 0644);
+ if (ret < 0) {
+ error_report("raw_open failed(%d) \n", ret);
+ return -errno;
+ }
+ s->hfile = (HANDLE)_get_osfhandle(ret);
+
+#endif
+ return 0;
++=======
+ if (flags & BDRV_O_NATIVE_AIO) {
+ ret = win32_aio_attach(aio, s->hfile);
+ if (ret < 0) {
+ CloseHandle(s->hfile);
+ goto fail;
+ }
+ s->aio = aio;
+ }
+
+ ret = 0;
+ fail:
+ qemu_opts_del(opts);
+ return ret;
++>>>>>>> test1.5
}
- static int raw_read(BlockDriverState *bs, int64_t sector_num,
- uint8_t *buf, int nb_sectors)
+ static BlockDriverAIOCB *raw_aio_readv(BlockDriverState *bs,
+ int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
+ BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
- OVERLAPPED ov;
- DWORD ret_count;
- int ret;
- int64_t offset = sector_num * 512;
- int count = nb_sectors * 512;
-
- memset(&ov, 0, sizeof(ov));
- ov.Offset = offset;
- ov.OffsetHigh = offset >> 32;
- ret = ReadFile(s->hfile, buf, count, &ret_count, &ov);
- if (!ret)
- return ret_count;
- if (ret_count == count)
- ret_count = 0;
- return ret_count;
+ if (s->aio) {
+ return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov,
+ nb_sectors, cb, opaque, QEMU_AIO_READ);
+ } else {
+ return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors,
+ cb, opaque, QEMU_AIO_READ);
+ }
}
- static int raw_write(BlockDriverState *bs, int64_t sector_num,
- const uint8_t *buf, int nb_sectors)
+ static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,
+ int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
+ BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
- OVERLAPPED ov;
- DWORD ret_count;
- int ret;
- int64_t offset = sector_num * 512;
- int count = nb_sectors * 512;
-
- memset(&ov, 0, sizeof(ov));
- ov.Offset = offset;
- ov.OffsetHigh = offset >> 32;
- ret = WriteFile(s->hfile, buf, count, &ret_count, &ov);
- if (!ret)
- return ret_count;
- if (ret_count == count)
- ret_count = 0;
- return ret_count;
+ if (s->aio) {
+ return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov,
+ nb_sectors, cb, opaque, QEMU_AIO_WRITE);
+ } else {
+ return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors,
+ cb, opaque, QEMU_AIO_WRITE);
+ }
}
- static int raw_flush(BlockDriverState *bs)
+ static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
- int ret;
-
- ret = FlushFileBuffers(s->hfile);
- if (ret == 0) {
- return -EIO;
- }
-
- return 0;
+ return paio_submit(bs, s->hfile, 0, NULL, 0, cb, opaque, QEMU_AIO_FLUSH);
}
static void raw_close(BlockDriverState *bs)
}
s->type = find_device_type(bs, filename);
++<<<<<<< HEAD
+#ifndef CONFIG_MARU
+ if (flags & BDRV_O_RDWR) {
+ access_flags = GENERIC_READ | GENERIC_WRITE;
+ } else {
+ access_flags = GENERIC_READ;
+ }
+ create_flags = OPEN_EXISTING;
+
+ overlapped = FILE_ATTRIBUTE_NORMAL;
+ if (flags & BDRV_O_NOCACHE)
+ overlapped |= FILE_FLAG_NO_BUFFERING;
+ if (!(flags & BDRV_O_CACHE_WB))
+ overlapped |= FILE_FLAG_WRITE_THROUGH;
+
+ s->hfile = CreateFile(filename,
+ access_flags,
++=======
+ raw_parse_flags(flags, &access_flags, &overlapped);
+
+ create_flags = OPEN_EXISTING;
+
+ s->hfile = CreateFile(filename, access_flags,
++>>>>>>> test1.5
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);
- if (s->hfile == INVALID_HANDLE_VALUE) {
+ if (s->hfile == INVALID_HANDLE_VALUE) {
int err = GetLastError();
if (err == ERROR_ACCESS_DENIED)
}
}
++<<<<<<< HEAD
+#ifdef CONFIG_MARU
+extern int start_simple_client(char* msg);
+extern char* maru_convert_path(char* msg, const char *path);
+#endif
+
+static bool do_check_io_limits(BlockIOLimit *io_limits)
++=======
+ static bool do_check_io_limits(BlockIOLimit *io_limits, Error **errp)
++>>>>>>> test1.5
{
bool bps_flag;
bool iops_flag;
error_report("warning: disabling copy_on_read on readonly drive");
}
- ret = bdrv_open(dinfo->bdrv, file, bdrv_flags, drv);
+ ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv);
+ bs_opts = NULL;
+
if (ret < 0) {
++<<<<<<< HEAD
+ error_report("could not open disk image %s: %s",
+ file, strerror(-ret));
+
+#ifdef CONFIG_MARU
+ const char _msg[] = "Failed to load disk file from the following path. Check if the file is corrupted or missing.\n\n";
+ char* err_msg = NULL;
+ err_msg = maru_convert_path((char*)_msg, file);
+ start_simple_client(err_msg);
+ if (err_msg) {
+ g_free(err_msg);
+ }
+#endif
+
++=======
+ if (ret == -EMEDIUMTYPE) {
+ error_report("could not open disk image %s: not in %s format",
+ file ?: dinfo->id, drv->format_name);
+ } else {
+ error_report("could not open disk image %s: %s",
+ file ?: dinfo->id, strerror(-ret));
+ }
++>>>>>>> test1.5
goto err;
}
xfs=""
vhost_net="no"
+ vhost_scsi="no"
kvm="no"
+hax="no"
gprof="no"
debug_tcg="no"
debug="no"
trace_file="trace"
spice=""
rbd=""
- smartcard=""
smartcard_nss=""
+ libusb=""
usb_redir=""
++<<<<<<< HEAD
+opengl=""
+efence="no"
+yagl="no"
+yagl_stats="no"
++=======
+ glx=""
++>>>>>>> test1.5
zlib="yes"
guest_agent="yes"
+ want_tools="yes"
libiscsi=""
coroutine=""
seccomp=""
++<<<<<<< HEAD
+gl="yes"
+
+# for TIZEN-maru
+maru="no"
+shm="no"
+#
++=======
+ glusterfs=""
+ virtio_blk_data_plane=""
+ gtk=""
+ gtkabi="2.0"
+ tpm="no"
+ libssh2=""
++>>>>>>> test1.5
# parse CC options first
for opt do
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
audio_possible_drivers="$audio_possible_drivers fmod"
fi
++<<<<<<< HEAD
+# fix linking error on Ubuntu 13.04
+ libs_qga="-lrt $libs_qga"
++=======
+ QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers $QEMU_INCLUDES"
++>>>>>>> test1.5
;;
esac
;;
--enable-vhost-net) vhost_net="yes"
;;
++<<<<<<< HEAD
+ --enable-efence) efence="yes"
+ ;;
+ --disable-efence) efence="no"
+ ;;
+ --enable-yagl) yagl="yes"
+ ;;
+ --disable-yagl) yagl="no"
+ ;;
+ --enable-yagl-stats) yagl_stats="yes"
+ ;;
+ --disable-yagl-stats) yagl_stats="no"
+ ;;
+ --disable-opengl) opengl="no"
++=======
+ --disable-vhost-scsi) vhost_scsi="no"
;;
- --enable-opengl) opengl="yes"
+ --enable-vhost-scsi) vhost_scsi="yes"
+ ;;
+ --disable-glx) glx="no"
++>>>>>>> test1.5
+ ;;
+ --enable-glx) glx="yes"
;;
--disable-rbd) rbd="no"
;;
;;
--disable-seccomp) seccomp="no"
;;
++<<<<<<< HEAD
+# for TIZEN-maru
+ --enable-maru) maru="yes"
+ ;;
+ --enable-shm) shm="yes"
+ ;;
+#
++=======
+ --disable-glusterfs) glusterfs="no"
+ ;;
+ --enable-glusterfs) glusterfs="yes"
+ ;;
+ --disable-virtio-blk-data-plane) virtio_blk_data_plane="no"
+ ;;
+ --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes"
+ ;;
+ --disable-gtk) gtk="no"
+ ;;
+ --enable-gtk) gtk="yes"
+ ;;
+ --with-gtkabi=*) gtkabi="$optarg"
+ ;;
+ --enable-tpm) tpm="yes"
+ ;;
+ --disable-libssh2) libssh2="no"
+ ;;
+ --enable-libssh2) libssh2="yes"
+ ;;
++>>>>>>> test1.5
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
echo " --enable-rbd enable building the rados block device (rbd)"
echo " --disable-libiscsi disable iscsi support"
echo " --enable-libiscsi enable iscsi support"
++<<<<<<< HEAD
+echo " --enable-efence enable Electic Fence"
+echo " --disable-efence disable Electic Fence"
+echo " --enable-yagl enable YaGL device"
+echo " --disable-yagl disable YaGL device"
+echo " --enable-yagl-stats enable YaGL stats"
+echo " --disable-yagl-stats disable YaGL stats"
+echo " --disable-smartcard disable smartcard support"
+echo " --enable-smartcard enable smartcard support"
++=======
++>>>>>>> test1.5
echo " --disable-smartcard-nss disable smartcard nss support"
echo " --enable-smartcard-nss enable smartcard nss support"
+ echo " --disable-libusb disable libusb (for usb passthrough)"
+ echo " --enable-libusb enable libusb (for usb passthrough)"
echo " --disable-usb-redir disable usb network redirection support"
echo " --enable-usb-redir enable usb network redirection support"
echo " --disable-guest-agent disable building of the QEMU Guest Agent"
echo " --enable-seccomp enables seccomp support"
echo " --with-coroutine=BACKEND coroutine backend. Supported options:"
echo " gthread, ucontext, sigaltstack, windows"
+ echo " --enable-glusterfs enable GlusterFS backend"
+ echo " --disable-glusterfs disable GlusterFS backend"
+ echo " --enable-gcov enable test coverage analysis with gcov"
+ echo " --gcov=GCOV use specified gcov [$gcov_tool]"
+ echo " --enable-tpm enable TPM support"
+ echo " --disable-libssh2 disable ssh block device support"
+ echo " --enable-libssh2 enable ssh block device support"
echo ""
+# for TIZEN-maru
+echo "TIZEN-maru options:"
+echo " --enable-maru enable maru board"
+echo " --enable-shm enable shared memory for framebuffer"
echo "NOTE: The object files are built at the place where configure is launched"
exit 1
fi
cat > $TMPC <<EOF
#include <signal.h>
#include <time.h>
++<<<<<<< HEAD
+/* Fix linking error on Ubuntu 13.04
+int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); }
+*/
+int main(void) { return timer_gettime(CLOCK_REALTIME, NULL); }
++=======
+ int main(void) {
+ timer_create(CLOCK_REALTIME, NULL, NULL);
+ return clock_gettime(CLOCK_REALTIME, NULL);
+ }
++>>>>>>> test1.5
EOF
if compile_prog "" "" ; then
echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "nss used $smartcard_nss"
+ echo "libusb $libusb"
echo "usb net redir $usb_redir"
++<<<<<<< HEAD
+echo "OpenGL support $opengl"
+echo "EFence support $efence"
+echo "YaGL support $yagl"
+echo "YaGL stats $yagl_stats"
++=======
+ echo "GLX support $glx"
++>>>>>>> test1.5
echo "libiscsi support $libiscsi"
echo "build guest agent $guest_agent"
echo "seccomp support $seccomp"
- echo "coroutine backend $coroutine_backend"
+ echo "coroutine backend $coroutine"
+ echo "GlusterFS support $glusterfs"
+ echo "virtio-blk-data-plane $virtio_blk_data_plane"
+ echo "gcov $gcov_tool"
+ echo "gcov enabled $gcov"
+ echo "TPM support $tpm"
+ echo "libssh2 support $libssh2"
+ echo "TPM passthrough $tpm_passthrough"
+ echo "QOM debugging $qom_cast_debug"
+# for TIZEN-maru
+echo "TIZEN-maru support $maru"
+echo "TIZEN-maru shared framebuffer support $shm"
+#
+
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
echo "CONFIG_SPICE=y" >> $config_host_mak
fi
++<<<<<<< HEAD
+if test "$efence" = "yes" ; then
+ echo "CONFIG_EFENCE=y" >> $config_host_mak
+fi
+
+if test "$yagl" = "yes" ; then
+ echo "CONFIG_YAGL=y" >> $config_host_mak
+ if test "$linux" = "yes" ; then
+ echo "CONFIG_YAGL_EGL_GLX=y" >> $config_host_mak
+ elif test "$mingw32" = "yes" ; then
+ echo "CONFIG_YAGL_EGL_WGL=y" >> $config_host_mak
+ else
+ echo "ERROR: YaGL is not available on $targetos"
+ exit 1
+ fi
+fi
+
+if test "$yagl_stats" = "yes" ; then
+ echo "CONFIG_YAGL_STATS=y" >> $config_host_mak
+fi
+
+if test "$smartcard" = "yes" ; then
+ echo "CONFIG_SMARTCARD=y" >> $config_host_mak
+fi
+
++=======
++>>>>>>> test1.5
if test "$smartcard_nss" = "yes" ; then
echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
;;
esac
++<<<<<<< HEAD
+# for TIZEN-maru
+if test "$maru" = "yes" ; then
+ echo "CONFIG_MARU=y" >> $config_host_mak
+fi
+if test "$shm" = "yes" ; then
+ echo "CONFIG_USE_SHM=y" >> $config_host_mak
+fi
+if test "$gl" = "yes" ; then
+ echo "CONFIG_GL_BACKEND=y" >> $config_host_mak
+fi
++=======
+ # TPM passthrough support?
+ if test "$tpm" = "yes"; then
+ echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
+ if test "$tpm_passthrough" = "yes"; then
+ echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak
+ fi
+ fi
+
++>>>>>>> test1.5
# use default implementation for tracing backend-specific routines
trace_default=yes
echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
if test "$trace_default" = "yes"; then
echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
fi
+if test "$hax" = "yes" ; then
+ if test "$mingw32" = "yes" ; then
+ echo "CONFIG_HAX_BACKEND=y" >> $config_host_mak
+ elif test "$darwin" = "yes" ; then
+ echo "CONFIG_HAX_BACKEND=y" >> $config_host_mak
+ else
+ hax="no"
+ fi
+fi
+ if test "$tcg_interpreter" = "yes"; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
+ elif test "$ARCH" = "sparc64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES"
+ elif test "$ARCH" = "s390x" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES"
+ elif test "$ARCH" = "x86_64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES"
+ else
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
+ fi
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES"
+
echo "TOOLS=$tools" >> $config_host_mak
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
}
++<<<<<<< HEAD
+case "$cpu" in
+ i386|x86_64)
+ echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak
+ ;;
+esac
+
+echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
+echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
+echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
+echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
++=======
++>>>>>>> test1.5
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
target_arch_name="`upper $TARGET_ARCH`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
i386|x86_64)
echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak
esac
++<<<<<<< HEAD
+if test "$hax" = "yes" ; then
+ if test "$target_softmmu" = "yes" ; then
+ case "$target_arch2" in
+ i386|x86_64)
+ echo "CONFIG_HAX=y" >> $config_target_mak
+ ;;
+ *)
+ echo "CONFIG_NO_HAX=y" >> $config_target_mak
+ ;;
+ esac
+ else
+ echo "CONFIG_NO_HAX=y" >> $config_target_mak
+ fi
+fi
+if test "$gl" = "yes" ; then
+ case "$target_arch2" in
+ i386|x86_64|arm)
+ echo "CONFIG_GL=y" >> $config_target_mak
+ if test "$mingw32" = "yes" ; then
+ echo "LIBS+=-lopengl32 -lglu32" >> $config_target_mak
+ elif test "$darwin" = "yes" ; then
+ echo "LIBS+=-framework OpenGL -framework AGL " >> $config_target_mak
+ else
+ echo "LIBS+=-lGLU -ldl" >> $config_target_mak
+ fi
+ ;;
+ *)
+ echo "CONFIG_NO_GL=y" >> $config_target_mak
+ ;;
+ esac
+fi
+if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
+ echo "CONFIG_PSERIES=y" >> $config_target_mak
+fi
++=======
++>>>>>>> test1.5
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
fi
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
- includes=""
ldflags=""
++<<<<<<< HEAD
+if test "$tcg_interpreter" = "yes"; then
+ includes="-I\$(SRC_PATH)/tcg/tci $includes"
+elif test "$ARCH" = "sparc64" ; then
+ includes="-I\$(SRC_PATH)/tcg/sparc $includes"
+elif test "$ARCH" = "s390x" ; then
+ includes="-I\$(SRC_PATH)/tcg/s390 $includes"
+elif test "$ARCH" = "x86_64" ; then
+ includes="-I\$(SRC_PATH)/tcg/i386 $includes"
+else
+ includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
+fi
+includes="-I\$(SRC_PATH)/tcg $includes"
+
+if test "$linux" = "yes" ; then
+ includes="-I\$(SRC_PATH)/linux-headers $includes"
+fi
+
+if test "$target_user_only" = "yes" ; then
+ libdis_config_mak=libdis-user/config.mak
+else
+ libdis_config_mak=libdis/config.mak
+fi
+
+if test "$efence" = "yes" ; then
+ echo "CONFIG_BUILD_WITH_EFENCE=y" >> $config_target_mak
+ echo "LIBS+=-lefence" >> $config_target_mak
+fi
+
+if test "$yagl" = "yes" ; then
+ echo "CONFIG_BUILD_YAGL=y" >> $config_target_mak
+fi
+
++=======
++>>>>>>> test1.5
for i in $ARCH $TARGET_BASE_ARCH ; do
case "$i" in
alpha)
;;
esac
++<<<<<<< HEAD
+if test "$target_softmmu" = "yes" ; then
+ case "$TARGET_BASE_ARCH" in
+ arm)
+ cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
+ ;;
+ lm32)
+ cflags="-DHAS_AUDIO $cflags"
+ ;;
+ i386|mips|ppc)
+ cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
+ ;;
+ esac
+fi
+
++=======
++>>>>>>> test1.5
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
*/
#include "config.h"
#include "cpu.h"
- #include "disas.h"
+ #include "disas/disas.h"
#include "tcg.h"
++<<<<<<< HEAD
+#include "hax.h"
+#include "qemu-barrier.h"
+#include "qtest.h"
++=======
+ #include "qemu/atomic.h"
+ #include "sysemu/qtest.h"
++>>>>>>> test1.5
- int tb_invalidated_flag;
-
- //#define CONFIG_DEBUG_EXEC
-
- bool qemu_cpu_has_work(CPUArchState *env)
+ bool qemu_cpu_has_work(CPUState *cpu)
{
- return cpu_has_work(env);
+ return cpu_has_work(cpu);
}
void cpu_loop_exit(CPUArchState *env)
volatile sig_atomic_t exit_request;
+/*
+ * QEMU emulate can happens because of MMIO or emulation mode, i.e. non-PG mode,
+ * when it's because of MMIO, the MMIO, the interrupt should not be emulated,
+ * because MMIO is emulated for only one instruction now and then back to
+ * HAX kernel
+ */
+int need_handle_intr_request(CPUArchState *env)
+{
+#ifdef CONFIG_HAX
+ if (!hax_enabled() || hax_vcpu_emulation_mode(env))
+ return env->interrupt_request;
+ return 0;
+#else
+ return env->interrupt_request;
+#endif
+}
+
+
int cpu_exec(CPUArchState *env)
{
- #ifdef TARGET_PPC
CPUState *cpu = ENV_GET_CPU(env);
+ #if !(defined(CONFIG_USER_ONLY) && \
+ (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X)))
+ CPUClass *cc = CPU_GET_CLASS(cpu);
#endif
int ret, interrupt_request;
TranslationBlock *tb;
}
}
+#ifdef CONFIG_HAX
+ if (hax_enabled() && !hax_vcpu_exec(env))
+ longjmp(env->jmp_env, 1);
+#endif
+
next_tb = 0; /* force lookup of first TB */
for(;;) {
++<<<<<<< HEAD
+ interrupt_request = need_handle_intr_request(env);
++=======
+ interrupt_request = cpu->interrupt_request;
++>>>>>>> test1.5
if (unlikely(interrupt_request)) {
if (unlikely(env->singlestep_enabled & SSTEP_NOIRQ)) {
/* Mask out external interrupts for this step. */
!(env->hflags & HF_SMM_MASK)) {
cpu_svm_check_intercept_param(env, SVM_EXIT_SMI,
0);
++<<<<<<< HEAD
+ env->interrupt_request &= ~CPU_INTERRUPT_SMI;
+#ifdef CONFIG_HAX
+ if (hax_enabled())
+ env->hax_vcpu->resync = 1;
+#endif
+ do_smm_enter(env);
+ next_tb = 0;
+ } else if ((interrupt_request & CPU_INTERRUPT_NMI) &&
+ !(env->hflags2 & HF2_NMI_MASK)) {
+ env->interrupt_request &= ~CPU_INTERRUPT_NMI;
++=======
+ cpu->interrupt_request &= ~CPU_INTERRUPT_SMI;
+ do_smm_enter(env);
+ next_tb = 0;
+ } else if ((interrupt_request & CPU_INTERRUPT_NMI) &&
+ !(env->hflags2 & HF2_NMI_MASK)) {
+ cpu->interrupt_request &= ~CPU_INTERRUPT_NMI;
++>>>>>>> test1.5
env->hflags2 |= HF2_NMI_MASK;
do_interrupt_x86_hardirq(env, EXCP02_NMI, 1);
next_tb = 0;
next_tb = 0;
cpu_loop_exit(env);
}
+ break;
+ }
+ default:
+ break;
}
}
++<<<<<<< HEAD
+ env->current_tb = NULL;
+#ifdef CONFIG_HAX
+ if (hax_enabled() && hax_stop_emulation(env))
+ cpu_loop_exit(env);
+#endif
+
++=======
+ cpu->current_tb = NULL;
++>>>>>>> test1.5
/* reset soft MMU for next block (it can currently
only be set by a memory fault) */
} /* for(;;) */
/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"
++<<<<<<< HEAD
+#include "monitor.h"
+#include "sysemu.h"
+#include "gdbstub.h"
+#include "dma.h"
+#include "kvm.h"
+#include "hax.h"
++=======
+ #include "monitor/monitor.h"
+ #include "sysemu/sysemu.h"
+ #include "exec/gdbstub.h"
+ #include "sysemu/dma.h"
+ #include "sysemu/kvm.h"
++>>>>>>> test1.5
#include "qmp-commands.h"
- #include "qemu-thread.h"
- #include "cpus.h"
- #include "qtest.h"
- #include "main-loop.h"
- #include "bitmap.h"
+ #include "qemu/thread.h"
+ #include "sysemu/cpus.h"
+ #include "sysemu/qtest.h"
+ #include "qemu/main-loop.h"
+ #include "qemu/bitmap.h"
#ifndef _WIN32
- #include "compatfd.h"
+ #include "qemu/compatfd.h"
#endif
#ifdef CONFIG_LINUX
static bool cpu_thread_is_idle(CPUArchState *env)
{
- if (env->stop || env->queued_work_first) {
+ CPUState *cpu = ENV_GET_CPU(env);
+
+ if (cpu->stop || cpu->queued_work_first) {
return false;
}
- if (env->stopped || !runstate_is_running()) {
+ if (cpu->stopped || !runstate_is_running()) {
return true;
}
++<<<<<<< HEAD
+ if (!env->halted || qemu_cpu_has_work(env) ||
+ kvm_async_interrupts_enabled() || hax_enabled()) {
++=======
+ if (!cpu->halted || qemu_cpu_has_work(cpu) ||
+ kvm_async_interrupts_enabled()) {
++>>>>>>> test1.5
return false;
}
return true;
fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
exit(1);
}
+/* The cpu thread cannot catch it reliably when shutdown the guest on Mac.
+ * We can double check it and resend it
+ */
+#ifdef CONFIG_DARWIN
+ if (!exit_request)
+ cpu_signal(0);
+#endif
#else /* _WIN32 */
- if (!qemu_cpu_is_self(env)) {
- SuspendThread(cpu->hThread);
+ if (!qemu_cpu_is_self(cpu)) {
+ CONTEXT tcgContext;
+
+ if (SuspendThread(cpu->hThread) == (DWORD)-1) {
+ fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__,
+ GetLastError());
+ exit(1);
+ }
+
+ /* On multi-core systems, we are not sure that the thread is actually
+ * suspended until we can get the context.
+ */
+ tcgContext.ContextFlags = CONTEXT_CONTROL;
+ while (GetThreadContext(cpu->hThread, &tcgContext) != 0) {
+ continue;
+ }
+
cpu_signal(0);
- ResumeThread(cpu->hThread);
+
+ if (ResumeThread(cpu->hThread) == (DWORD)-1) {
+ fprintf(stderr, "qemu:%s: GetLastError:%lu\n", __func__,
+ GetLastError());
+ exit(1);
+ }
}
#endif
}
}
}
- static void qemu_tcg_init_vcpu(void *_env)
+ static void qemu_tcg_init_vcpu(CPUState *cpu)
{
++<<<<<<< HEAD
+ CPUArchState *env = _env;
+ CPUState *cpu = ENV_GET_CPU(env);
+
+#ifdef CONFIG_HAX
+ if (hax_enabled())
+ hax_init_vcpu(env);
+#endif
++=======
++>>>>>>> test1.5
/* share a single thread for all cpus with TCG */
if (!tcg_cpu_thread) {
cpu->thread = g_malloc0(sizeof(QemuThread));
CONFIG_VERSATILE_PCI=y
CONFIG_VERSATILE_I2C=y
++<<<<<<< HEAD
+CONFIG_SOUND=y
++=======
+ CONFIG_SDHCI=y
++>>>>>>> test1.5
#include "tcg.h"
#include "hw/hw.h"
#include "hw/qdev.h"
++<<<<<<< HEAD
+#include "osdep.h"
+#include "kvm.h"
+#include "hax.h"
+#include "hw/xen.h"
+#include "qemu-timer.h"
+#include "memory.h"
+#include "exec-memory.h"
++=======
+ #include "qemu/osdep.h"
+ #include "sysemu/kvm.h"
+ #include "hw/xen/xen.h"
+ #include "qemu/timer.h"
+ #include "qemu/config-file.h"
+ #include "exec/memory.h"
+ #include "sysemu/dma.h"
+ #include "exec/address-spaces.h"
++>>>>>>> test1.5
#if defined(CONFIG_USER_ONLY)
#include <qemu.h>
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
- #include <sys/param.h>
- #if __FreeBSD_version >= 700104
- #define HAVE_KINFO_GETVMMAP
- #define sigqueue sigqueue_freebsd /* avoid redefinition */
- #include <sys/time.h>
- #include <sys/proc.h>
- #include <machine/profile.h>
- #define _KERNEL
- #include <sys/user.h>
- #undef _KERNEL
- #undef sigqueue
- #include <libutil.h>
- #endif
- #endif
#else /* !CONFIG_USER_ONLY */
- #include "xen-mapcache.h"
+ #include "sysemu/xen-mapcache.h"
#include "trace.h"
#endif
+ #include "exec/cpu-all.h"
- #include "cputlb.h"
+ #include "exec/cputlb.h"
+ #include "translate-all.h"
- #define WANT_EXEC_OBSOLETE
- #include "exec-obsolete.h"
+ #include "exec/memory-internal.h"
- //#define DEBUG_TB_INVALIDATE
- //#define DEBUG_FLUSH
//#define DEBUG_UNASSIGNED
-
- /* make various TB consistency checks */
- //#define DEBUG_TB_CHECK
-
- //#define DEBUG_IOPORT
//#define DEBUG_SUBPAGE
#if !defined(CONFIG_USER_ONLY)
}
#endif
- /* add the tb in the target page and protect it if necessary */
- static inline void tb_alloc_page(TranslationBlock *tb,
- unsigned int n, tb_page_addr_t page_addr)
+ void cpu_exec_init_all(void)
{
- PageDesc *p;
- #ifndef CONFIG_USER_ONLY
- bool page_already_protected;
- #endif
-
- tb->page_addr[n] = page_addr;
- p = page_find_alloc(page_addr >> TARGET_PAGE_BITS, 1);
- tb->page_next[n] = p->first_tb;
- #ifndef CONFIG_USER_ONLY
- page_already_protected = p->first_tb != NULL;
- #endif
- p->first_tb = (TranslationBlock *)((uintptr_t)tb | n);
- invalidate_page_bitmap(p);
-
- #if defined(TARGET_HAS_SMC) || 1
-
- #if defined(CONFIG_USER_ONLY)
- if (p->flags & PAGE_WRITE) {
- target_ulong addr;
- PageDesc *p2;
- int prot;
-
- /* force the host page as non writable (writes will have a
- page fault + mprotect overhead) */
- page_addr &= qemu_host_page_mask;
- prot = 0;
- for(addr = page_addr; addr < page_addr + qemu_host_page_size;
- addr += TARGET_PAGE_SIZE) {
-
- p2 = page_find (addr >> TARGET_PAGE_BITS);
- if (!p2)
- continue;
- prot |= p2->flags;
- p2->flags &= ~PAGE_WRITE;
- }
- mprotect(g2h(page_addr), qemu_host_page_size,
- (prot & PAGE_BITS) & ~PAGE_WRITE);
- #ifdef DEBUG_TB_INVALIDATE
- printf("protecting code page: 0x" TARGET_FMT_lx "\n",
- page_addr);
- #endif
- }
- #else
- /* if some code is already present, then the pages are already
- protected. So we handle the case where only the first TB is
- allocated in a physical page */
- if (!page_already_protected) {
- tlb_protect_code(page_addr);
- }
+ #if !defined(CONFIG_USER_ONLY)
+ qemu_mutex_init(&ram_list.mutex);
+ memory_map_init();
+ io_mem_init();
#endif
-
- #endif /* TARGET_HAS_SMC */
}
- /* add a new TB and link it to the physical page tables. phys_page2 is
- (-1) to indicate that only one page contains the TB. */
- void tb_link_page(TranslationBlock *tb,
- tb_page_addr_t phys_pc, tb_page_addr_t phys_page2)
- {
- unsigned int h;
- TranslationBlock **ptb;
-
- /* Grab the mmap lock to stop another thread invalidating this TB
- before we are done. */
- mmap_lock();
- /* add in the physical hash table */
- h = tb_phys_hash_func(phys_pc);
- ptb = &tb_phys_hash[h];
- tb->phys_hash_next = *ptb;
- *ptb = tb;
+ #if !defined(CONFIG_USER_ONLY)
- /* add in the page list */
- tb_alloc_page(tb, 0, phys_pc & TARGET_PAGE_MASK);
- if (phys_page2 != -1)
- tb_alloc_page(tb, 1, phys_page2);
- else
- tb->page_addr[1] = -1;
+ static int cpu_common_post_load(void *opaque, int version_id)
+ {
+ CPUState *cpu = opaque;
- tb->jmp_first = (TranslationBlock *)((uintptr_t)tb | 2);
- tb->jmp_next[0] = NULL;
- tb->jmp_next[1] = NULL;
+ /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the
+ version_id is increased. */
+ cpu->interrupt_request &= ~0x01;
+ tlb_flush(cpu->env_ptr, 1);
- /* init original jump addresses */
- if (tb->tb_next_offset[0] != 0xffff)
- tb_reset_jump(tb, 0);
- if (tb->tb_next_offset[1] != 0xffff)
- tb_reset_jump(tb, 1);
+ return 0;
+ }
- #ifdef DEBUG_TB_CHECK
- tb_page_check();
+ static const VMStateDescription vmstate_cpu_common = {
+ .name = "cpu_common",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .post_load = cpu_common_post_load,
+ .fields = (VMStateField []) {
+ VMSTATE_UINT32(halted, CPUState),
+ VMSTATE_UINT32(interrupt_request, CPUState),
+ VMSTATE_END_OF_LIST()
+ }
+ };
+ #else
+ #define vmstate_cpu_common vmstate_dummy
#endif
- mmap_unlock();
- }
++<<<<<<< HEAD
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
+/* check whether the given addr is in TCG generated code buffer or not */
+bool is_tcg_gen_code(uintptr_t tc_ptr)
+{
+ /* This can be called during code generation, code_gen_buffer_size
+ is used instead of code_gen_ptr for upper boundary checking */
+ return (tc_ptr >= (uintptr_t)code_gen_buffer &&
+ tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size));
+}
+#endif
+
+/* find the TB 'tb' such that tb[0].tc_ptr <= tc_ptr <
+ tb[1].tc_ptr. Return NULL if not found */
+TranslationBlock *tb_find_pc(uintptr_t tc_ptr)
++=======
+ CPUState *qemu_get_cpu(int index)
++>>>>>>> test1.5
{
- int m_min, m_max, m;
- uintptr_t v;
- TranslationBlock *tb;
+ CPUArchState *env = first_cpu;
+ CPUState *cpu = NULL;
- if (nb_tbs <= 0)
- return NULL;
- if (tc_ptr < (uintptr_t)code_gen_buffer ||
- tc_ptr >= (uintptr_t)code_gen_ptr) {
- return NULL;
- }
- /* binary search (cf Knuth) */
- m_min = 0;
- m_max = nb_tbs - 1;
- while (m_min <= m_max) {
- m = (m_min + m_max) >> 1;
- tb = &tbs[m];
- v = (uintptr_t)tb->tc_ptr;
- if (v == tc_ptr)
- return tb;
- else if (tc_ptr < v) {
- m_max = m - 1;
- } else {
- m_min = m + 1;
+ while (env) {
+ cpu = ENV_GET_CPU(env);
+ if (cpu->cpu_index == index) {
+ break;
}
+ env = env->next_cpu;
}
- return &tbs[m_max];
- }
- static void tb_reset_jump_recursive(TranslationBlock *tb);
+ return env ? cpu : NULL;
+ }
- static inline void tb_reset_jump_recursive2(TranslationBlock *tb, int n)
+ void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *data)
{
- TranslationBlock *tb1, *tb_next, **ptb;
- unsigned int n1;
-
- tb1 = tb->jmp_next[n];
- if (tb1 != NULL) {
- /* find head of list */
- for(;;) {
- n1 = (uintptr_t)tb1 & 3;
- tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3);
- if (n1 == 2)
- break;
- tb1 = tb1->jmp_next[n1];
- }
- /* we are now sure now that tb jumps to tb1 */
- tb_next = tb1;
-
- /* remove tb from the jmp_first list */
- ptb = &tb_next->jmp_first;
- for(;;) {
- tb1 = *ptb;
- n1 = (uintptr_t)tb1 & 3;
- tb1 = (TranslationBlock *)((uintptr_t)tb1 & ~3);
- if (n1 == n && tb1 == tb)
- break;
- ptb = &tb1->jmp_next[n1];
- }
- *ptb = tb->jmp_next[n];
- tb->jmp_next[n] = NULL;
-
- /* suppress the jump to next tb in generated code */
- tb_reset_jump(tb, n);
+ CPUArchState *env = first_cpu;
- /* suppress jumps in the tb on which we could have jumped */
- tb_reset_jump_recursive(tb_next);
+ while (env) {
+ func(ENV_GET_CPU(env), data);
+ env = env->next_cpu;
}
}
xen_ram_alloc(new_block->offset, size, mr);
} else if (kvm_enabled()) {
/* some s390/kvm configurations have special constraints */
- new_block->host = kvm_vmalloc(size);
+ new_block->host = kvm_ram_alloc(size);
} else {
++<<<<<<< HEAD
+ new_block->host = qemu_vmalloc(size);
+#ifdef CONFIG_HAX
+ /*
+ * In Hax, the qemu allocate the virtual address, and HAX kernel
+ * populate the memory with physical memory. Currently we have no
+ * paging, so user should make sure enough free memory in advance
+ */
+ if (hax_enabled())
+ {
+ int ret;
+ ret = hax_populate_ram((uint64_t)new_block->host, size);
+ if (ret < 0)
+ {
+ fprintf(stderr, "Hax failed to populate ram\n");
+ exit(-1);
+ }
+ }
+#endif
++=======
+ new_block->host = qemu_anon_ram_alloc(size);
++>>>>>>> test1.5
}
- qemu_madvise(new_block->host, size, QEMU_MADV_MERGEABLE);
+ memory_try_enable_merging(new_block->host, size);
}
}
new_block->length = size;
if (s->ops->init(&s->ctx) < 0) {
fprintf(stderr, "Virtio-9p Failed to initialize fs-driver with id:%s"
++<<<<<<< HEAD
+ " and export path:%s\n", conf->fsdev_id, s->ctx.fs_root);
+#ifdef CONFIG_MARU
+ const char _msg[] = "Failed to find the file sharing path. Check if the path is correct or not.\n\n";
+ char* err_msg = NULL;
+ err_msg = maru_convert_path((char*)_msg, s->ctx.fs_root);
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, err_msg);
+ if (err_msg) {
+ g_free(err_msg);
+ }
+#endif
+ exit(1);
++=======
+ " and export path:%s\n", s->fsconf.fsdev_id, s->ctx.fs_root);
+ return -1;
++>>>>>>> test1.5
}
if (v9fs_init_worker_threads() < 0) {
fprintf(stderr, "worker thread initialization failed\n");
++<<<<<<< HEAD
+hw-obj-y = usb/ ide/
+hw-obj-y += loader.o
+hw-obj-$(CONFIG_VIRTIO) += virtio-console.o
+hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci.o
+hw-obj-$(CONFIG_VIRTIO_PCI) += virtio-pci-new.o
+hw-obj-$(CONFIG_VIRTIO) += virtio-transport.o
+hw-obj-$(CONFIG_VIRTIO) += virtio-mmio.o
+hw-obj-y += fw_cfg.o
+hw-obj-$(CONFIG_PCI) += pci.o pci_bridge.o pci_bridge_dev.o
+hw-obj-$(CONFIG_PCI) += msix.o msi.o
+hw-obj-$(CONFIG_PCI) += shpc.o
+hw-obj-$(CONFIG_PCI) += slotid_cap.o
+hw-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
+hw-obj-$(CONFIG_PCI) += ioh3420.o xio3130_upstream.o xio3130_downstream.o
+hw-obj-y += watchdog.o
+hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
+hw-obj-$(CONFIG_ECC) += ecc.o
+hw-obj-$(CONFIG_NAND) += nand.o
+hw-obj-$(CONFIG_PFLASH_CFI01) += pflash_cfi01.o
+hw-obj-$(CONFIG_PFLASH_CFI02) += pflash_cfi02.o
+
+hw-obj-$(CONFIG_M48T59) += m48t59.o
+hw-obj-$(CONFIG_ESCC) += escc.o
+hw-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o
+
+hw-obj-$(CONFIG_SERIAL) += serial.o
+hw-obj-$(CONFIG_PARALLEL) += parallel.o
+hw-obj-$(CONFIG_I8254) += i8254_common.o i8254.o
+hw-obj-$(CONFIG_PCSPK) += pcspk.o
+hw-obj-$(CONFIG_PCKBD) += pckbd.o
+hw-obj-$(CONFIG_FDC) += fdc.o
+hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o
+hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o
+hw-obj-$(CONFIG_DMA) += dma.o
+hw-obj-$(CONFIG_I82374) += i82374.o
+hw-obj-$(CONFIG_HPET) += hpet.o
+hw-obj-$(CONFIG_APPLESMC) += applesmc.o
+hw-obj-$(CONFIG_SMARTCARD) += ccid-card-passthru.o
+hw-obj-$(CONFIG_SMARTCARD_NSS) += ccid-card-emulated.o
+hw-obj-$(CONFIG_I8259) += i8259_common.o i8259.o
+
+# PPC devices
+hw-obj-$(CONFIG_PREP_PCI) += prep_pci.o
+hw-obj-$(CONFIG_I82378) += i82378.o
+# Mac shared devices
+hw-obj-$(CONFIG_MACIO) += macio.o
+hw-obj-$(CONFIG_CUDA) += cuda.o
+hw-obj-$(CONFIG_ADB) += adb.o
+hw-obj-$(CONFIG_MAC_NVRAM) += mac_nvram.o
+hw-obj-$(CONFIG_MAC_DBDMA) += mac_dbdma.o
+# OldWorld PowerMac
+hw-obj-$(CONFIG_HEATHROW_PIC) += heathrow_pic.o
+hw-obj-$(CONFIG_GRACKLE_PCI) += grackle_pci.o
+# NewWorld PowerMac
+hw-obj-$(CONFIG_UNIN_PCI) += unin_pci.o
+hw-obj-$(CONFIG_DEC_PCI) += dec_pci.o
+# PowerPC E500 boards
+hw-obj-$(CONFIG_PPCE500_PCI) += ppce500_pci.o
+
+# MIPS devices
+hw-obj-$(CONFIG_PIIX4) += piix4.o
+hw-obj-$(CONFIG_G364FB) += g364fb.o
+hw-obj-$(CONFIG_JAZZ_LED) += jazz_led.o
+
+# Xilinx devices
+hw-obj-$(CONFIG_XILINX) += xilinx_intc.o
+hw-obj-$(CONFIG_XILINX) += xilinx_timer.o
+hw-obj-$(CONFIG_XILINX) += xilinx_uartlite.o
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axidma.o
+hw-obj-$(CONFIG_XILINX_AXI) += xilinx_axienet.o
+hw-obj-$(CONFIG_XILINX_AXI) += stream.o
+
+# PKUnity SoC devices
+hw-obj-$(CONFIG_PUV3) += puv3_intc.o
+hw-obj-$(CONFIG_PUV3) += puv3_ost.o
+hw-obj-$(CONFIG_PUV3) += puv3_gpio.o
+hw-obj-$(CONFIG_PUV3) += puv3_pm.o
+hw-obj-$(CONFIG_PUV3) += puv3_dma.o
+
+# ARM devices
+hw-obj-$(CONFIG_ARM_TIMER) += arm_timer.o
+hw-obj-$(CONFIG_PL011) += pl011.o
+hw-obj-$(CONFIG_PL022) += pl022.o
+hw-obj-$(CONFIG_PL031) += pl031.o
+hw-obj-$(CONFIG_PL041) += pl041.o lm4549.o
+hw-obj-$(CONFIG_PL050) += pl050.o
+hw-obj-$(CONFIG_PL061) += pl061.o
+hw-obj-$(CONFIG_PL080) += pl080.o
+hw-obj-$(CONFIG_PL110) += pl110.o
+hw-obj-$(CONFIG_PL181) += pl181.o
+hw-obj-$(CONFIG_PL190) += pl190.o
+hw-obj-$(CONFIG_PL310) += arm_l2x0.o
+hw-obj-$(CONFIG_VERSATILE_PCI) += versatile_pci.o
+hw-obj-$(CONFIG_VERSATILE_I2C) += versatile_i2c.o
+hw-obj-$(CONFIG_CADENCE) += cadence_uart.o
+hw-obj-$(CONFIG_CADENCE) += cadence_ttc.o
+hw-obj-$(CONFIG_CADENCE) += cadence_gem.o
+hw-obj-$(CONFIG_XGMAC) += xgmac.o
+
+# PCI watchdog devices
+hw-obj-$(CONFIG_PCI) += wdt_i6300esb.o
+
+hw-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
+
+# PCI network cards
+hw-obj-$(CONFIG_NE2000_PCI) += ne2000.o
+hw-obj-$(CONFIG_EEPRO100_PCI) += eepro100.o
+hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
+hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
+hw-obj-$(CONFIG_E1000_PCI) += e1000.o
+hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
+
+hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
+hw-obj-$(CONFIG_LAN9118) += lan9118.o
+hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o
+hw-obj-$(CONFIG_OPENCORES_ETH) += opencores_eth.o
+
+# SCSI layer
+hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
+hw-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o
+hw-obj-$(CONFIG_ESP) += esp.o
+hw-obj-$(CONFIG_ESP_PCI) += esp-pci.o
+
+hw-obj-y += sysbus.o isa-bus.o
+hw-obj-y += qdev-addr.o
+
+# VGA
+hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
+hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
+hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
+hw-obj-$(CONFIG_VMWARE_VGA) += vmware_vga.o
+hw-obj-$(CONFIG_VMMOUSE) += vmmouse.o
+hw-obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
+
+hw-obj-$(CONFIG_RC4030) += rc4030.o
+hw-obj-$(CONFIG_DP8393X) += dp8393x.o
+hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
+hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
+
+hw-obj-y += null-machine.o
+
+# Sound
+sound-obj-y =
+sound-obj-$(CONFIG_SB16) += sb16.o
+sound-obj-$(CONFIG_ES1370) += es1370.o
+sound-obj-$(CONFIG_AC97) += ac97.o
+sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o
+sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o
+sound-obj-$(CONFIG_CS4231A) += cs4231a.o
+sound-obj-$(CONFIG_HDA) += intel-hda.o hda-audio.o
+
+$(obj)/adlib.o $(obj)/fmopl.o: QEMU_CFLAGS += -DBUILD_Y8950=0
+
+hw-obj-$(CONFIG_SOUND) += $(sound-obj-y)
+
+hw-obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/
+
+common-obj-y += usb/
+common-obj-y += irq.o
+common-obj-$(CONFIG_PTIMER) += ptimer.o
+common-obj-$(CONFIG_MAX7310) += max7310.o
+common-obj-$(CONFIG_WM8750) += wm8750.o
+common-obj-$(CONFIG_WM8994) += wm8994.o
+common-obj-$(CONFIG_TWL92230) += twl92230.o
+common-obj-$(CONFIG_TSC2005) += tsc2005.o
+common-obj-$(CONFIG_LM832X) += lm832x.o
+common-obj-$(CONFIG_TMP105) += tmp105.o
+common-obj-$(CONFIG_STELLARIS_INPUT) += stellaris_input.o
+common-obj-$(CONFIG_SSD0303) += ssd0303.o
+common-obj-$(CONFIG_SSD0323) += ssd0323.o
+common-obj-$(CONFIG_ADS7846) += ads7846.o
+common-obj-$(CONFIG_MAX111X) += max111x.o
+common-obj-$(CONFIG_DS1338) += ds1338.o
+common-obj-y += i2c.o smbus.o smbus_eeprom.o
+common-obj-y += eeprom93xx.o
+common-obj-y += scsi-disk.o cdrom.o hd-geometry.o block-common.o
+common-obj-y += scsi-generic.o scsi-bus.o
+common-obj-y += hid.o
+common-obj-$(CONFIG_SSI) += ssi.o
+common-obj-$(CONFIG_SSI_SD) += ssi-sd.o
+common-obj-$(CONFIG_SD) += sd.o
+common-obj-y += bt.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o
+common-obj-y += bt-hci-csr.o
+common-obj-y += msmouse.o ps2.o
+common-obj-y += qdev.o qdev-properties.o qdev-monitor.o
+common-obj-$(CONFIG_BRLAPI) += baum.o
+
+# xen backend driver support
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_console.o xenfb.o xen_disk.o xen_nic.o
+
+# Per-target files
+# virtio has to be here due to weird dependency between PCI and virtio-net.
+# need to fix this properly
+obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o
+obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o
+obj-$(CONFIG_SOFTMMU) += vhost_net.o
+obj-$(CONFIG_VHOST_NET) += vhost.o
+obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/
+obj-$(CONFIG_NO_PCI) += pci-stub.o
+obj-$(CONFIG_VGA) += vga.o
+obj-$(CONFIG_SOFTMMU) += device-hotplug.o
+obj-$(CONFIG_XEN) += xen_domainbuild.o xen_machine_pv.o
+
+# Inter-VM PCI shared memory
+ifeq ($(CONFIG_PCI), y)
+obj-$(CONFIG_KVM) += ivshmem.o
+endif
++=======
+ devices-dirs-$(CONFIG_REALLY_VIRTFS) += 9pfs/
+ devices-dirs-$(CONFIG_ACPI) += acpi/
+ devices-dirs-$(CONFIG_SOFTMMU) += audio/
+ devices-dirs-$(CONFIG_SOFTMMU) += block/
+ devices-dirs-$(CONFIG_SOFTMMU) += bt/
+ devices-dirs-$(CONFIG_SOFTMMU) += char/
+ devices-dirs-$(CONFIG_SOFTMMU) += cpu/
+ devices-dirs-$(CONFIG_SOFTMMU) += display/
+ devices-dirs-$(CONFIG_SOFTMMU) += dma/
+ devices-dirs-$(CONFIG_SOFTMMU) += gpio/
+ devices-dirs-$(CONFIG_SOFTMMU) += i2c/
+ devices-dirs-$(CONFIG_SOFTMMU) += ide/
+ devices-dirs-$(CONFIG_SOFTMMU) += input/
+ devices-dirs-$(CONFIG_SOFTMMU) += intc/
+ devices-dirs-$(CONFIG_SOFTMMU) += isa/
+ devices-dirs-$(CONFIG_SOFTMMU) += misc/
+ devices-dirs-$(CONFIG_SOFTMMU) += net/
+ devices-dirs-$(CONFIG_SOFTMMU) += nvram/
+ devices-dirs-$(CONFIG_SOFTMMU) += pci/
+ devices-dirs-$(CONFIG_PCI) += pci-bridge/ pci-host/
+ devices-dirs-$(CONFIG_SOFTMMU) += scsi/
+ devices-dirs-$(CONFIG_SOFTMMU) += sd/
+ devices-dirs-$(CONFIG_SOFTMMU) += ssi/
+ devices-dirs-$(CONFIG_SOFTMMU) += timer/
+ devices-dirs-$(CONFIG_TPM) += tpm/
+ devices-dirs-$(CONFIG_SOFTMMU) += usb/
+ devices-dirs-$(CONFIG_VIRTIO) += virtio/
+ devices-dirs-$(CONFIG_SOFTMMU) += watchdog/
+ devices-dirs-$(CONFIG_SOFTMMU) += xen/
+ devices-dirs-y += core/
+ common-obj-y += $(devices-dirs-y)
+ obj-y += $(devices-dirs-y)
++>>>>>>> test1.5
++<<<<<<< HEAD
+obj-y = integratorcp.o versatilepb.o arm_pic.o
+obj-y += arm_boot.o
+obj-y += xilinx_zynq.o zynq_slcr.o
+obj-y += arm_gic.o arm_gic_common.o
+obj-y += realview_gic.o realview.o arm_sysctl.o arm11mpcore.o a9mpcore.o
+obj-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o
+obj-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o
+obj-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o
+obj-y += exynos4210_rtc.o exynos4210_i2c.o
+obj-y += exynos4210_cmu.o exynos4210_g3d.o
+obj-y += exynos4210_i2s.o exynos4210_audio.o
+obj-y += arm_mptimer.o a15mpcore.o
+obj-y += armv7m.o armv7m_nvic.o stellaris.o stellaris_enet.o
+obj-y += highbank.o
+obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
+obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
+obj-y += gumstix.o
+obj-y += zaurus.o ide/microdrive.o spitz.o tosa.o tc6393xb.o
+obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
+ omap_gpio.o omap_intc.o omap_uart.o
+obj-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
+ omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
+obj-y += omap_sx1.o palm.o tsc210x.o
+obj-y += nseries.o blizzard.o onenand.o cbus.o tusb6010.o usb/hcd-musb.o
+obj-y += mst_fpga.o mainstone.o
+obj-y += z2.o
+obj-y += musicpal.o bitbang_i2c.o marvell_88w8618_audio.o
+obj-y += framebuffer.o
+obj-y += vexpress.o
+obj-y += strongarm.o
+obj-y += collie.o
+obj-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o
+obj-y += kzm.o
+obj-$(CONFIG_FDT) += ../device_tree.o
++=======
+ obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o
+ obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o
+ obj-y += omap_sx1.o palm.o pic_cpu.o realview.o spitz.o stellaris.o
+ obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o
++>>>>>>> test1.5
- obj-y := $(addprefix ../,$(obj-y))
+ obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
+ obj-y += omap1.o omap2.o strongarm.o
* THE SOFTWARE.
*/
#include "hw/hw.h"
- #include "console.h"
+ #include "ui/console.h"
#include "hw/usb.h"
#include "hw/usb/desc.h"
- #include "qemu-timer.h"
- #include "hw/hid.h"
+ #include "qemu/timer.h"
+ #include "hw/input/hid.h"
+#ifdef CONFIG_MARU
+#include "../tizen/src/mloop_event.h"
+#endif
+
/* HID interface requests */
#define GET_REPORT 0xa101
#define GET_IDLE 0xa102
*/
#include "qemu-common.h"
- #include "qemu-option.h"
- #include "qemu-config.h"
+ #include "qemu/option.h"
+ #include "qemu/config-file.h"
#include "hw/usb.h"
#include "hw/usb/desc.h"
- #include "hw/scsi.h"
- #include "console.h"
- #include "monitor.h"
- #include "sysemu.h"
- #include "blockdev.h"
+ #include "hw/scsi/scsi.h"
+ #include "ui/console.h"
+ #include "monitor/monitor.h"
+ #include "sysemu/sysemu.h"
+ #include "sysemu/blockdev.h"
+#ifdef CONFIG_MARU
+#include "../tizen/src/mloop_event.h"
+#endif
+
//#define DEBUG_MSD
#ifdef DEBUG_MSD
default:
DPRINTF("Bad token\n");
fail:
- ret = USB_RET_STALL;
+ p->status = USB_RET_STALL;
break;
}
-
- return ret;
}
+#ifdef CONFIG_MARU
+static void usb_msd_handle_destroy(USBDevice *dev)
+{
+ mloop_evcmd_set_usbdisk(NULL);
+}
+#endif
+
static void usb_msd_password_cb(void *opaque, int err)
{
MSDState *s = opaque;
uc->handle_reset = usb_msd_handle_reset;
uc->handle_control = usb_msd_handle_control;
uc->handle_data = usb_msd_handle_data;
+#ifdef CONFIG_MARU
+ uc->handle_destroy = usb_msd_handle_destroy;
+#endif
dc->fw_name = "storage";
dc->vmsd = &vmstate_usb_msd;
+ }
+
+ static void usb_msd_class_initfn_storage(ObjectClass *klass, void *data)
+ {
+ DeviceClass *dc = DEVICE_CLASS(klass);
+ USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
+
+ uc->init = usb_msd_initfn_storage;
dc->props = msd_properties;
+ usb_msd_class_initfn_common(klass);
}
- static TypeInfo msd_info = {
+ static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data)
+ {
+ USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
+
+ uc->init = usb_msd_initfn_bot;
+ usb_msd_class_initfn_common(klass);
+ }
+
+ static const TypeInfo msd_info = {
.name = "usb-storage",
.parent = TYPE_USB_DEVICE,
.instance_size = sizeof(MSDState),
#ifndef _WIN32
++<<<<<<< HEAD
+#include "compatfd.h"
+
+static int io_thread_fd = -1;
+
+void qemu_notify_event(void)
+{
+ /* Write 8 bytes to be compatible with eventfd. */
+ static const uint64_t val = 1;
+ ssize_t ret;
+
+ if (io_thread_fd == -1) {
+ return;
+ }
+
+ qemu_notify_hax_event();
+
+ do {
+ ret = write(io_thread_fd, &val, sizeof(val));
+ } while (ret < 0 && errno == EINTR);
+
+ /* EAGAIN is fine, a read must be pending. */
+ if (ret < 0 && errno != EAGAIN) {
+ fprintf(stderr, "qemu_notify_event: write() failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+}
+
+static void qemu_event_read(void *opaque)
+{
+ int fd = (intptr_t)opaque;
+ ssize_t len;
+ char buffer[512];
+
+ /* Drain the notify pipe. For eventfd, only 8 bytes will be read. */
+ do {
+ len = read(fd, buffer, sizeof(buffer));
+ } while ((len == -1 && errno == EINTR) || len == sizeof(buffer));
+}
+
+static int qemu_event_init(void)
+{
+ int err;
+ int fds[2];
+
+ err = qemu_eventfd(fds);
+ if (err == -1) {
+ return -errno;
+ }
+ err = fcntl_setfl(fds[0], O_NONBLOCK);
+ if (err < 0) {
+ goto fail;
+ }
+ err = fcntl_setfl(fds[1], O_NONBLOCK);
+ if (err < 0) {
+ goto fail;
+ }
+ qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL,
+ (void *)(intptr_t)fds[0]);
+
+ io_thread_fd = fds[1];
+ return 0;
+
+fail:
+ close(fds[0]);
+ close(fds[1]);
+ return err;
+}
++=======
+ #include "qemu/compatfd.h"
++>>>>>>> test1.5
/* If we have signalfd, we mask out the signals we want to handle and then
* use signalfd to listen for them. We rely on whatever the current signal
void qemu_notify_event(void)
{
- if (!qemu_event_handle) {
+ if (!qemu_aio_context) {
return;
}
++<<<<<<< HEAD
+
+ qemu_notify_hax_event();
+
+ if (!SetEvent(qemu_event_handle)) {
+ fprintf(stderr, "qemu_notify_event: SetEvent failed: %ld\n",
+ GetLastError());
+ exit(1);
+ }
++=======
+ aio_notify(qemu_aio_context);
++>>>>>>> test1.5
}
- static int qemu_signal_init(void)
- {
- return 0;
- }
- #endif
+ static GArray *gpollfds;
- int main_loop_init(void)
+ int qemu_init_main_loop(void)
{
int ret;
+ GSource *src;
- qemu_mutex_lock_iothread();
- ret = qemu_signal_init();
- if (ret) {
- return ret;
+ init_clocks();
+ if (init_timer_alarm() < 0) {
+ fprintf(stderr, "could not initialize alarm timer\n");
+ exit(1);
}
- /* Note eventfd must be drained before signalfd handlers run */
- ret = qemu_event_init();
+ ret = qemu_signal_init();
if (ret) {
return ret;
}
return TRUE;
}
++<<<<<<< HEAD
+#ifdef CONFIG_MARU
+void os_setup_early_signal_handling(void)
+{
+ SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE);
+}
+#else
+void os_setup_early_signal_handling(void)
++=======
+ static TIMECAPS mm_tc;
+
+ static void os_undo_timer_resolution(void)
++>>>>>>> test1.5
{
- /* Note: cpu_interrupt() is currently not SMP safe, so we force
- QEMU to run on a single CPU */
- HANDLE h;
- DWORD_PTR mask, smask;
- int i;
+ timeEndPeriod(mm_tc.wPeriodMin);
+ }
+ void os_setup_early_signal_handling(void)
+ {
SetConsoleCtrlHandler(qemu_ctrl_handler, TRUE);
-
- h = GetCurrentProcess();
- if (GetProcessAffinityMask(h, &mask, &smask)) {
- for(i = 0; i < 32; i++) {
- if (mask & (1 << i))
- break;
- }
- if (i != 32) {
- mask = 1 << i;
- SetProcessAffinityMask(h, mask);
- }
- }
+ timeGetDevCaps(&mm_tc, sizeof(mm_tc));
+ timeBeginPeriod(mm_tc.wPeriodMin);
+ atexit(os_undo_timer_resolution);
}
+#endif /* CONFIG_MARU */
/* Look for support files in the same directory as the executable. */
char *os_find_datadir(const char *argv0)
return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE));
}
++<<<<<<< HEAD
+static CharDriverState *qemu_chr_open_win_file_out(QemuOpts *opts)
+{
+ const char *file_out = qemu_opt_get(opts, "path");
+ HANDLE fd_out;
+
+#ifndef CONFIG_MARU
+ fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+ OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+#else
+ int open_flags = O_BINARY | O_RDWR | O_CREAT | O_TRUNC;
+
+ int ret = qemu_open(file_out, open_flags, 0644);
+ if (ret < 0) {
+ error_report("qemu_chr_open_win_file_out failed(%d) \n", ret);
+ return -errno;
+ }
+ fd_out = (HANDLE)_get_osfhandle(ret);
+
+#endif
+
+ if (fd_out == INVALID_HANDLE_VALUE) {
+ return NULL;
+ }
+
+ return qemu_chr_open_win_file(fd_out);
+}
+
++=======
++>>>>>>> test1.5
static int win_stdio_write(CharDriverState *chr, const uint8_t *buf, int len)
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
@end table
ETEXI
++<<<<<<< HEAD
+DEF("max-touch-point", HAS_ARG, QEMU_OPTION_max_touch_point, \
+ "-max-touch-point [count]\n"
+ " define maximum number of touch point\n",
+ QEMU_ARCH_ALL)
+STEXI
+@item -max-touch-point @var{max_count}
+@findex -max-touch-point
+Use @var{max_count} as Integer
+ETEXI
+
+DEF("disable-skin", 0, QEMU_OPTION_disable_skin, \
+ "-disable-skin\n"
+ " do not start with java skin process\n",
+ QEMU_ARCH_ALL)
+STEXI
+@item -disable-skin
+@findex -disable-skin
+ETEXI
+
+DEF("qtest", HAS_ARG, QEMU_OPTION_qtest,
+ "-qtest CHR specify tracing options\n",
+ QEMU_ARCH_ALL)
+
+DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log,
+ "-qtest-log LOG specify tracing options\n",
+ QEMU_ARCH_ALL)
++=======
+ HXCOMM Internal use
+ DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
+ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
++>>>>>>> test1.5
#ifdef __linux__
DEF("enable-fips", 0, QEMU_OPTION_enablefips,
if (num_insns + 1 == max_insns && (tb->cflags & CF_LAST_IO))
gen_io_start();
- pc_ptr = disas_insn(dc, pc_ptr);
+ pc_ptr = disas_insn(env, dc, pc_ptr);
num_insns++;
+#ifdef CONFIG_HAX
+ if (hax_enabled() && hax_stop_translate(env))
+ {
+ gen_jmp_im(pc_ptr - dc->cs_base);
+ gen_eob(dc);
+ break;
+ }
+#endif
/* stop translation if indicated */
if (dc->is_jmp)
break;
helper_stl_mmu,
helper_stq_mmu,
};
- #else
- /* legacy helper signature: __ld_mmu(target_ulong addr, int
- mmu_idx) */
- static void *qemu_ld_helpers[4] = {
- __ldb_mmu,
- __ldw_mmu,
- __ldl_mmu,
- __ldq_mmu,
- };
- /* legacy helper signature: __st_mmu(target_ulong addr, uintxx_t val,
- int mmu_idx) */
- static void *qemu_st_helpers[4] = {
- __stb_mmu,
- __stw_mmu,
- __stl_mmu,
- __stq_mmu,
- };
- #endif
+ static void add_qemu_ldst_label(TCGContext *s,
+ int is_ld,
+ int opc,
+ int data_reg,
+ int data_reg2,
+ int addrlo_reg,
+ int addrhi_reg,
+ int mem_index,
+ uint8_t *raddr,
+ uint8_t **label_ptr);
+static void add_qemu_ldst_label(TCGContext *s,
+ int is_ld,
+ int opc,
+ int data_reg,
+ int data_reg2,
+ int addrlo_reg,
+ int addrhi_reg,
+ int mem_index,
+ uint8_t *raddr,
+ uint8_t **label_ptr);
+
/* Perform the TLB load and compare.
Inputs:
label_ptr, offsetof(CPUTLBEntry, addr_read));
/* TLB Hit. */
++<<<<<<< HEAD
+ tcg_out_qemu_ld_direct(s, data_reg, data_reg2,
+ tcg_target_call_iarg_regs[0], 0, opc);
++=======
+ tcg_out_qemu_ld_direct(s, data_reg, data_reg2, TCG_REG_L1, 0, 0, opc);
++>>>>>>> test1.5
/* Record the current context of a load into ldst label */
add_qemu_ldst_label(s,
label_ptr, offsetof(CPUTLBEntry, addr_write));
/* TLB Hit. */
- tcg_out_qemu_st_direct(s, data_reg, data_reg2,
- tcg_target_call_iarg_regs[0], 0, opc);
+ tcg_out_qemu_st_direct(s, data_reg, data_reg2, TCG_REG_L1, 0, 0, opc);
+
+ /* Record the current context of a store into ldst label */
+ add_qemu_ldst_label(s,
+ 0,
+ opc,
+ data_reg,
+ data_reg2,
+ args[addrlo_idx],
+ args[addrlo_idx + 1],
+ mem_index,
+ s->code_ptr,
+ label_ptr);
+ #else
+ {
+ int32_t offset = GUEST_BASE;
+ int base = args[addrlo_idx];
+ int seg = 0;
+
+ /* ??? We assume all operations have left us with register contents
+ that are zero extended. So far this appears to be true. If we
+ want to enforce this, we can either do an explicit zero-extension
+ here, or (if GUEST_BASE == 0, or a segment register is in use)
+ use the ADDR32 prefix. For now, do nothing. */
+ if (GUEST_BASE && guest_base_flags) {
+ seg = guest_base_flags;
+ offset = 0;
+ } else if (TCG_TARGET_REG_BITS == 64 && offset != GUEST_BASE) {
+ tcg_out_movi(s, TCG_TYPE_I64, TCG_REG_L1, GUEST_BASE);
+ tgen_arithr(s, ARITH_ADD + P_REXW, TCG_REG_L1, base);
+ base = TCG_REG_L1;
+ offset = 0;
+ }
+
+ tcg_out_qemu_st_direct(s, data_reg, data_reg2, base, offset, seg, opc);
+ }
+ #endif
+ }
+
+ #if defined(CONFIG_SOFTMMU)
+ /*
+ * Record the context of a call to the out of line helper code for the slow path
+ * for a load or store, so that we can later generate the correct helper code
+ */
+ static void add_qemu_ldst_label(TCGContext *s,
+ int is_ld,
+ int opc,
+ int data_reg,
+ int data_reg2,
+ int addrlo_reg,
+ int addrhi_reg,
+ int mem_index,
+ uint8_t *raddr,
+ uint8_t **label_ptr)
+ {
+ int idx;
+ TCGLabelQemuLdst *label;
+
+ if (s->nb_qemu_ldst_labels >= TCG_MAX_QEMU_LDST) {
+ tcg_abort();
+ }
+
+ idx = s->nb_qemu_ldst_labels++;
+ label = (TCGLabelQemuLdst *)&s->qemu_ldst_labels[idx];
+ label->is_ld = is_ld;
+ label->opc = opc;
+ label->datalo_reg = data_reg;
+ label->datahi_reg = data_reg2;
+ label->addrlo_reg = addrlo_reg;
+ label->addrhi_reg = addrhi_reg;
+ label->mem_index = mem_index;
+ label->raddr = raddr;
+ label->label_ptr[0] = label_ptr[0];
+ if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+ label->label_ptr[1] = label_ptr[1];
+ }
+ }
++<<<<<<< HEAD
+ /* Record the current context of a store into ldst label */
+ add_qemu_ldst_label(s,
+ 0,
+ opc,
+ data_reg,
+ data_reg2,
+ args[addrlo_idx],
+ args[addrlo_idx + 1],
+ mem_index,
+ s->code_ptr,
+ label_ptr);
+#else
+ {
+ int32_t offset = GUEST_BASE;
+ int base = args[addrlo_idx];
+
+ if (TCG_TARGET_REG_BITS == 64) {
+ /* ??? We assume all operations have left us with register
+ contents that are zero extended. So far this appears to
+ be true. If we want to enforce this, we can either do
+ an explicit zero-extension here, or (if GUEST_BASE == 0)
+ use the ADDR32 prefix. For now, do nothing. */
+
+ if (offset != GUEST_BASE) {
+ tcg_out_movi(s, TCG_TYPE_I64,
+ tcg_target_call_iarg_regs[0], GUEST_BASE);
+ tgen_arithr(s, ARITH_ADD + P_REXW,
+ tcg_target_call_iarg_regs[0], base);
+ base = tcg_target_call_iarg_regs[0];
+ offset = 0;
+ }
+ }
+
+ tcg_out_qemu_st_direct(s, data_reg, data_reg2, base, offset, opc);
+ }
+#endif
+}
+
+#if defined(CONFIG_SOFTMMU)
+/*
+ * Record the context of a call to the out of line helper code for the slow path
+ * for a load or store, so that we can later generate the correct helper code
+ */
+static void add_qemu_ldst_label(TCGContext *s,
+ int is_ld,
+ int opc,
+ int data_reg,
+ int data_reg2,
+ int addrlo_reg,
+ int addrhi_reg,
+ int mem_index,
+ uint8_t *raddr,
+ uint8_t **label_ptr)
+{
+ int idx;
+ TCGLabelQemuLdst *label;
+
+ if (s->nb_qemu_ldst_labels >= TCG_MAX_QEMU_LDST) {
+ tcg_abort();
+ }
+
+ idx = s->nb_qemu_ldst_labels++;
+ label = (TCGLabelQemuLdst *)&s->qemu_ldst_labels[idx];
+ label->is_ld = is_ld;
+ label->opc = opc;
+ label->datalo_reg = data_reg;
+ label->datahi_reg = data_reg2;
+ label->addrlo_reg = addrlo_reg;
+ label->addrhi_reg = addrhi_reg;
+ label->mem_index = mem_index;
+ label->raddr = raddr;
+ label->label_ptr[0] = label_ptr[0];
+ if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+ label->label_ptr[1] = label_ptr[1];
+ }
+}
+
++=======
++>>>>>>> test1.5
/*
* Generate code for the slow path for a load at the end of block
*/
}
tcg_out_push(s, addrlo_reg);
stack_adjust += 4;
++<<<<<<< HEAD
+#ifdef CONFIG_TCG_PASS_AREG0
+ tcg_out_push(s, TCG_AREG0);
+ stack_adjust += 4;
+#endif
+#else
+ /* The first argument is already loaded with addrlo. */
+ tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[1],
+ mem_index);
+#ifdef CONFIG_TCG_PASS_AREG0
+ /* XXX/FIXME: suboptimal */
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[3],
+ tcg_target_call_iarg_regs[2]);
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[2],
+ tcg_target_call_iarg_regs[1]);
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[1],
+ tcg_target_call_iarg_regs[0]);
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0],
+ TCG_AREG0);
+#endif
++=======
+ tcg_out_push(s, TCG_AREG0);
+ stack_adjust += 4;
+ #else
+ tcg_out_mov(s, TCG_TYPE_I64, tcg_target_call_iarg_regs[0], TCG_AREG0);
+ /* The second argument is already loaded with addrlo. */
+ tcg_out_movi(s, TCG_TYPE_I32, tcg_target_call_iarg_regs[2], mem_index);
++>>>>>>> test1.5
#endif
/* Code generation of qemu_ld/st's slow path calling MMU helper
/* Jump to the code corresponding to next IR of qemu_st */
tcg_out_jmp(s, (tcg_target_long)raddr);
}
++<<<<<<< HEAD
+
+/*
+ * Generate code for the slow path for a store at the end of block
+ */
+static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
+{
+ int s_bits;
+ int stack_adjust;
+ int opc = label->opc;
+ int mem_index = label->mem_index;
+ int data_reg = label->datalo_reg;
+#if TCG_TARGET_REG_BITS == 32
+ int data_reg2 = label->datahi_reg;
+ int addrlo_reg = label->addrlo_reg;
+ int addrhi_reg = label->addrhi_reg;
+#endif
+ uint8_t *raddr = label->raddr;
+ uint8_t **label_ptr = &label->label_ptr[0];
+
++=======
+
+ /*
+ * Generate code for the slow path for a store at the end of block
+ */
+ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *label)
+ {
+ int s_bits;
+ int stack_adjust;
+ int opc = label->opc;
+ int mem_index = label->mem_index;
+ int data_reg = label->datalo_reg;
+ #if TCG_TARGET_REG_BITS == 32
+ int data_reg2 = label->datahi_reg;
+ int addrlo_reg = label->addrlo_reg;
+ int addrhi_reg = label->addrhi_reg;
+ #endif
+ uint8_t *raddr = label->raddr;
+ uint8_t **label_ptr = &label->label_ptr[0];
+
++>>>>>>> test1.5
s_bits = opc & 3;
/* resolve label address */
int *sorted_args;
memset(s, 0, sizeof(*s));
- s->temps = s->static_temps;
s->nb_globals = 0;
-
+
/* Count total number of arguments and allocate the corresponding
space */
total_args = 0;
s->nb_labels = 0;
s->current_frame_offset = s->frame_start;
++<<<<<<< HEAD
+ gen_opc_ptr = gen_opc_buf;
+ gen_opparam_ptr = gen_opparam_buf;
++=======
+ #ifdef CONFIG_DEBUG_TCG
+ s->goto_tb_issue_mask = 0;
+ #endif
+
+ s->gen_opc_ptr = s->gen_opc_buf;
+ s->gen_opparam_ptr = s->gen_opparam_buf;
++>>>>>>> test1.5
#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
/* Initialize qemu_ld/st labels to assist code generation at the end of TB
int addrhi_reg; /* reg index for high word of guest virtual addr */
int datalo_reg; /* reg index for low word to be loaded or stored */
int datahi_reg; /* reg index for high word to be loaded or stored */
++<<<<<<< HEAD
+ int mem_index; /* soft MMU memory index */
+ uint8_t *raddr; /* gen code addr of the next IR of qemu_ld/st IR */
+ uint8_t *label_ptr[2]; /* label pointers to be updated */
++=======
+ int mem_index; /* soft MMU memory index */
+ uint8_t *raddr; /* gen code addr of the next IR of qemu_ld/st IR */
+ uint8_t *label_ptr[2]; /* label pointers to be updated */
++>>>>>>> test1.5
} TCGLabelQemuLdst;
#endif
#define TCGV_UNUSED_I32(x) x = MAKE_TCGV_I32(-1)
#define TCGV_UNUSED_I64(x) x = MAKE_TCGV_I64(-1)
+ #define TCGV_IS_UNUSED_I32(x) (GET_TCGV_I32(x) == -1)
+ #define TCGV_IS_UNUSED_I64(x) (GET_TCGV_I64(x) == -1)
+
/* call flags */
++<<<<<<< HEAD
+/* A pure function only reads its arguments and TCG global variables
+ and cannot raise exceptions. Hence a call to a pure function can be
+ safely suppressed if the return value is not used. */
+#define TCG_CALL_PURE 0x0010
+/* A const function only reads its arguments and does not use TCG
+ global variables. Hence a call to such a function does not
+ save TCG global variables back to their canonical location. */
+#define TCG_CALL_CONST 0x0020
++=======
+ /* Helper does not read globals (either directly or through an exception). It
+ implies TCG_CALL_NO_WRITE_GLOBALS. */
+ #define TCG_CALL_NO_READ_GLOBALS 0x0010
+ /* Helper does not write globals */
+ #define TCG_CALL_NO_WRITE_GLOBALS 0x0020
+ /* Helper can be safely suppressed if the return value is not used. */
+ #define TCG_CALL_NO_SIDE_EFFECTS 0x0040
+
+ /* convenience version of most used call flags */
+ #define TCG_CALL_NO_RWG TCG_CALL_NO_READ_GLOBALS
+ #define TCG_CALL_NO_WG TCG_CALL_NO_WRITE_GLOBALS
+ #define TCG_CALL_NO_SE TCG_CALL_NO_SIDE_EFFECTS
+ #define TCG_CALL_NO_RWG_SE (TCG_CALL_NO_RWG | TCG_CALL_NO_SE)
+ #define TCG_CALL_NO_WG_SE (TCG_CALL_NO_WG | TCG_CALL_NO_SE)
++>>>>>>> test1.5
/* used to align parameters */
#define TCG_CALL_DUMMY_TCGV MAKE_TCGV_I32(-1)
/* liveness analysis */
uint16_t *op_dead_args; /* for each operation, each bit tells if the
corresponding argument is dead */
-
++<<<<<<< HEAD
++
++=======
+ uint8_t *op_sync_args; /* for each operation, each bit tells if the
+ corresponding output argument needs to be
+ sync to memory. */
+
++>>>>>>> test1.5
/* tells in which temporary a given register is. It does not take
into account fixed registers */
int reg_to_temp[TCG_TARGET_NB_REGS];
#ifdef CONFIG_DEBUG_TCG
int temps_in_use;
+ int goto_tb_issue_mask;
+ #endif
+
+ uint16_t gen_opc_buf[OPC_BUF_SIZE];
+ TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE];
+
+ uint16_t *gen_opc_ptr;
+ TCGArg *gen_opparam_ptr;
+ target_ulong gen_opc_pc[OPC_BUF_SIZE];
+ uint16_t gen_opc_icount[OPC_BUF_SIZE];
+ uint8_t gen_opc_instr_start[OPC_BUF_SIZE];
+
+ /* Code generation */
+ int code_gen_max_blocks;
+ uint8_t *code_gen_prologue;
+ uint8_t *code_gen_buffer;
+ size_t code_gen_buffer_size;
+ /* threshold to flush the translated code buffer */
+ size_t code_gen_buffer_max_size;
+ uint8_t *code_gen_ptr;
+
+ TBContext tb_ctx;
+
+ #if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
++ /* labels info for qemu_ld/st IRs
++ The labels help to generate TLB miss case codes at the end of TB */
++ TCGLabelQemuLdst *qemu_ldst_labels;
++ int nb_qemu_ldst_labels;
+#endif
+
+#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
/* labels info for qemu_ld/st IRs
The labels help to generate TLB miss case codes at the end of TB */
TCGLabelQemuLdst *qemu_ldst_labels;
#include "hw/boards.h"
#include "hw/usb.h"
#include "hw/pcmcia.h"
- #include "hw/pc.h"
- #include "hw/isa.h"
- #include "hw/baum.h"
+ #include "hw/i386/pc.h"
+ #include "hw/isa/isa.h"
#include "hw/bt.h"
- #include "hw/watchdog.h"
- #include "hw/smbios.h"
- #include "hw/xen.h"
+ #include "sysemu/watchdog.h"
+ #include "hw/i386/smbios.h"
+ #include "hw/xen/xen.h"
#include "hw/qdev.h"
#include "hw/loader.h"
- #include "bt-host.h"
- #include "net.h"
+ #include "monitor/qdev.h"
+ #include "sysemu/bt.h"
+ #include "net/net.h"
#include "net/slirp.h"
- #include "monitor.h"
- #include "console.h"
- #include "sysemu.h"
- #include "gdbstub.h"
- #include "qemu-timer.h"
- #include "qemu-char.h"
- #include "cache-utils.h"
- #include "blockdev.h"
- #include "hw/block-common.h"
- #include "block-migration.h"
- #include "dma.h"
+ #include "monitor/monitor.h"
+ #include "ui/console.h"
+ #include "sysemu/sysemu.h"
+ #include "exec/gdbstub.h"
+ #include "qemu/timer.h"
+ #include "sysemu/char.h"
+ #include "qemu/cache-utils.h"
+ #include "sysemu/blockdev.h"
+ #include "hw/block/block.h"
+ #include "migration/block.h"
+ #include "sysemu/tpm.h"
+ #include "sysemu/dma.h"
#include "audio/audio.h"
++<<<<<<< HEAD
+#include "migration.h"
+#include "kvm.h"
+#include "hax.h"
+#include "qjson.h"
+#include "qemu-option.h"
+#include "qemu-config.h"
++=======
+ #include "migration/migration.h"
+ #include "sysemu/kvm.h"
+ #include "qapi/qmp/qjson.h"
+ #include "qemu/option.h"
+ #include "qemu/config-file.h"
++>>>>>>> test1.5
#include "qemu-options.h"
#include "qmp-commands.h"
- #include "main-loop.h"
+ #include "qemu/main-loop.h"
#ifdef CONFIG_VIRTFS
#include "fsdev/qemu-fsdev.h"
#endif
#include "trace.h"
#include "trace/control.h"
- #include "qemu-queue.h"
- #include "cpus.h"
- #include "arch_init.h"
- #include "osdep.h"
+ #include "qemu/queue.h"
+ #include "sysemu/cpus.h"
+ #include "sysemu/arch_init.h"
+ #include "qemu/osdep.h"
#include "ui/qemu-spice.h"
+ #include "qapi/string-input-visitor.h"
+#ifdef CONFIG_MARU
+#include "tizen/src/maru_common.h"
+#include "tizen/src/emulator.h"
+#include "tizen/src/maru_err_table.h"
+#include "tizen/src/emul_state.h"
+#include "tizen/src/maru_display.h"
+#include "tizen/src/skin/maruskin_operation.h"
+#endif
+
//#define DEBUG_NET
//#define DEBUG_SLIRP
#define DEFAULT_RAM_SIZE 128
#define MAX_VIRTIO_CONSOLES 1
+ #define MAX_SCLP_CONSOLES 1
++<<<<<<< HEAD
+#ifdef CONFIG_MARU
+int skin_disabled = 0;
+//virtio-gl
+extern int enable_gl;
+extern int enable_yagl;
+#endif
+
+static const char *data_dir;
++=======
+ static const char *data_dir[16];
+ static int data_dir_idx;
++>>>>>>> test1.5
const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
DisplayType display_type = DT_DEFAULT;
unsigned int nb_prom_envs = 0;
const char *prom_envs[MAX_PROM_ENVS];
int boot_menu;
+ bool boot_strict;
uint8_t *boot_splash_filedata;
- int boot_splash_filedata_size;
+ size_t boot_splash_filedata_size;
uint8_t qemu_extra_params_fw[2];
+
typedef struct FWBootEntry FWBootEntry;
struct FWBootEntry {
static NotifierList machine_init_done_notifiers =
NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
++<<<<<<< HEAD
+static int tcg_allowed = 1;
+int kvm_allowed = 0;
+int xen_allowed = 0;
+int hax_allowed = 0;
++=======
+ static bool tcg_allowed = true;
+ bool xen_allowed;
++>>>>>>> test1.5
uint32_t xen_domid;
enum xen_mode xen_mode = XEN_EMULATE;
static int tcg_tb_size;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
+
+ hax_sync_vcpus();
+
do {
++<<<<<<< HEAD
+ nonblocking = !(kvm_enabled()|| hax_enabled()) && last_io > 0;
++=======
+ nonblocking = !kvm_enabled() && !xen_enabled() && last_io > 0;
++>>>>>>> test1.5
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
} else if (strstart(p, "xenfb", &opts)) {
vga_interface_type = VGA_XENFB;
} else if (strstart(p, "qxl", &opts)) {
++<<<<<<< HEAD
+ vga_interface_type = VGA_QXL;
+#ifdef CONFIG_MARU
+ } else if (strstart(p, "maru", &opts)) {
+ vga_interface_type = VGA_MARU;
+#endif
++=======
+ if (qxl_vga_available()) {
+ vga_interface_type = VGA_QXL;
+ } else {
+ fprintf(stderr, "Error: QXL VGA not available\n");
+ exit(0);
+ }
++>>>>>>> test1.5
} else if (!strstart(p, "none", &opts)) {
invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p);
default:
abort();
}
- len = strlen(data_dir) + strlen(name) + strlen(subdir) + 2;
- buf = g_malloc0(len);
- snprintf(buf, len, "%s/%s%s", data_dir, subdir, name);
- if (access(buf, R_OK)) {
+
+ for (i = 0; i < data_dir_idx; i++) {
+ buf = g_strdup_printf("%s/%s%s", data_dir[i], subdir, name);
+ if (access(buf, R_OK) == 0) {
+ trace_load_file(name, buf);
+ return buf;
+ }
g_free(buf);
- return NULL;
}
- return buf;
+ return NULL;
}
+#ifdef CONFIG_MARU
+const char *qemu_get_data_dir(void);
+
+const char *qemu_get_data_dir(void)
+{
+ return data_dir;
+}
+#endif
+
static int device_help_func(QemuOpts *opts, void *opaque)
{
return qdev_device_help(opts);
}
if (!accel_initialised) {
++<<<<<<< HEAD
+ fprintf(stderr, "No accelerator found!\n");
+#ifdef CONFIG_MARU
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, "No accelerator found.");
+#endif
++=======
+ if (!init_failed) {
+ fprintf(stderr, "No accelerator found!\n");
+ }
++>>>>>>> test1.5
exit(1);
}
free(mem);
}
- int qemu_init_main_loop(void)
+ static int object_set_property(const char *name, const char *value, void *opaque)
{
- return main_loop_init();
+ Object *obj = OBJECT(opaque);
+ StringInputVisitor *siv;
+ Error *local_err = NULL;
+
+ if (strcmp(name, "qom-type") == 0 || strcmp(name, "id") == 0) {
+ return 0;
+ }
+
+ siv = string_input_visitor_new(value);
+ object_property_set(obj, string_input_get_visitor(siv), name, &local_err);
+ string_input_visitor_cleanup(siv);
+
+ if (local_err) {
+ qerror_report_err(local_err);
+ error_free(local_err);
+ return -1;
+ }
+
+ return 0;
+ }
+
+ static int object_create(QemuOpts *opts, void *opaque)
+ {
+ const char *type = qemu_opt_get(opts, "qom-type");
+ const char *id = qemu_opts_id(opts);
+ Object *obj;
+
+ g_assert(type != NULL);
+
+ if (id == NULL) {
+ qerror_report(QERR_MISSING_PARAMETER, "id");
+ return -1;
+ }
+
+ obj = object_new(type);
+ if (qemu_opt_foreach(opts, object_set_property, obj, 1) < 0) {
+ return -1;
+ }
+
+ object_property_add_child(container_get(object_get_root(), "/objects"),
+ id, obj, NULL);
+
+ return 0;
}
+#ifdef CONFIG_MARU
+int use_qemu_display = 0; //0:use tizen qemu sdl, 1:use original qemu sdl
+// W/A for preserve larger continuous heap for RAM.
+void *preallocated_ptr = 0;
+#endif
+
int main(int argc, char **argv, char **envp)
{
int i;
case QEMU_OPTION_sandbox:
opts = qemu_opts_parse(qemu_find_opts("sandbox"), optarg, 1);
if (!opts) {
- exit(0);
+ exit(1);
}
break;
++<<<<<<< HEAD
+ case QEMU_OPTION_enable_hax:
+#ifdef CONFIG_HAX_BACKEND
+ olist = qemu_find_opts("machine");
+ //qemu_opts_reset(olist);
+ hax_disable(0);
+ //qemu_opts_parse(olist, "accel=hax", 0);
+#else
+ fprintf(stderr,
+ "HAX support is disabled, ignoring -enable-hax\n");
+#endif
+ break;
+#ifdef CONFIG_MARU
+ case QEMU_OPTION_max_touch_point:
+ {
+ int cnt = atoi(optarg);
+ fprintf(stderr, "maxTouchPoint:%d\n", cnt);
+ set_emul_max_touch_point(cnt);
+ break;
+ }
+ case QEMU_OPTION_disable_skin:
+ skin_disabled = 1;
+ break;
+#endif
++=======
+ case QEMU_OPTION_add_fd:
+ #ifndef _WIN32
+ opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0);
+ if (!opts) {
+ exit(1);
+ }
+ #else
+ error_report("File descriptor passing is disabled on this "
+ "platform");
+ exit(1);
+ #endif
+ break;
+ case QEMU_OPTION_object:
+ opts = qemu_opts_parse(qemu_find_opts("object"), optarg, 1);
+ if (!opts) {
+ exit(1);
+ }
+ break;
+ case QEMU_OPTION_realtime:
+ opts = qemu_opts_parse(qemu_find_opts("realtime"), optarg, 0);
+ if (!opts) {
+ exit(1);
+ }
+ configure_realtime(opts);
+ break;
++>>>>>>> test1.5
default:
os_parse_cmd_args(popt->index, optarg);
}
monitor_parse("vc:80Cx24C", "readline");
if (default_virtcon)
add_device_config(DEV_VIRTCON, "vc:80Cx24C");
+ if (default_sclp) {
+ add_device_config(DEV_SCLP, "vc:80Cx24C");
+ }
+ }
+
+ if (display_type == DT_DEFAULT && !display_remote) {
+ #if defined(CONFIG_GTK)
+ display_type = DT_GTK;
+ #elif defined(CONFIG_SDL) || defined(CONFIG_COCOA)
+ display_type = DT_SDL;
+ #elif defined(CONFIG_VNC)
+ vnc_display = "localhost:0,to=99";
+ show_vnc_port = 1;
+ #else
+ display_type = DT_NONE;
+ #endif
+ }
+
+ #if defined(CONFIG_GTK)
+ if (display_type == DT_GTK) {
+ early_gtk_display_init();
}
+ #endif
+#ifndef CONFIG_MARU
socket_init();
+#endif
if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0)
exit(1);
qdev_machine_init();
++<<<<<<< HEAD
+#ifdef CONFIG_MARU
+ // return variable points different address from input variable.
+ kernel_cmdline = prepare_maru_devices(kernel_cmdline);
+#endif
+
+ machine->init(ram_size, boot_devices,
+ kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
++=======
+ QEMUMachineInitArgs args = { .ram_size = ram_size,
+ .boot_device = (boot_devices[0] == '\0') ?
+ machine->boot_order :
+ boot_devices,
+ .kernel_filename = kernel_filename,
+ .kernel_cmdline = kernel_cmdline,
+ .initrd_filename = initrd_filename,
+ .cpu_model = cpu_model };
+ machine->init(&args);
+
+ audio_init();
++>>>>>>> test1.5
cpu_synchronize_all_post_init();
current_machine = machine;
+ if (hax_enabled()) {
+ hax_sync_vcpus();
+ }
+
/* init USB devices */
- if (usb_enabled) {
+ if (usb_enabled(false)) {
if (foreach_device_config(DEV_USB, usb_parse) < 0)
exit(1);
}
net_check_clients();
++<<<<<<< HEAD
+ /* just use the first displaystate for the moment */
+ ds = get_displaystate();
+
+ if (using_spice)
+ display_remote++;
+ if (display_type == DT_DEFAULT && !display_remote) {
+#if defined(CONFIG_SDL) || defined(CONFIG_COCOA)
+ display_type = DT_SDL;
+#elif defined(CONFIG_VNC)
+ vnc_display = "localhost:0,to=99";
+ show_vnc_port = 1;
+#elif defined(CONFIG_MARU) && defined (__APPLE__)
+ display_type = DT_MARU;
+#else
+ display_type = DT_NONE;
+#endif
+ }
+
++=======
+ ds = init_displaystate();
++>>>>>>> test1.5
/* init local displays */
switch (display_type) {
cocoa_display_init(ds, full_screen);
break;
#endif
++<<<<<<< HEAD
+#if defined(CONFIG_MARU) && defined(__APPLE__)
+ case DT_MARU:
+ maru_display_init(ds);
+ if (skin_disabled == 1) {
+ //do not start skin client process
+ set_emul_skin_enable(0);
+ } else {
+ set_emul_skin_enable(1);
+ }
+ break;
++=======
+ #if defined(CONFIG_GTK)
+ case DT_GTK:
+ gtk_display_init(ds);
+ break;
++>>>>>>> test1.5
#endif
default:
break;
vm_start();
}
+#ifdef CONFIG_MARU
+ prepare_maru();
+#endif
+
os_setup_post();
- resume_all_vcpus();
main_loop();
bdrv_close_all();
pause_all_vcpus();