4740
4741 dev_info_t *
4742 ddi_root_node(void)
4743 {
4744 extern dev_info_t *top_devinfo;
4745
4746 return (top_devinfo);
4747 }
4748
4749 /*
4750 * Miscellaneous functions:
4751 */
4752
4753 /*
4754 * Implementation specific hooks
4755 */
4756
4757 void
4758 ddi_report_dev(dev_info_t *d)
4759 {
4760 char *b;
4761
4762 (void) ddi_ctlops(d, d, DDI_CTLOPS_REPORTDEV, (void *)0, (void *)0);
4763
4764 /*
4765 * If this devinfo node has cb_ops, it's implicitly accessible from
4766 * userland, so we print its full name together with the instance
4767 * number 'abbreviation' that the driver may use internally.
4768 */
4769 if (DEVI(d)->devi_ops->devo_cb_ops != (struct cb_ops *)0 &&
4770 (b = kmem_zalloc(MAXPATHLEN, KM_NOSLEEP))) {
4771 cmn_err(CE_CONT, "?%s%d is %s\n",
4772 ddi_driver_name(d), ddi_get_instance(d),
4773 ddi_pathname(d, b));
4774 kmem_free(b, MAXPATHLEN);
4775 }
4776 }
4777
4778 /*
4779 * ddi_ctlops() is described in the assembler not to buy a new register
4780 * window when it's called and can reduce cost in climbing the device tree
4781 * without using the tail call optimization.
4782 */
4783 int
4784 ddi_dev_regsize(dev_info_t *dev, uint_t rnumber, off_t *result)
4785 {
4786 int ret;
4787
4788 ret = ddi_ctlops(dev, dev, DDI_CTLOPS_REGSIZE,
4789 (void *)&rnumber, (void *)result);
4790
4791 return (ret == DDI_SUCCESS ? DDI_SUCCESS : DDI_FAILURE);
4792 }
4793
4794 int
4795 ddi_dev_nregs(dev_info_t *dev, int *result)
|
4740
4741 dev_info_t *
4742 ddi_root_node(void)
4743 {
4744 extern dev_info_t *top_devinfo;
4745
4746 return (top_devinfo);
4747 }
4748
4749 /*
4750 * Miscellaneous functions:
4751 */
4752
4753 /*
4754 * Implementation specific hooks
4755 */
4756
4757 void
4758 ddi_report_dev(dev_info_t *d)
4759 {
4760 (void) ddi_ctlops(d, d, DDI_CTLOPS_REPORTDEV, (void *)0, (void *)0);
4761 }
4762
4763 /*
4764 * ddi_ctlops() is described in the assembler not to buy a new register
4765 * window when it's called and can reduce cost in climbing the device tree
4766 * without using the tail call optimization.
4767 */
4768 int
4769 ddi_dev_regsize(dev_info_t *dev, uint_t rnumber, off_t *result)
4770 {
4771 int ret;
4772
4773 ret = ddi_ctlops(dev, dev, DDI_CTLOPS_REGSIZE,
4774 (void *)&rnumber, (void *)result);
4775
4776 return (ret == DDI_SUCCESS ? DDI_SUCCESS : DDI_FAILURE);
4777 }
4778
4779 int
4780 ddi_dev_nregs(dev_info_t *dev, int *result)
|