Lines Matching refs:lhp

174 get_local_core_md(ldom_hdl_t *lhp, uint64_t **buf)
188 bufp = (uint64_t *)lhp->allocp(size);
191 lhp->freep(bufp, size);
204 get_local_md_prop_value(ldom_hdl_t *lhp, char *node, char *prop, uint64_t *val)
210 if ((bufsiz = get_local_core_md(lhp, &bufp)) > 0) {
213 if (mdp = md_init_intern(bufp, lhp->allocp, lhp->freep)) {
218 listp = lhp->allocp(sizeof (mde_cookie_t) * num_nodes);
228 lhp->freep(listp, sizeof (mde_cookie_t) * num_nodes);
231 lhp->freep(bufp, bufsiz);
243 cpu_phys2virt(ldom_hdl_t *lhp, uint32_t cpuid)
262 if ((bufsize = get_local_core_md(lhp, &bufp)) < 1)
265 if ((mdp = md_init_intern(bufp, lhp->allocp, lhp->freep)) == NULL ||
267 lhp->freep(bufp, bufsize);
271 listp = (mde_cookie_t *)lhp->allocp(sizeof (mde_cookie_t) * num_nodes);
293 lhp->freep(listp, sizeof (mde_cookie_t) * num_nodes);
295 lhp->freep(bufp, bufsize);
301 get_type(ldom_hdl_t *lhp, uint32_t *type)
314 if (get_local_md_prop_value(lhp, MD_STR_PLATFORM, MD_STR_DOM_CAPABLE,
338 if ((bufsize = get_local_core_md(lhp, &bufp)) < 1)
340 if ((mdp = md_init_intern(bufp, lhp->allocp, lhp->freep)) == NULL) {
341 lhp->freep(bufp, bufsize);
345 lhp->freep(bufp, bufsize);
351 listp = lhp->allocp(sizeof (mde_cookie_t) * num_nodes);
370 lhp->freep(listp, sizeof (mde_cookie_t) * num_nodes);
372 lhp->freep(bufp, bufsize);
378 ldom_get_type(ldom_hdl_t *lhp, uint32_t *type)
404 rc = get_type(lhp, &ltype);
419 ldom_fmri_status(ldom_hdl_t *lhp, nvlist_t *nvl)
438 == 0 && (vid = cpu_phys2virt(lhp, cpuid)) != -1)
465 ret = ldmsvcs_cpu_req_status(lhp, cpuid);
471 ret = ldmsvcs_mem_req_status(lhp, pa);
481 ldom_fmri_retire(ldom_hdl_t *lhp, nvlist_t *nvl)
500 == 0 && (vid = cpu_phys2virt(lhp, cpuid)) != -1)
527 ret = ldmsvcs_cpu_req_offline(lhp, cpuid);
533 ret = ldmsvcs_mem_req_retire(lhp, pa);
542 ldom_fmri_unretire(ldom_hdl_t *lhp, nvlist_t *nvl)
561 == 0 && (vid = cpu_phys2virt(lhp, cpuid)) != -1)
588 ret = ldmsvcs_cpu_req_online(lhp, cpuid);
594 ret = ldmsvcs_mem_req_unretire(lhp, pa);
603 fmri_blacklist(ldom_hdl_t *lhp, nvlist_t *nvl, int cmd)
608 if ((ldom_get_type(lhp, &type) != 0) ||
629 (blr.bl_fmri = (caddr_t)lhp->allocp(blr.bl_fmrisz)) ==
640 lhp->freep((void *)&blr.bl_fmri, blr.bl_fmrisz);
656 ldom_fmri_blacklist(ldom_hdl_t *lhp, nvlist_t *nvl)
658 return (fmri_blacklist(lhp, nvl, BLIOC_INSERT));
665 ldom_fmri_unblacklist(ldom_hdl_t *lhp, nvlist_t *nvl)
667 return (fmri_blacklist(lhp, nvl, BLIOC_DELETE));
672 ldom_get_local_md(ldom_hdl_t *lhp, uint64_t **buf)
674 return (get_local_core_md(lhp, buf));
678 ldom_get_core_md(ldom_hdl_t *lhp, uint64_t **buf)
684 if (ldom_get_type(lhp, &type) != 0) {
690 if ((rv = ldmsvcs_get_core_md(lhp, buf)) < 1) {
693 buf, lhp->allocp, lhp->freep);
702 rv = ldom_pri_get(PRI_GET, &tok, buf, lhp->allocp, lhp->freep);
710 ldom_find_id(ldom_hdl_t *lhp, uint64_t addr, ldom_rsrc_t rsrc,
715 (void) ldom_get_type(lhp, &type);
722 return (ldmsvcs_io_req_id(lhp, addr, rsrc, virt_addr,
727 ldom_register_event(ldom_hdl_t *lhp, ldom_reg_cb_t cb, ldom_cb_arg_t data)
731 (void) ldom_get_type(lhp, &type);
736 return (xmpp_add_client(lhp, cb, data));
740 ldom_unregister_event(ldom_hdl_t *lhp)
744 (void) ldom_get_type(lhp, &type);
749 return (xmpp_remove_client(lhp));
766 struct ldom_hdl *lhp;
783 if ((lhp = allocp(sizeof (struct ldom_hdl))) == NULL) {
791 lhp->allocp = allocp;
792 lhp->freep = freep;
794 ldmsvcs_init(lhp);
796 return (lhp);
801 ldom_fini(ldom_hdl_t *lhp)
803 if (lhp == NULL)
806 (void) xmpp_remove_client(lhp);
807 ldmsvcs_fini(lhp);
808 lhp->freep(lhp, sizeof (struct ldom_hdl));