/* * Start system */ EXPORT void start_system( void ) { ER ercd; /* Initialize segment manager */ DispProgress(0x30); ercd = start_segmgr(); if ( ercd < E_OK ) { goto err_ret; } /* Start memory manager */ DispProgress(0x31); ercd = start_memmgr(); if ( ercd < E_OK ) { goto err_ret; } /* Initialize system manager */ DispProgress(0x32); ercd = SystemManager(0, NULL); if ( ercd < E_OK ) { goto err_ret; } /* Initialize library (libtk) V/K/Smalloc is available after this. */ DispProgress(0x33); _InitLibtk(); /* Lower the initial task priority to initialize sequence for the subsystem task at first. */ tk_chg_pri(TSK_SELF, InitTaskPri); /* Start system dependent sequence */ DispProgress(0x34); ercd = start_device(); if ( ercd < E_OK ) { goto err_ret; } /* Start subsystem */ DispProgress(0x35); ercd = start_subsystems(); if ( ercd < E_OK ) { goto err_ret; } return; err_ret: #if USE_KERNEL_MESSAGE tm_putstring((UB*)"!ERROR! start_system\n"); #endif tm_monitor(); /* Stop */ }
static void update_device_status(struct device *dev) { if (dev->desc->status == 0) reset_device(dev); else if (dev->desc->status & VIRTIO_CONFIG_S_FAILED) { warnx("Device %s configuration FAILED", dev->name); if (dev->running) reset_device(dev); } else { if (dev->running) err(1, "Device %s features finalized twice", dev->name); start_device(dev); } }
static void on_device_menu_changed (GtkComboBox * combo_box, gpointer user_data) { BtSettingsPageInteractionController *self = BT_SETTINGS_PAGE_INTERACTION_CONTROLLER (user_data); GObject *device = NULL; BtObjectListModel *store; GtkTreeModel *model; GtkTreeIter iter; GList *node, *list; // release the old one if (self->priv->device) { stop_device (self); } GST_INFO ("interaction controller device changed"); model = gtk_combo_box_get_model (self->priv->device_menu); if (gtk_combo_box_get_active_iter (self->priv->device_menu, &iter)) { device = bt_object_list_model_get_object (BT_OBJECT_LIST_MODEL (model), &iter); } // update list of controllers store = bt_object_list_model_new (2, BTIC_TYPE_CONTROL, "bound", "name"); if (device) { g_object_get (device, "controls", &list, NULL); for (node = list; node; node = g_list_next (node)) { bt_object_list_model_append (store, (GObject *) node->data); g_signal_connect_object (node->data, "notify::value", G_CALLBACK (notify_controlchange), (gpointer) self, 0); } g_list_free (list); // activate the new one self->priv->device = g_object_ref ((gpointer) device); start_device (self); } GST_INFO ("control list refreshed"); gtk_widget_set_sensitive (GTK_WIDGET (self->priv->controller_list), (device != NULL)); gtk_tree_view_set_model (self->priv->controller_list, GTK_TREE_MODEL (store)); g_object_unref (store); // drop with treeview }
static void startElementNs (void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI, int nb_namespaces, const xmlChar **namespaces, int nb_attributes, int nb_defaulted, const xmlChar **attributes) { parse_context_t* context = (parse_context_t*) ctx; if (xmlStrEqual(localname,ELEM_DEVICE)) { start_device(context, nb_attributes, attributes); } else if (xmlStrEqual(localname, ELEM_CAPABILITY)) { start_capability(context, nb_attributes, attributes); } else { // ignore other } }
int main(int argc, char *argv[]) { int i; const char *name; if (argc <= 1) { return list_devices(); } else { for (i = 1; i < argc; i++) { name = argv[i]; if (name[0] == '+') { start_device(name + 1); } else if (name[0] == '-') { stop_device(name + 1); } else { printf("USAGE: %s [+|-]input_device_name\n", argv[0]); } } } return 0; }
static int nui_start_device() { lua_pushnumber(L, start_device()); return 1; }