static void my_win_del(void *data, Evas_Object *obj, void *event_info) { save_state(); release_cpu(); elm_exit(); }
int probe_cpu(struct dr_node *cpu, struct dr_info *dr_info) { char drc_index[DR_STR_MAX]; int probe_file; int write_len; int rc = 0; probe_file = open(CPU_PROBE_FILE, O_WRONLY); if (probe_file <= 0) { /* Attempt to add cpu from user-space, this may be an older * kernel without the infrastructure to handle dlpar. */ rc = acquire_cpu(cpu, dr_info); if (rc) return rc; rc = online_cpu(cpu, dr_info); if (rc) { /* Roll back the operation. Is this the correct * behavior? */ say(ERROR, "Unable to online %s\n", cpu->drc_name); offline_cpu(cpu); release_cpu(cpu, dr_info); cpu->unusable = 1; } } else { memset(drc_index, 0, DR_STR_MAX); write_len = sprintf(drc_index, "0x%x", cpu->drc_index); say(DEBUG, "Probing cpu 0x%x\n", cpu->drc_index); rc = write(probe_file, drc_index, write_len); if (rc != write_len) say(ERROR, "Probe failed! rc = %x\n", rc); else /* reset rc to success */ rc = 0; close(probe_file); } if (!rc) { update_cpu_node(cpu, NULL, dr_info); refresh_cache_info(dr_info); } return rc; }