990 #endif /* DDI_MAP_DEBUG */
991
992 /*
993 * This is all terribly broken, but it is a start
994 *
995 * XXX Note that this test means that segdev_ops
996 * must be exported from seg_dev.c.
997 * XXX What about devices with their own segment drivers?
998 */
999 if (seg->s_ops == &segdev_ops) {
1000 struct segdev_data *sdp = (struct segdev_data *)seg->s_data;
1001
1002 if (hat == NULL) {
1003 /*
1004 * This is one plausible interpretation of
1005 * a null hat i.e. use the first hat on the
1006 * address space hat list which by convention is
1007 * the hat of the system MMU. At alternative
1008 * would be to panic .. this might well be better ..
1009 */
1010 ASSERT(AS_READ_HELD(seg->s_as, &seg->s_as->a_lock));
1011 hat = seg->s_as->a_hat;
1012 cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
1013 }
1014 hat_devload(hat, addr, MMU_PAGESIZE, pfn, prot | sdp->hat_attr,
1015 (lock ? HAT_LOAD_LOCK : HAT_LOAD));
1016 } else if (seg == &kvseg && dp == NULL) {
1017 hat_devload(kas.a_hat, addr, MMU_PAGESIZE, pfn, prot,
1018 HAT_LOAD_LOCK);
1019 } else
1020 return (DDI_FAILURE);
1021 return (DDI_SUCCESS);
1022 }
1023
1024
1025 /*
1026 * rootnex_map_regspec()
1027 * we don't support mapping of I/O cards above 4Gb
1028 */
1029 static int
1030 rootnex_map_regspec(ddi_map_req_t *mp, caddr_t *vaddrp)
|
990 #endif /* DDI_MAP_DEBUG */
991
992 /*
993 * This is all terribly broken, but it is a start
994 *
995 * XXX Note that this test means that segdev_ops
996 * must be exported from seg_dev.c.
997 * XXX What about devices with their own segment drivers?
998 */
999 if (seg->s_ops == &segdev_ops) {
1000 struct segdev_data *sdp = (struct segdev_data *)seg->s_data;
1001
1002 if (hat == NULL) {
1003 /*
1004 * This is one plausible interpretation of
1005 * a null hat i.e. use the first hat on the
1006 * address space hat list which by convention is
1007 * the hat of the system MMU. At alternative
1008 * would be to panic .. this might well be better ..
1009 */
1010 ASSERT(AS_READ_HELD(seg->s_as));
1011 hat = seg->s_as->a_hat;
1012 cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
1013 }
1014 hat_devload(hat, addr, MMU_PAGESIZE, pfn, prot | sdp->hat_attr,
1015 (lock ? HAT_LOAD_LOCK : HAT_LOAD));
1016 } else if (seg == &kvseg && dp == NULL) {
1017 hat_devload(kas.a_hat, addr, MMU_PAGESIZE, pfn, prot,
1018 HAT_LOAD_LOCK);
1019 } else
1020 return (DDI_FAILURE);
1021 return (DDI_SUCCESS);
1022 }
1023
1024
1025 /*
1026 * rootnex_map_regspec()
1027 * we don't support mapping of I/O cards above 4Gb
1028 */
1029 static int
1030 rootnex_map_regspec(ddi_map_req_t *mp, caddr_t *vaddrp)
|