Lines Matching defs:res
202 static void dr_mem_res_array_fini(dr_mem_res_t *res, int nres);
203 static size_t dr_mem_pack_response(dr_mem_hdr_t *req, dr_mem_res_t *res,
430 dr_mem_res_t *res;
498 res = dr_mem_res_array_init(req, drctl_rsrc, count);
520 if (res[idx].result != DR_MEM_RES_OK) {
535 res[idx].result = result;
536 res[idx].status = status;
537 res[idx].addr = req_mblks[idx].addr; /* for partial case */
538 res[idx].size = req_mblks[idx].size; /* for partial case */
539 res[idx].string = dr_mem_get_errstr(result, subresult);
548 (res[idx].string) ? res[idx].string : "");
559 *resp_len = dr_mem_pack_response(req, res, resp);
570 dr_mem_res_array_fini(res, count);
583 dr_mem_res_t *res;
588 res = kmem_zalloc(nrsrc * sizeof (dr_mem_res_t), KM_SLEEP);
594 res[idx].addr = rsrc[idx].res_mem_addr;
595 res[idx].size = rsrc[idx].res_mem_size;
596 res[idx].result = DR_MEM_RES_OK;
604 res[idx].result = DR_MEM_RES_BLOCKED;
605 res[idx].status = (req->msg_type == DR_MEM_CONFIGURE) ?
618 res[idx].string = kmem_alloc(err_len, KM_SLEEP);
619 bcopy(err_str, res[idx].string, err_len);
623 return (res);
627 dr_mem_res_array_fini(dr_mem_res_t *res, int nres)
634 if (res[idx].string) {
635 str_len = strlen(res[idx].string) + 1;
636 kmem_free(res[idx].string, str_len);
641 kmem_free(res, sizeof (dr_mem_res_t) * nres);
650 dr_mem_pack_response(dr_mem_hdr_t *req, dr_mem_res_t *res, dr_mem_hdr_t **respp)
674 if (res[idx].string != NULL) {
675 resp_len += strlen(res[idx].string) + 1;
699 resp_stat[idx].addr = res[idx].addr;
700 resp_stat[idx].size = res[idx].size;
701 resp_stat[idx].result = res[idx].result;
702 resp_stat[idx].status = res[idx].status;
704 if (res[idx].string != NULL) {
706 str_len = strlen(res[idx].string) + 1;
707 bcopy(res[idx].string, curr_str, str_len);