From: SeokYeon Hwang Date: Wed, 9 Jul 2014 04:40:43 +0000 (+0900) Subject: emulator: clean-up some headers and sources X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~228^2^2~79^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=876ad74c71bad1e16e03dcf10e371792739a15fe;p=sdk%2Femulator%2Fqemu.git emulator: clean-up some headers and sources Rename "maru_common.h" to "emulator_common.h". Remove unnecessary headers. Remove "guest_debug.h". Change-Id: I98b4fcf5c3205e4a537685a168f761a749dbd34b Signed-off-by: SeokYeon Hwang --- diff --git a/tizen/src/Makefile b/tizen/src/Makefile index ba88b34ac0..765019994e 100644 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -34,22 +34,22 @@ qemu_distclean: check_hax: @echo "build check hax" ifdef CONFIG_WIN32 - $(CC) -o check-hax.exe util/check_hax.c + $(CC) -o util/check-hax.exe util/check_hax.c endif ifdef CONFIG_DARWIN - $(CC) -mmacosx-version-min=10.4 -o check-hax util/check_hax.c + $(CC) -mmacosx-version-min=10.4 -o util/check-hax util/check_hax.c endif check_cam: @echo "build check cam" ifdef CONFIG_LINUX - $(CC) -o check-cam util/check_cam.c -lv4l2 -lv4lconvert + $(CC) -o util/check-cam util/check_cam.c -lv4l2 -lv4lconvert endif ifdef CONFIG_WIN32 - $(CC) -o check-cam.exe util/check_cam.c -I. -lole32 -loleaut32 -luuid -lstrmiids + $(CC) -o util/check-cam.exe util/check_cam.c -I. -lole32 -loleaut32 -luuid -lstrmiids endif ifdef CONFIG_DARWIN - $(CC) -o check-cam util/check_cam.c + $(CC) -o util/check-cam util/check_cam.c endif skin_client: @@ -73,9 +73,9 @@ build_info: clean: qemu_clean ifndef CONFIG_LINUX - rm -f check-hax$(EXECUTABLE_EXTENSION) check-cam$(EXECUTABLE_EXTENSION) + rm -f util/check-hax$(EXECUTABLE_EXTENSION) util/check-cam$(EXECUTABLE_EXTENSION) else - rm -f check-cam + rm -f util/check-cam endif distclean: clean qemu_distclean @@ -115,7 +115,7 @@ endif # check capabilities of OpenGL and Webcam cp -pP ../../i386-softmmu/check-gl$(EXECUTABLE_EXTENSION) $(EMUL_DIR)/bin - cp -pP check-cam$(EXECUTABLE_EXTENSION) $(EMUL_DIR)/bin + cp -pP util/check-cam$(EXECUTABLE_EXTENSION) $(EMUL_DIR)/bin # Enable HW Virtualization on Linux ifdef CONFIG_LINUX @@ -125,12 +125,12 @@ endif # check HW Virtualization on Windows and MAC OS X. ifndef CONFIG_LINUX - cp -pP check-hax$(EXECUTABLE_EXTENSION) $(EMUL_DIR)/bin + cp -pP util/check-hax$(EXECUTABLE_EXTENSION) $(EMUL_DIR)/bin endif # give a title name for sdb terminal. ifdef CONFIG_DARWIN - cp -pP sdbscript $(EMUL_DIR)/bin + cp -pP scripts/sdbscript $(EMUL_DIR)/bin endif # use shared memory for display framebuffer @@ -227,7 +227,7 @@ endif # check capabilities of OpenGL and Webcam cp -pP ../../i386-softmmu/check-gl$(EXECUTABLE_EXTENSION) $(DIBS_COMMON_DIR)/bin - cp -pP check-cam$(EXECUTABLE_EXTENSION) $(DIBS_COMMON_DIR)/bin + cp -pP util/check-cam$(EXECUTABLE_EXTENSION) $(DIBS_COMMON_DIR)/bin # Enable HW Virtualization on Linux @@ -239,12 +239,12 @@ endif # check HW Virtualization on Windows and MAC OS X. ifndef CONFIG_LINUX - cp -pP check-hax$(EXECUTABLE_EXTENSION) $(DIBS_COMMON_DIR)/bin + cp -pP util/check-hax$(EXECUTABLE_EXTENSION) $(DIBS_COMMON_DIR)/bin endif # give a title name for sdb terminal. ifdef CONFIG_DARWIN - cp -pP sdbscript $(DIBS_COMMON_DIR)/bin + cp -pP scripts/sdbscript $(DIBS_COMMON_DIR)/bin endif # use shared memory for display framebuffer diff --git a/tizen/src/display/maru_display.c b/tizen/src/display/maru_display.c index b00f144b1c..6276067d8e 100644 --- a/tizen/src/display/maru_display.c +++ b/tizen/src/display/maru_display.c @@ -29,7 +29,7 @@ #include "emulator.h" -#include "maru_common.h" +#include "emulator_common.h" #include "maru_display.h" #include "debug_ch.h" diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index 7d45b99720..67286fbfc1 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -29,7 +29,6 @@ * */ -#include "maru_common.h" #include "emul_state.h" #include "skin/maruskin_server.h" #include "debug_ch.h" diff --git a/tizen/src/emul_state.h b/tizen/src/emul_state.h index 5dc74daf3c..f63fb8af2a 100644 --- a/tizen/src/emul_state.h +++ b/tizen/src/emul_state.h @@ -34,7 +34,6 @@ #define __EMUL_STATE_H__ -#include "maru_common.h" #include "display/maru_finger.h" enum { diff --git a/tizen/src/emulator.h b/tizen/src/emulator.h index e9f9db0d38..0403a22573 100644 --- a/tizen/src/emulator.h +++ b/tizen/src/emulator.h @@ -37,7 +37,7 @@ #ifndef __EMULATOR_H__ #define __EMULATOR_H__ -#include "maru_common.h" +#include "emulator_common.h" #include "qapi/qmp/qlist.h" #include "qemu/option.h" #include "sysemu/sysemu.h" @@ -54,7 +54,6 @@ const gchar * prepare_maru(const gchar * const kernel_cmdline); void start_skin(void); const gchar * get_log_path(void); -int maru_device_check(QemuOpts *opts); void emulator_add_exit_notifier(Notifier *notify); diff --git a/tizen/src/emulator_common.h b/tizen/src/emulator_common.h new file mode 100644 index 0000000000..64d221baeb --- /dev/null +++ b/tizen/src/emulator_common.h @@ -0,0 +1,77 @@ +/* + * Emulator + * + * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * SeokYeon Hwang + * MunKyu Im + * GiWoong Kim + * YeongKyoon Lee + * HyunJun Son + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +/** + * @file emulator_common.h + * @brief - header file that covers maru common features + */ + +#ifndef __EMULATOR_COMMON_H__ +#define __EMULATOR_COMMON_H__ + +#include +#include +#include +#include +#include +#include +#include + +#include "config-host.h" + +#if !defined(PATH_MAX) +#if defined(MAX_PATH) +#define PATH_MAX MAX_PATH +#else +#define PATH_MAX 256 +#endif +#endif + +#define JAVA_MAX_COMMAND_LENGTH 1024 + +#define JAR_SKINFILE "emulator-skin.jar" +#define JAVA_LIBRARY_PATH "-Djava.library.path" + +#ifndef CONFIG_DARWIN +#define JAVA_EXEOPTION "-jar" +#else +#define JAVA_EXEOPTION "-XstartOnFirstThread -jar" // Must start the Java window on the first thread on Mac +#endif +#define JAVA_SIMPLEMODE_OPTION "simple.msg" + +#ifdef CONFIG_WIN32 +#define MY_KEY_WOW64_64KEY 0x0100 +#else +#define JAVA_EXEFILE_PATH "java" +#endif + +#endif /* __EMULATOR_COMMON_H__ */ diff --git a/tizen/src/emulator_legacy.c b/tizen/src/emulator_legacy.c index 47b87de6b2..3d75746b89 100644 --- a/tizen/src/emulator_legacy.c +++ b/tizen/src/emulator_legacy.c @@ -38,7 +38,6 @@ #include "build_info.h" #include "emulator.h" #include "emul_state.h" -#include "guest_debug.h" #include "hw/virtio/maru_virtio_touchscreen.h" #include "util/check_gl.h" #include "util/maru_err_table.h" diff --git a/tizen/src/emulator_options.c b/tizen/src/emulator_options.c index 2b393f92e9..a9d28cd5e2 100644 --- a/tizen/src/emulator_options.c +++ b/tizen/src/emulator_options.c @@ -29,7 +29,6 @@ #include #include "qemu/queue.h" -#include "maru_common.h" #include "emulator_options.h" #include "emulator.h" diff --git a/tizen/src/emulator_options.h b/tizen/src/emulator_options.h index 66022a057c..ee9a898906 100644 --- a/tizen/src/emulator_options.h +++ b/tizen/src/emulator_options.h @@ -29,6 +29,8 @@ #ifndef __EMULATOR_OPTIONS_H__ #define __EMULATOR_OPTIONS_H__ +#include "emulator_common.h" + void set_variable(const char * const arg1, const char * const arg2, bool override); char *get_variable(const char * const name); void reset_variables(void); diff --git a/tizen/src/guest_debug.h b/tizen/src/guest_debug.h deleted file mode 100644 index c539d902b5..0000000000 --- a/tizen/src/guest_debug.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Emulator - * - * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * SeokYeon Hwang - * MunKyu Im - * GiWoong Kim - * YeongKyoon Lee - * HyunJun Son - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -/** - * @file guest_debug.h - * @brief - header of file these are config structures and defines in emulator - */ - -#ifndef __GUEST_DEBUG_H__ -#define __GUEST_DEBUG_H__ - -#include "exec/memory.h" - -char *get_logpath(void); -MemoryRegion *get_ram_memory(void); - -#endif /* __GUEST_DEBUG_H__ */ diff --git a/tizen/src/hw/maru_board.c b/tizen/src/hw/maru_board.c index ea61612524..e0feeb0855 100644 --- a/tizen/src/hw/maru_board.c +++ b/tizen/src/hw/maru_board.c @@ -38,36 +38,10 @@ * add some TIZEN-speciaized device... */ -#include - -#include "hw/hw.h" -#include "hw/i386/pc.h" -#include "hw/i386/apic.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_ids.h" -#include "hw/usb.h" -#include "net/net.h" #include "hw/boards.h" -#include "hw/ide.h" -#include "sysemu/kvm.h" -#include "hw/kvm/clock.h" -#include "sysemu/sysemu.h" -#include "hw/sysbus.h" -#include "hw/cpu/icc_bus.h" -#include "sysemu/arch_init.h" -#include "sysemu/blockdev.h" -#include "hw/i2c/smbus.h" -#include "hw/xen/xen.h" -#include "exec/memory.h" -#include "exec/address-spaces.h" -#include "hw/acpi/acpi.h" -#include "cpu.h" -#ifdef CONFIG_XEN -# include -#endif +#include "hw/i386/pc.h" -#include "maru_common.h" -#include "guest_debug.h" +#include "emulator_common.h" #include "maru_pm.h" #define MAX_IDE_BUS 2 diff --git a/tizen/src/maru_common.h b/tizen/src/maru_common.h deleted file mode 100644 index 2bfd57a15b..0000000000 --- a/tizen/src/maru_common.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Emulator - * - * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * SeokYeon Hwang - * MunKyu Im - * GiWoong Kim - * YeongKyoon Lee - * HyunJun Son - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -/** - * @file maru_common.h - * @brief - header file that covers maru common features - */ - -#ifndef __MARU_COMMON_H__ -#define __MARU_COMMON_H__ - -#include -#include -#include -#include -#include -#include -#include - -#include "config-host.h" - -#if !defined(PATH_MAX) -#if defined(MAX_PATH) -#define PATH_MAX MAX_PATH -#else -#define PATH_MAX 256 -#endif -#endif - -#define JAVA_MAX_COMMAND_LENGTH 1024 - -#define JAR_SKINFILE "emulator-skin.jar" -#define JAVA_LIBRARY_PATH "-Djava.library.path" - -#ifndef CONFIG_DARWIN -#define JAVA_EXEOPTION "-jar" -#else -#define JAVA_EXEOPTION "-XstartOnFirstThread -jar" // Must start the Java window on the first thread on Mac -#endif -#define JAVA_SIMPLEMODE_OPTION "simple.msg" - -#ifdef CONFIG_WIN32 -#define MY_KEY_WOW64_64KEY 0x0100 -#else -#define JAVA_EXEFILE_PATH "java" -#endif - - -// W/A for preserve larger continuous heap for RAM. -extern void *preallocated_ptr; - -#endif /* __MARU_COMMON_H__ */ diff --git a/tizen/src/ns_event.m b/tizen/src/ns_event.m index 9e71f07481..69928df519 100644 --- a/tizen/src/ns_event.m +++ b/tizen/src/ns_event.m @@ -1,15 +1,15 @@ -#import +#import #import "ns_event.h" // ns event loop for receive the events from cocoa framework void ns_event_loop(int* keepRunning) { - NSDate* distantFuture; + NSDate* distantFuture; NSRunLoop* theRunLoop = [NSRunLoop currentRunLoop]; do { distantFuture = [NSDate dateWithTimeIntervalSinceNow:0.5]; } - while (*keepRunning && [theRunLoop runMode:NSDefaultRunLoopMode beforeDate:distantFuture]); + while (*keepRunning && [theRunLoop runMode:NSDefaultRunLoopMode beforeDate:distantFuture]); // return [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 1]]; } diff --git a/tizen/src/scripts/sdbscript b/tizen/src/scripts/sdbscript new file mode 100755 index 0000000000..1f5b0b470a --- /dev/null +++ b/tizen/src/scripts/sdbscript @@ -0,0 +1,15 @@ +#!/bin/sh +if [ "$1" == "" ]; +then + echo "There is no emulator name for an argument. \nusage: sdbscript emulator-261xx" + exit -1 +else + TITLE=$1 + osascript > /dev/null << END + tell application "Terminal" + activate + do script "`pwd`/../../sdb -s $TITLE shell" + set custom title of first window to "$TITLE" + end tell +END +fi diff --git a/tizen/src/sdbscript b/tizen/src/sdbscript deleted file mode 100755 index 1f5b0b470a..0000000000 --- a/tizen/src/sdbscript +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -if [ "$1" == "" ]; -then - echo "There is no emulator name for an argument. \nusage: sdbscript emulator-261xx" - exit -1 -else - TITLE=$1 - osascript > /dev/null << END - tell application "Terminal" - activate - do script "`pwd`/../../sdb -s $TITLE shell" - set custom title of first window to "$TITLE" - end tell -END -fi diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c index 0c6fc22b22..5a327f02a8 100644 --- a/tizen/src/skin/maruskin_client.c +++ b/tizen/src/skin/maruskin_client.c @@ -35,7 +35,6 @@ #include "qemu-common.h" -#include "maru_common.h" #include "maruskin_client.h" #include "maruskin_server.h" #include "emulator.h" diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index 7bad11b4cc..bca9fd08ca 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -35,7 +35,6 @@ #include "sysemu/sysemu.h" #include "hw/sysbus.h" -#include "maru_common.h" #include "maruskin_operation.h" #include "hw/pci/maru_brightness.h" #include "hw/virtio/maru_virtio_hwkey.h" diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index 5c94ada3c8..e8229ee1c7 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -30,7 +30,6 @@ #include #include "emulator.h" -#include "maru_common.h" #include "maruskin_server.h" #include "maruskin_operation.h" #include "display/maru_display.h" diff --git a/tizen/src/util/maru_device_hotplug.c b/tizen/src/util/maru_device_hotplug.c index 578161b698..70d74981b1 100644 --- a/tizen/src/util/maru_device_hotplug.c +++ b/tizen/src/util/maru_device_hotplug.c @@ -34,7 +34,6 @@ #include "sysemu/blockdev.h" #include "qemu/event_notifier.h" -#include "maru_common.h" #include "emulator.h" #include "maru_device_hotplug.h" diff --git a/tizen/src/util/maru_err_table.c b/tizen/src/util/maru_err_table.c index 62c834de5f..b9d767f725 100644 --- a/tizen/src/util/maru_err_table.c +++ b/tizen/src/util/maru_err_table.c @@ -29,7 +29,7 @@ */ #include "qemu-common.h" -#include "maru_common.h" +#include "emulator_common.h" #include "maru_err_table.h" #include "debug_ch.h" diff --git a/tizen/src/util/osutil-linux.c b/tizen/src/util/osutil-linux.c index 8ebbb89c03..d9b3032d6b 100644 --- a/tizen/src/util/osutil-linux.c +++ b/tizen/src/util/osutil-linux.c @@ -35,9 +35,9 @@ */ #include -#include "maru_common.h" #include "osutil.h" #include "emulator.h" +#include "emul_state.h" #include "debug_ch.h" #include "maru_err_table.h" #include "sdb.h" diff --git a/tizen/src/util/osutil.h b/tizen/src/util/osutil.h index 338d1cb79b..ffa0596c5d 100644 --- a/tizen/src/util/osutil.h +++ b/tizen/src/util/osutil.h @@ -33,8 +33,7 @@ #define __OSUTIL_H__ #include "qemu-common.h" -#include "maru_common.h" -#include "emul_state.h" +#include "emulator_common.h" #define HTTP_PROTOCOL "http=" #define HTTP_PREFIX "http://" diff --git a/tizen/src/util/sdb.c b/tizen/src/util/sdb.c index fea3dda87d..f2728d5627 100644 --- a/tizen/src/util/sdb.c +++ b/tizen/src/util/sdb.c @@ -35,6 +35,7 @@ #include "block/nbd.h" #include "emulator.h" +#include "emulator_common.h" #include "debug_ch.h" #include "emul_state.h" diff --git a/tizen/src/util/sdb.h b/tizen/src/util/sdb.h index c1b6637993..98ec33d3b5 100644 --- a/tizen/src/util/sdb.h +++ b/tizen/src/util/sdb.h @@ -31,8 +31,6 @@ #ifndef SDB_SERVER_H_ #define SDB_SERVER_H_ -#include "maru_common.h" - #include #ifdef _WIN32 diff --git a/util/oslib-posix.c b/util/oslib-posix.c index c2bd47c2fb..f7a8325459 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -68,7 +68,7 @@ extern int daemon(int, int); #endif #ifdef CONFIG_MARU -#include "../../tizen/src/maru_common.h" +#include "../../tizen/src/emulator_common.h" #endif int qemu_get_thread_id(void) diff --git a/vl.c b/vl.c index 3cf5854d2b..5c83ae3c7e 100644 --- a/vl.c +++ b/vl.c @@ -130,7 +130,6 @@ int qemu_main(int argc, char **argv, char **envp); #include "qom/object_interfaces.h" #ifdef CONFIG_MARU -#include "tizen/src/maru_common.h" #include "tizen/src/emulator.h" #include "tizen/src/util/maru_err_table.h" #include "tizen/src/emul_state.h"