maru_shm: no need to get the shmkey from another shm
authorgiwoong.kim <giwoong.kim@samsung.com>
Tue, 2 Apr 2013 06:12:37 +0000 (15:12 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Tue, 2 Apr 2013 08:46:02 +0000 (17:46 +0900)
There is a no need to get the shmkey value from
another shared memory.

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/hw/maru_vga.c
tizen/src/skin/client/native_src/share.c
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java
tizen/src/skin/maruskin_client.c
tizen/src/skin/maruskin_operation.c

index b6d78ede81ca32a187617623905285715c83f07c..ea7144454bcccfa6fd522008ac9edb0103636cc9 100644 (file)
@@ -57,17 +57,6 @@ int get_emul_skin_enable(void)
     return _emul_info.skin_enable;
 }
 
-/* current emulator condition */
-int get_emulator_condition(void)
-{
-    return _emul_state.emulator_condition;
-}
-
-void set_emulator_condition(int state)
-{
-    _emul_state.emulator_condition = state;
-}
-
 /* lcd screen size */
 void set_emul_lcd_size(int width, int height)
 {
@@ -120,6 +109,28 @@ int get_emul_max_touch_point(void)
     return _emul_info.max_touch_point;
 }
 
+/* base port for emualtor vm */
+void set_emul_vm_base_port(int port)
+{
+    _emul_info.vm_base_port = port;
+}
+
+int get_emul_vm_base_port(void)
+{
+    return _emul_info.vm_base_port;
+}
+
+/* current emulator condition */
+int get_emulator_condition(void)
+{
+    return _emul_state.emulator_condition;
+}
+
+void set_emulator_condition(int state)
+{
+    _emul_state.emulator_condition = state;
+}
+
 /* emulator window scale */
 void set_emul_win_scale(double scale_factor)
 {
@@ -191,7 +202,7 @@ int get_host_lock_key_state(int key)
     return -1;
 }
 
-/* manage CapsLock key state for usb keyboard input */
+/* manage CapsLock key state for host keyboard input */
 void set_emul_caps_lock_state(int state)
 {
     _emul_state.qemu_caps_lock = state;
@@ -199,10 +210,10 @@ void set_emul_caps_lock_state(int state)
 
 int get_emul_caps_lock_state(void)
 {
-    return  _emul_state.qemu_caps_lock;
+    return _emul_state.qemu_caps_lock;
 }
 
-/* manage NumLock key state for usb keyboard input */
+/* manage NumLock key state for host keyboard input */
 void set_emul_num_lock_state(int state)
 {
     _emul_state.qemu_num_lock = state;
@@ -210,5 +221,6 @@ void set_emul_num_lock_state(int state)
 
 int get_emul_num_lock_state(void)
 {
-    return  _emul_state.qemu_num_lock;
+    return _emul_state.qemu_num_lock;
 }
+
index 4a6baf9c7ed6666f4d3990b5d5006064ea89d63a..efb123230e87295dcd4659dc82a473d0fe550fdd 100644 (file)
@@ -80,7 +80,8 @@ typedef  struct EmulatorConfigInfo {
     int lcd_size_h;
     int sdl_bpp;
     int max_touch_point;
-    //TODO:
+    int vm_base_port;
+    /* add here */
 } EmulatorConfigInfo;
 
 typedef struct EmulatorConfigState {
@@ -90,7 +91,7 @@ typedef struct EmulatorConfigState {
     MultiTouchState qemu_mts;
     int qemu_caps_lock;
     int qemu_num_lock;
-    //TODO:
+    /* add here */
 } EmulatorConfigState;
 
 
@@ -100,6 +101,8 @@ void set_emul_lcd_size(int width, int height);
 void set_emul_win_scale(double scale);
 void set_emul_sdl_bpp(int bpp);
 void set_emul_max_touch_point(int cnt);
+void set_emul_vm_base_port(int port);
+
 void set_emulator_condition(int state);
 void set_emul_rotation(short rotation_type);
 void set_emul_caps_lock_state(int state);
@@ -112,6 +115,8 @@ int get_emul_lcd_height(void);
 double get_emul_win_scale(void);
 int get_emul_sdl_bpp(void);
 int get_emul_max_touch_point(void);
+int get_emul_vm_base_port(void);
+
 int get_emulator_condition(void);
 short get_emul_rotation(void);
 MultiTouchState *get_emul_multi_touch_state(void);
index 9651feae7d6b8ce727bf8513edd35ac50812c271..c7abf6d65a0964321516f9108db2c16a68885536 100644 (file)
@@ -345,20 +345,20 @@ static void prepare_basic_features(void)
     tizen_base_port = get_sdb_base_port();
 
     get_host_proxy(http_proxy, https_proxy, ftp_proxy, socks_proxy);
-    // using "DNS" provided by default QEMU
+    /* using "DNS" provided by default QEMU */
     g_strlcpy(dns, DEFAULT_QEMU_DNS_IP, strlen(DEFAULT_QEMU_DNS_IP) + 1);
 
     check_vm_lock();
     socket_init();
     make_vm_lock();
 
-    sdb_setup();
+    sdb_setup(); /* determine the base port for emulator */
+    set_emul_vm_base_port(tizen_base_port);
 
     gchar * const tmp_str = g_strdup_printf(" sdb_port=%d,"
-            " http_proxy=%s https_proxy=%s ftp_proxy=%s socks_proxy=%s"
-            " dns1=%s", tizen_base_port,
-            http_proxy, https_proxy, ftp_proxy, socks_proxy,
-            dns);
+        " http_proxy=%s https_proxy=%s ftp_proxy=%s socks_proxy=%s"
+        " dns1=%s", get_emul_vm_base_port(),
+        http_proxy, https_proxy, ftp_proxy, socks_proxy, dns);
 
     g_strlcat(maru_kernel_cmdline, tmp_str, LEN_MARU_KERNEL_CMDLINE);
 
index a6788be930e82f5cae68a255d9c77a097280ef54..fbb7f81bf550ca7792833cff2d5ded6495cc998c 100644 (file)
@@ -2,7 +2,7 @@
  * Maru vga device
  * Based on qemu/hw/vga.c
  *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include "maru_err_table.h"
+#include "emul_state.h"
 #endif
 
 #ifdef CONFIG_USE_SHM
 void *shared_memory = (void*) 0;
 int skin_shmid;
-int port_shmid;
 #endif
 
 
@@ -1873,34 +1873,19 @@ void maru_vga_common_init(VGACommonState *s)
     vga_dirty_log_start(s);
 
 #ifdef CONFIG_USE_SHM
-    int mykey;
-    void *temp;
+    /* base + 1 = sdb port */
+    /* base + 2 = shared memory key */
+    int mykey = get_emul_vm_base_port() + 2;
 
-    port_shmid = shmget((key_t)SHMKEY, (size_t)MAXLEN, 0666 | IPC_CREAT);
-    if (port_shmid == -1) {
-        ERR("shmget failed\n");
-        perror("maru_vga: ");
-        exit(1);
-    }
-
-    temp = shmat(port_shmid, (char*)0x0, 0);
-    if (temp == (void *)-1) {
-        ERR("shmat failed\n");
-        perror("maru_vga: ");
-        exit(1);
-    }
-
-    mykey = atoi(temp);
-    shmdt(temp);
-    
     INFO("shared memory key: %d, vga ram_size : %d\n", mykey, s->vram_size);
 
     skin_shmid = shmget((key_t)mykey, (size_t)s->vram_size, 0666 | IPC_CREAT);
     if (skin_shmid == -1) {
         ERR("shmget failed\n");
         perror("maru_vga: ");
-        maru_register_exit_msg(MARU_EXIT_UNKNOWN, (char*)"Cannot launch this VM.\n"
-                        "Shared memory is not enough.");
+        maru_register_exit_msg(MARU_EXIT_UNKNOWN,
+            (char*) "Cannot launch this VM.\n"
+            "Shared memory is not enough.");
         exit(0);
     }
 
@@ -1929,11 +1914,6 @@ void maru_vga_common_fini(void)
         ERR("shmctl failed\n");
         perror("maru_vga: ");
     }
-    
-    if (shmctl(port_shmid, IPC_RMID, 0) == -1) {
-        ERR("temp shmctl failed\n");
-        perror("maru_vga: ");
-    }
 }
 #endif
 
index 6a14d76837ae5054745c2f791b846559ea893279..a22fd035c45d65c1ac14e47342bc04fa17b0a084 100644 (file)
@@ -1,7 +1,7 @@
 /**
+ * Transmit the framebuffer from shared memory by JNI
  *
- *
- * Copyright ( C ) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
 #include "org_tizen_emulator_skin_EmulatorShmSkin.h"
 
 #define MAXLEN 512
-#define SHMKEY 26099
 
 void *shared_memory = (void *)0;
 int shmid;
 
 
 JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_shmget
-  (JNIEnv *env, jobject obj, jint vga_ram_size)
+    (JNIEnv *env, jobject obj, jint shmkey, jint vga_ram_size)
 {
-    void *temp;
-    int keyval;
-    shmid = shmget((key_t)SHMKEY, (size_t)MAXLEN, 0666 | IPC_CREAT);
-    if (shmid == -1) {
-           fprintf(stderr, "share.c: shmget failed\n");
-        exit(1);
-    }
-    
-    temp = shmat(shmid, (char*)0x0, 0);
-    if (temp == (void *)-1) {
-        fprintf(stderr, "share.c: shmat failed\n");
-        exit(1);
-    }
-    keyval = atoi(temp);
-    fprintf(stdout, "share.c: shared memory key = %d\n", keyval);
-    shmdt(temp);
+    fprintf(stdout, "share.c: shared memory key = %d\n", shmkey);
+    fflush(stdout);
 
-    shmid = shmget((key_t)keyval, (size_t)vga_ram_size, 0666 | IPC_CREAT);
+    shmid = shmget((key_t)shmkey, (size_t)vga_ram_size, 0666 | IPC_CREAT);
     if (shmid == -1) {
         fprintf(stderr, "share.c: shmget failed\n");
+        fflush(stderr);
         return 1;
     }
 
-    /* We now make the shared memory accessible to the program. */
+    /* We now make the shared memory accessible to the program */
     shared_memory = shmat(shmid, (void *)0, 0);
     if (shared_memory == (void *)-1) {
         fprintf(stderr, "share.c: shmat failed\n");
+        fflush(stderr);
         return 2;
     }
 
@@ -79,37 +66,42 @@ JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_shmget
 }
 
 JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_shmdt
-  (JNIEnv *env, jobject obj)
+    (JNIEnv *env, jobject obj)
 {
     /* Lastly, the shared memory is detached */
     if (shmdt(shared_memory) == -1) {
         fprintf(stderr, "share.c: shmdt failed\n");
+        fflush(stderr);
         perror("share.c: ");
         return 1;
     }
-/*    
+
+    /*
     if (shmctl(shmid, IPC_RMID, 0) == -1) {
         fprintf(stderr, "share.c: shmctl failed\n");
+        fflush(stderr);
         perror("share.c: ");
     }
-*/
+    */
+
     return 0;
 }
 
 JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorShmSkin_getPixels
-  (JNIEnv *env, jobject obj, jintArray array)
+    (JNIEnv *env, jobject obj, jintArray array)
 {
     int i = 0;
     int len = (*env)->GetArrayLength(env, array);
     if (len <= 0) {
         fprintf(stderr, "share.c: get length failed\n");
+        fflush(stderr);
         return -1;
     }
 
     int *framebuffer = (int *)shared_memory;
 
     jint value = 0xFFFFFFFF;
-    for(i = 0; i < len; i++) {
+    for (i = 0; i < len; i++) {
         value = framebuffer[i];
         (*env)->SetIntArrayRegion(env, array, i, 1, &value); 
     }
index 1718babae2204afedddbab81d63b15c119513014..6cd1bde18e05389c06e0574433303730cc1fbbcd 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * Emulator Skin Process
  *
- * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * GiWoong Kim <giwoong.kim@samsung.com>
@@ -40,6 +40,7 @@ import org.eclipse.swt.graphics.PaletteData;
 import org.eclipse.swt.graphics.Transform;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.emulator.skin.config.EmulatorConfig;
+import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
 import org.tizen.emulator.skin.exception.ScreenShotException;
 import org.tizen.emulator.skin.image.ImageRegistry.IconName;
 import org.tizen.emulator.skin.info.SkinInformation;
@@ -57,7 +58,7 @@ public class EmulatorShmSkin extends EmulatorSkin {
        public static final int COLOR_DEPTH = 32;
 
        /* define JNI functions */
-       public native int shmget(int size);
+       public native int shmget(int shmkey, int size);
        public native int shmdt();
        public native int getPixels(int[] array);
 
@@ -175,8 +176,13 @@ public class EmulatorShmSkin extends EmulatorSkin {
        public long initLayout() {
                super.initLayout();
 
+               /* base + 1 = sdb port */
+               /* base + 2 = shared memory key */
+               int shmkey = config.getArgInt(ArgsConstants.NET_BASE_PORT) + 2;
+               logger.info("shmkey = " + shmkey);
+
                /* initialize shared memory */
-               int result = shmget(
+               int result = shmget(shmkey,
                                currentState.getCurrentResolutionWidth() *
                                currentState.getCurrentResolutionHeight());
                logger.info("shmget native function returned " + result);
index d6f72d5af1c7e97140be564679b660ebd83102fa..d93a1bda2e4a16329ef6ff49b7b54b360fdca0b5 100644 (file)
@@ -176,8 +176,11 @@ public class EmulatorSkinMain {
                        }
 
                        boolean skinPhoneShape = true;
-                       String skinInfoResolutionW = skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_WIDTH);
-                       String skinInfoResolutionH = skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_HEIGHT);
+                       String skinInfoResolutionW =
+                                       skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_WIDTH);
+                       String skinInfoResolutionH =
+                                       skinInfoProperties.getProperty(SkinInfoConstants.RESOLUTION_HEIGHT);
+
                        if (skinInfoResolutionW.equalsIgnoreCase("all") ||
                                        skinInfoResolutionH.equalsIgnoreCase("all")) {
                                skinPhoneShape = false;
index 6dce373125c434dca99c1c5003fef4116c78afaa..3048bd42996ea6c72dad7987fe00294e58ed09d4 100644 (file)
@@ -103,14 +103,16 @@ public class EmulatorConfig {
        private Properties configProperties;
        private String skinPropertiesFilePath;
 
-       public EmulatorConfig( Map<String, String> args, EmulatorUI dbiContents, Properties skinProperties,
-                       String skinPropertiesFilePath, Properties configProperties ) {
+       public EmulatorConfig(Map<String, String> args,
+                       EmulatorUI dbiContents, Properties skinProperties,
+                       String skinPropertiesFilePath, Properties configProperties) {
                this.args = args;
                this.dbiContents = dbiContents;
                this.skinProperties = skinProperties;
                this.skinPropertiesFilePath = skinPropertiesFilePath;
                this.configProperties = configProperties;
-               if ( null == configProperties ) {
+
+               if (null == configProperties) {
                        this.configProperties = new Properties();
                }
        }
index 24722f9e3518b50d58edadc13ae8f6ca511731d0..c79503385eea3c7522aabd5efff33103f2bcdace 100644 (file)
@@ -59,7 +59,6 @@ MULTI_DEBUG_CHANNEL(qemu, skin_client);
 #define OPT_MAX_TOUCHPOINT "max.touchpoint"
 
 extern char tizen_target_path[];
-extern int tizen_base_port;
 
 static int skin_argc;
 static char** skin_argv;
@@ -94,7 +93,7 @@ static void* run_skin_client(void* arg)
     char buf_tizen_base_port[16];
     sprintf(buf_skin_server_port, "%d", skin_server_port);
     sprintf(buf_uid, "%d", uid);
-    sprintf(buf_tizen_base_port, "%d", tizen_base_port);
+    sprintf(buf_tizen_base_port, "%d", get_emul_vm_base_port());
 
 #ifdef CONFIG_WIN32
     // find java path in 64bit windows
@@ -118,11 +117,12 @@ static void* run_skin_client(void* arg)
     char* bin_dir = get_bin_path();
 #endif
     INFO("bin directory : %s\n", bin_dir);
+
     int maxtouchpoint = get_emul_max_touch_point();
     int len_maxtouchpoint;
-    if(maxtouchpoint > 9) {
+    if (maxtouchpoint > 9) {
         len_maxtouchpoint = 2;
-    }else {
+    } else {
         len_maxtouchpoint = 1;
     }
 
@@ -150,9 +150,9 @@ static void* run_skin_client(void* arg)
         OPT_SVR_PORT, skin_server_port,
         OPT_UID, uid,
         OPT_VM_PATH, vm_path,
-        OPT_NET_BASE_PORT, tizen_base_port,
+        OPT_NET_BASE_PORT, get_emul_vm_base_port(),
         OPT_MAX_TOUCHPOINT, maxtouchpoint,
-        argv );
+        argv);
 
     INFO("command for swt : %s\n", cmd);
 
@@ -261,10 +261,11 @@ int start_skin_client(int argc, char* argv[])
         } else {
             count++;
             INFO("sleep for ready. count:%d\n", count);
+
 #ifdef CONFIG_WIN32
-        Sleep(SKIN_SERVER_SLEEP_TIME);
+            Sleep(SKIN_SERVER_SLEEP_TIME);
 #else
-        usleep(1000 * SKIN_SERVER_SLEEP_TIME);
+            usleep(1000 * SKIN_SERVER_SLEEP_TIME);
 #endif
         }
 
index ffb1e2f8d532cc03024fff683a3281a192aaa440..b6ade33c46be8a3c251113579408bf62e711e32d 100644 (file)
@@ -58,7 +58,6 @@
 #if defined(CONFIG_USE_SHM) && defined(TARGET_I386)
 #include <sys/shm.h>
 int g_shmid;
-extern int port_shmid;
 #endif
 
 MULTI_DEBUG_CHANNEL(qemu, skin_operation);
@@ -80,11 +79,15 @@ extern pthread_mutex_t mutex_screenshot;
 extern pthread_cond_t cond_screenshot;
 
 extern int tizen_base_port;
+
 static void* run_timed_shutdown_thread(void* args);
-static void send_to_emuld(const char* request_type, int request_size, const char* send_buf, int buf_size);
+static void send_to_emuld(const char* request_type,
+    int request_size, const char* send_buf, int buf_size);
+
 
 void start_display(uint64 handle_id,
-    int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type)
+    int lcd_size_width, int lcd_size_height,
+    double scale_factor, short rotation_type)
 {
     INFO("start_display handle_id:%ld, lcd size:%dx%d, scale_factor:%f, rotation_type:%d\n",
         (long)handle_id, lcd_size_width, lcd_size_height, scale_factor, rotation_type);
@@ -358,7 +361,7 @@ QemuSurfaceInfo* get_screenshot_info(void)
     info->pixel_data = (unsigned char*) g_malloc0( length );
     if ( !info->pixel_data ) {
         g_free( info );
-        ERR( "Fail to malloc for pixel data.\n");
+        ERR("Fail to malloc for pixel data.\n");
         return NULL;
     }
 
@@ -371,8 +374,8 @@ QemuSurfaceInfo* get_screenshot_info(void)
 
     pthread_mutex_lock(&mutex_screenshot);
     MaruScreenshot* maru_screenshot = get_maru_screenshot();
-    if ( !maru_screenshot || maru_screenshot->isReady != 1) {
-        ERR( "maru screenshot is NULL or not ready.\n" );
+    if (!maru_screenshot || maru_screenshot->isReady != 1) {
+        ERR("maru screenshot is NULL or not ready.\n");
         memset(info->pixel_data, 0x00, length);
     } else {
         maru_screenshot->pixel_data = info->pixel_data;
@@ -490,6 +493,7 @@ void free_detail_info(DetailInfo* detail_info)
 void do_open_shell(void)
 {
     INFO("open shell\n");
+
     /* do nothing */
 }
 
@@ -535,50 +539,49 @@ void request_close(void)
 
 }
 
-void shutdown_qemu_gracefully( void ) {
-
+void shutdown_qemu_gracefully(void)
+{
     requested_shutdown_qemu_gracefully = 1;
 
     pthread_t thread_id;
-    if( 0 > pthread_create( &thread_id, NULL, run_timed_shutdown_thread, NULL ) ) {
-        ERR( "!!! Fail to create run_timed_shutdown_thread. shutdown qemu right now !!!\n"  );
+    if (0 > pthread_create(
+        &thread_id, NULL, run_timed_shutdown_thread, NULL)) {
+
+        ERR("!!! Fail to create run_timed_shutdown_thread. shutdown qemu right now !!!\n");
         qemu_system_shutdown_request();
     }
 
 }
 
-int is_requested_shutdown_qemu_gracefully( void ) {
+int is_requested_shutdown_qemu_gracefully(void)
+{
     return requested_shutdown_qemu_gracefully;
 }
 
-static void* run_timed_shutdown_thread( void* args ) {
-
-    send_to_emuld( "system\n\n\n\n", 10, "shutdown", 8 );
+static void* run_timed_shutdown_thread(void* args)
+{
+    send_to_emuld("system\n\n\n\n", 10, "shutdown", 8);
 
-    int sleep_interval_time = 1000; // milli-seconds
+    int sleep_interval_time = 1000; /* milli-seconds */
 
     int i;
-    for ( i = 0; i < TIMEOUT_FOR_SHUTDOWN; i++ ) {
+    for (i = 0; i < TIMEOUT_FOR_SHUTDOWN; i++) {
 #ifdef CONFIG_WIN32
-        Sleep( sleep_interval_time );
+        Sleep(sleep_interval_time);
 #else
-        usleep( sleep_interval_time * 1000 );
+        usleep(sleep_interval_time * 1000);
 #endif
-        // do not use logger to help user see log in console
-        fprintf( stdout, "Wait for shutdown qemu...%d\n", ( i + 1 ) );
+        /* do not use logger to help user see log in console */
+        fprintf(stdout, "Wait for shutdown qemu...%d\n", (i + 1));
     }
 
-    INFO( "Shutdown qemu !!!\n" );
+    INFO("Shutdown qemu !!!\n");
+
 #if defined(CONFIG_USE_SHM) && defined(TARGET_I386)
     if (shmctl(g_shmid, IPC_RMID, 0) == -1) {
         ERR("shmctl failed\n");
         perror("maruskin_operation.c:g_shmid: ");
     }
-
-    if (shmctl(port_shmid, IPC_RMID, 0) == -1) {
-        ERR("shmctl failed\n");
-        perror("maruskin_operation.c:port_shmid: ");
-    }
 #endif
 
     qemu_system_shutdown_request();
@@ -587,8 +590,9 @@ static void* run_timed_shutdown_thread( void* args ) {
 
 }
 
-static void send_to_emuld( const char* request_type, int request_size, const char* send_buf, int buf_size ) {
-
+static void send_to_emuld(const char* request_type,
+    int request_size, const char* send_buf, int buf_size)
+{
     int s = tcp_socket_outgoing( "127.0.0.1", (uint16_t) ( tizen_base_port + SDB_TCP_EMULD_INDEX ) );
 
     if ( s < 0 ) {