Lines Matching defs:res
139 static void dr_cpu_check_cpus(dr_cpu_hdr_t *req, dr_cpu_res_t *res);
140 static void dr_cpu_check_psrset(uint32_t *cpuids, dr_cpu_res_t *res, int nres);
141 static int dr_cpu_check_bound_thr(cpu_t *cp, dr_cpu_res_t *res);
144 static void dr_cpu_res_array_fini(dr_cpu_res_t *res, int nres);
145 static size_t dr_cpu_pack_response(dr_cpu_hdr_t *req, dr_cpu_res_t *res,
383 dr_cpu_res_t *res;
471 res = dr_cpu_res_array_init(req, drctl_rsrc, count);
480 dr_cpu_check_cpus(req, res);
493 if (res[idx].result != DR_CPU_RES_OK) {
502 res[idx].result = result;
503 res[idx].status = status;
511 (res[idx].string) ? res[idx].string : "");
522 *resp_len = dr_cpu_pack_response(req, res, resp);
537 dr_cpu_res_array_fini(res, count);
550 dr_cpu_res_t *res;
555 res = kmem_zalloc(nrsrc * sizeof (dr_cpu_res_t), KM_SLEEP);
557 __func__, (void *)res, nrsrc * sizeof (dr_cpu_res_t));
563 res[idx].cpuid = rsrc[idx].res_cpu_id;
564 res[idx].result = DR_CPU_RES_OK;
572 res[idx].result = DR_CPU_RES_BLOCKED;
573 res[idx].status = (req->msg_type == DR_CPU_CONFIGURE) ?
586 res[idx].string = kmem_alloc(err_len, KM_SLEEP);
588 __func__, (void *)(res[idx].string), err_len);
589 bcopy(err_str, res[idx].string, err_len);
593 return (res);
597 dr_cpu_res_array_fini(dr_cpu_res_t *res, int nres)
604 if (res[idx].string) {
605 str_len = strlen(res[idx].string) + 1;
607 __func__, (void *)(res[idx].string), str_len);
608 kmem_free(res[idx].string, str_len);
614 __func__, (void *)res, sizeof (dr_cpu_res_t) * nres);
615 kmem_free(res, sizeof (dr_cpu_res_t) * nres);
624 dr_cpu_pack_response(dr_cpu_hdr_t *req, dr_cpu_res_t *res, dr_cpu_hdr_t **respp)
651 if (res[idx].string != NULL) {
652 resp_len += strlen(res[idx].string) + 1;
678 resp_stat[idx].cpuid = res[idx].cpuid;
679 resp_stat[idx].result = res[idx].result;
680 resp_stat[idx].status = res[idx].status;
682 if (res[idx].string != NULL) {
684 str_len = strlen(res[idx].string) + 1;
685 bcopy(res[idx].string, curr_str, str_len);
707 dr_cpu_check_cpus(dr_cpu_hdr_t *req, dr_cpu_res_t *res)
729 dr_cpu_check_psrset(cpuids, res, req->num_records);
735 if (res[idx].result != DR_CPU_RES_OK)
753 (void) dr_cpu_check_bound_thr(cp, &res[idx]);
766 dr_cpu_check_psrset(uint32_t *cpuids, dr_cpu_res_t *res, int nres)
795 if (res[cpu_idx].result != DR_CPU_RES_OK)
837 res[cpu_idx].result = DR_CPU_RES_BLOCKED;
838 res[cpu_idx].status = DR_CPU_STAT_CONFIGURED;
845 res[cpu_idx].string = kmem_alloc(err_len, KM_SLEEP);
847 __func__, (void *)(res[cpu_idx].string), err_len);
848 bcopy(err_str, res[cpu_idx].string, err_len);
866 dr_cpu_check_bound_thr(cpu_t *cp, dr_cpu_res_t *res)
878 ASSERT(res->result == DR_CPU_RES_OK);
879 ASSERT(res->string == NULL);
927 res->result = DR_CPU_RES_BLOCKED;
928 res->status = DR_CPU_STAT_CONFIGURED;
935 res->string = kmem_alloc(err_len, KM_SLEEP);
937 __func__, (void *)(res->string), err_len);
938 bcopy(err_str, res->string, err_len);
943 return (res->result);