@findex -disable-skin
ETEXI
+DEF("ignore-suspend-lock", 0, QEMU_OPTION_ignore_suspend_lock, "", QEMU_ARCH_ALL)
+STEXI
+@item -ignore-suspend-lock
+@findex -ignore-suspend-lock
+Disable suspend lock statement in order to reach suspend power state
+ETEXI
+
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)
static pthread_mutex_t mutex_clilist = PTHREAD_MUTEX_INITIALIZER;
+static int suspend_state = 1;
+
+void ecs_set_suspend_state(int state)
+{
+ suspend_state = state;
+}
+
+int ecs_get_suspend_state(void)
+{
+ return suspend_state;
+}
+
static char* get_emulator_ecs_log_path(void)
{
gchar *emulator_ecs_log_path = NULL;
int suspend_cnt;
uint8_t outbuf[OUT_BUF_SIZE];
int outbuf_index;
- CPUArchState *mon_cpu;
void *password_opaque;
QError *error;
QLIST_HEAD(,mon_fd_t) fds;
/* version check */
//void send_ecs_version_check(ECS_Client* ccli);
+/* Suspend/resume */
+#define SUSPEND_LOCK 1
+#define SUSPEND_UNLOCK 0
+int ecs_get_suspend_state(void);
+void ecs_set_suspend_state(int state);
+void ecs_suspend_lock_state(int state);
+
/* request */
int accel_min_max(double value);
void req_set_sensor_accel(int x, int y, int z);
#endif
static void msgproc_injector_ans(ECS_Client* ccli, const char* category, bool succeed)
{
+ if (ccli == NULL) {
+ return;
+ }
int catlen = 0;
ECS__Master master = ECS__MASTER__INIT;
ECS__InjectorAns ans = ECS__INJECTOR_ANS__INIT;
msgproc_injector_ans(ccli, cmd, ret);
return false;
}
+
+void ecs_suspend_lock_state(int state)
+{
+ int catlen;
+
+ ECS__InjectorReq msg = ECS__INJECTOR_REQ__INIT;
+ const char* category = "suspend";
+
+ catlen = strlen(category);
+ msg.category = (char*) g_malloc0(catlen + 1);
+ memcpy(msg.category, category, catlen);
+
+ msg.group = 5;
+ msg.action = state;
+
+ msgproc_injector_req(NULL, &msg);
+}
+
#if 0
void msgproc_checkversion_req(ECS_Client* ccli, ECS__CheckVersionReq* msg)
{
return true;
}
+static bool injector_req_handle(const char* cat)
+{
+ if (!strncmp(cat, "suspend", 7)) {
+ ecs_suspend_lock_state(ecs_get_suspend_state());
+ return true;
+ }
+
+ return false;
+}
+
bool send_injector_ntf(const char* data, const int len)
{
type_length length = 0;
read_val_char(data + catsize + 2, &group);
read_val_char(data + catsize + 2 + 1, &action);
+ if (injector_req_handle(cat)) {
+ return true;
+ }
const char* ijdata = (data + catsize + 2 + 1 + 1);
ntf.category = (char*) g_malloc(catsize + 1);
strncpy(ntf.category, cat, 10);
-
ntf.length = length;
ntf.group = group;
ntf.action = action;
#include "maru_common.h"
#include "hw/maru_virtio_hwkey.h"
#include "hw/maru_pm.h"
+#include "ecs/ecs.h"
MULTI_DEBUG_CHANNEL(qemu, guest_server);
pthread_mutex_unlock(&mutex_clilist);
}
-static void send_to_client(GS_Client* client, int state)
+static void send_to_sdb_client(GS_Client* client, int state)
{
struct sockaddr_in sock_addr;
int s, slen = sizeof(sock_addr);
QTAILQ_FOREACH(client, &clients, next)
{
- send_to_client(client, state);
+ send_to_sdb_client(client, state);
}
pthread_mutex_unlock(&mutex_clilist);
INFO("Added new sdb client. ip: %s, port: %d, serial: %s\n", inet_ntoa((client->addr).sin_addr), client->port, client->serial);
- send_to_client(client, runstate_check(RUN_STATE_SUSPENDED));
+ send_to_sdb_client(client, runstate_check(RUN_STATE_SUSPENDED));
}
static int parse_val(char* buff, unsigned char data, char* parsbuf)
maru_hwkey_event(RELEASE, POWER_KEY);
}
+static void suspend_lock_state(int state)
+{
+ ecs_suspend_lock_state(state);
+}
+
static void command_handler(char* readbuf, struct sockaddr_in* client_addr)
{
char command[RECV_BUF_SIZE];
register_sdb_server(readbuf, client_addr);
} else if (strcmp(command, "6\n") == 0) {
wakeup_guest();
+ } else if (strcmp(command, "7\n") == 0) {
+ suspend_lock_state(SUSPEND_LOCK);
+ } else if (strcmp(command, "8\n") == 0) {
+ suspend_lock_state(SUSPEND_UNLOCK);
} else {
INFO("!!! unknown command : %s\n", command);
}
#include "tizen/src/emul_state.h"
#include "tizen/src/maru_display.h"
#include "tizen/src/skin/maruskin_operation.h"
+#include "tizen/src/ecs/ecs.h"
#endif
//#define DEBUG_NET
exit(1);
#endif
break;
+#ifdef CONFIG_MARU
+ case QEMU_OPTION_ignore_suspend_lock:
+ ecs_set_suspend_state(SUSPEND_UNLOCK);
+ break;
+#endif
case QEMU_OPTION_object:
opts = qemu_opts_parse(qemu_find_opts("object"), optarg, 1);
if (!opts) {