729
730 /*
731 * This is all terribly broken, but it is a start
732 *
733 * XXX Note that this test means that segdev_ops
734 * must be exported from seg_dev.c.
735 * XXX What about devices with their own segment drivers?
736 */
737 if (seg->s_ops == &segdev_ops) {
738 register struct segdev_data *sdp =
739 (struct segdev_data *)seg->s_data;
740
741 if (hat == NULL) {
742 /*
743 * This is one plausible interpretation of
744 * a null hat i.e. use the first hat on the
745 * address space hat list which by convention is
746 * the hat of the system MMU. At alternative
747 * would be to panic .. this might well be better ..
748 */
749 ASSERT(AS_READ_HELD(seg->s_as, &seg->s_as->a_lock));
750 hat = seg->s_as->a_hat;
751 cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
752 }
753 hat_devload(hat, addr, MMU_PAGESIZE, pfn, prot | sdp->hat_attr,
754 (lock ? HAT_LOAD_LOCK : HAT_LOAD));
755 } else if (seg == &kvseg && dp == (struct devpage *)0) {
756 hat_devload(kas.a_hat, addr, MMU_PAGESIZE, pfn, prot,
757 HAT_LOAD_LOCK);
758 } else
759 return (DDI_FAILURE);
760 return (DDI_SUCCESS);
761 }
762
763 /*
764 * Name a child of rootnex
765 *
766 * This may be called multiple times, independent of initchild calls.
767 */
768 int
769 rootnex_name_child(dev_info_t *child, char *name, int namelen)
|
729
730 /*
731 * This is all terribly broken, but it is a start
732 *
733 * XXX Note that this test means that segdev_ops
734 * must be exported from seg_dev.c.
735 * XXX What about devices with their own segment drivers?
736 */
737 if (seg->s_ops == &segdev_ops) {
738 register struct segdev_data *sdp =
739 (struct segdev_data *)seg->s_data;
740
741 if (hat == NULL) {
742 /*
743 * This is one plausible interpretation of
744 * a null hat i.e. use the first hat on the
745 * address space hat list which by convention is
746 * the hat of the system MMU. At alternative
747 * would be to panic .. this might well be better ..
748 */
749 ASSERT(AS_READ_HELD(seg->s_as));
750 hat = seg->s_as->a_hat;
751 cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
752 }
753 hat_devload(hat, addr, MMU_PAGESIZE, pfn, prot | sdp->hat_attr,
754 (lock ? HAT_LOAD_LOCK : HAT_LOAD));
755 } else if (seg == &kvseg && dp == (struct devpage *)0) {
756 hat_devload(kas.a_hat, addr, MMU_PAGESIZE, pfn, prot,
757 HAT_LOAD_LOCK);
758 } else
759 return (DDI_FAILURE);
760 return (DDI_SUCCESS);
761 }
762
763 /*
764 * Name a child of rootnex
765 *
766 * This may be called multiple times, independent of initchild calls.
767 */
768 int
769 rootnex_name_child(dev_info_t *child, char *name, int namelen)
|