/** * Request powerup */ void mce_dsme_request_powerup(void) { /* Set up the message */ DSM_MSGTYPE_POWERUP_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_POWERUP_REQ); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_POWERUP_REQ"); }
/** * Send system state inquiry */ static void mce_dsme_query_system_state(void) { /* Set up the message */ DSM_MSGTYPE_STATE_QUERY msg = DSME_MSG_INIT(DSM_MSGTYPE_STATE_QUERY); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_STATE_QUERY"); }
/** * Request reboot */ void request_reboot(void) { /* Set up the message */ DSM_MSGTYPE_REBOOT_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_REBOOT_REQ); /* Send the message */ mce_dsme_send(&msg); mce_log(LL_DEBUG, "DSM_MSGTYPE_REBOOT_REQ sent to DSME"); }
/** * Register to DSME process watchdog */ static void mce_dsme_init_processwd(void) { /* Set up the message */ DSM_MSGTYPE_PROCESSWD_CREATE msg = DSME_MSG_INIT(DSM_MSGTYPE_PROCESSWD_CREATE); msg.pid = getpid(); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_PROCESSWD_CREATE"); }
/** * Request powerup */ void request_powerup(void) { /* Set up the message */ DSM_MSGTYPE_POWERUP_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_POWERUP_REQ); /* Send the message */ mce_dsme_send(&msg); mce_log(LL_DEBUG, "DSM_MSGTYPE_POWERUP_REQ sent to DSME"); }
/** * Send system state inquiry */ static void query_system_state(void) { /* Set up the message */ DSM_MSGTYPE_STATE_QUERY msg = DSME_MSG_INIT(DSM_MSGTYPE_STATE_QUERY); /* Send the message */ mce_dsme_send(&msg); mce_log(LL_DEBUG, "DSM_MSGTYPE_STATE_QUERY sent to DSME"); }
/** * Request normal shutdown */ void request_normal_shutdown(void) { /* Set up the message */ DSM_MSGTYPE_SHUTDOWN_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_SHUTDOWN_REQ); /* Send the message */ mce_dsme_send(&msg); mce_log(LL_DEBUG, "DSM_MSGTYPE_SHUTDOWN_REQ (DSME_NORMAL_SHUTDOWN) " "sent to DSME"); }
/** * Unregister from DSME process watchdog */ static void mce_dsme_exit_processwd(void) { mce_log(LL_DEBUG, "Disabling DSME process watchdog"); /* Set up the message */ DSM_MSGTYPE_PROCESSWD_DELETE msg = DSME_MSG_INIT(DSM_MSGTYPE_PROCESSWD_DELETE); msg.pid = getpid(); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_PROCESSWD_DELETE"); }
/** * Send pong message to the DSME process watchdog */ static void mce_dsme_send_pong(void) { /* Set up the message */ DSM_MSGTYPE_PROCESSWD_PONG msg = DSME_MSG_INIT(DSM_MSGTYPE_PROCESSWD_PONG); msg.pid = getpid(); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_PROCESSWD_PONG"); /* Execute hearbeat actions even if ping-pong ipc failed */ execute_datapipe(&heartbeat_pipe, GINT_TO_POINTER(0), USE_INDATA, DONT_CACHE_INDATA); }
/** * Request normal shutdown */ void mce_dsme_request_normal_shutdown(void) { if( datapipe_get_gint(update_mode_pipe) ) { mce_log(LL_WARN, "shutdown blocked; os update in progress"); goto EXIT; } /* Set up the message */ DSM_MSGTYPE_SHUTDOWN_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_SHUTDOWN_REQ); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_SHUTDOWN_REQ(DSME_NORMAL_SHUTDOWN)"); EXIT: return; }
/** * Request reboot */ void mce_dsme_request_reboot(void) { if( datapipe_get_gint(update_mode_pipe) ) { mce_log(LL_WARN, "reboot blocked; os update in progress"); goto EXIT; } /* Set up the message */ DSM_MSGTYPE_REBOOT_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_REBOOT_REQ); /* Send the message */ mce_dsme_send(&msg, "DSM_MSGTYPE_REBOOT_REQ"); EXIT: return; }
/** * Send pong message to the DSME process watchdog */ static void dsme_send_pong(void) { /* Set up the message */ DSM_MSGTYPE_PROCESSWD_PONG msg = DSME_MSG_INIT(DSM_MSGTYPE_PROCESSWD_PONG); msg.pid = getpid(); /* Send the message */ mce_dsme_send(&msg); mce_log(LL_DEBUG, "DSM_MSGTYPE_PROCESSWD_PONG sent to DSME"); execute_datapipe(&heartbeat_pipe, GINT_TO_POINTER(0), USE_INDATA, DONT_CACHE_INDATA); }