Lines Matching refs:s_mp
64 sbd_mem_unit_t *s_mp,
72 static void sbd_mem_cleanup(sbd_mem_unit_t *s_mp,
417 sbd_mem_unit_t *s_mp, *t_mp; in sbd_post_detach_mem() local
454 s_mp = SBD_GET_BOARD_MEMUNIT(sbp, unit); in sbd_post_detach_mem()
456 ASSERT(s_mp->sbm_cm.sbdev_sbp == sbp); in sbd_post_detach_mem()
459 if (s_mp->sbm_flags & SBD_MFLAG_SOURCE) { in sbd_post_detach_mem()
460 t_mp = s_mp->sbm_peer; in sbd_post_detach_mem()
466 sbd_mem_cleanup(s_mp, t_mp, ep); in sbd_post_detach_mem()
467 } else if (sbd_post_detach_mem_unit(s_mp, ep)) in sbd_post_detach_mem()
531 sbd_post_detach_mem_unit(sbd_mem_unit_t *s_mp, sbderror_t *ep) in sbd_post_detach_mem_unit() argument
550 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_post_detach_mem_unit()
554 if (sbdp_get_mem_alignment(hdp, s_mp->sbm_cm.sbdev_dip, &sz)) { in sbd_post_detach_mem_unit()
557 f, sbp->sb_num, s_mp->sbm_cm.sbdev_unum); in sbd_post_detach_mem_unit()
567 SBD_MEMLIST_DUMP(s_mp->sbm_del_mlist); in sbd_post_detach_mem_unit()
570 ASSERT(s_mp->sbm_del_mlist == NULL || in sbd_post_detach_mem_unit()
571 (s_mp->sbm_flags & SBD_MFLAG_RELDONE) != 0); in sbd_post_detach_mem_unit()
573 if (s_mp->sbm_flags & SBD_MFLAG_SOURCE) { in sbd_post_detach_mem_unit()
574 t_mp = s_mp->sbm_peer; in sbd_post_detach_mem_unit()
578 ASSERT(t_mp->sbm_peer == s_mp); in sbd_post_detach_mem_unit()
598 if (s_mp->sbm_flags & SBD_MFLAG_RELDONE) { in sbd_post_detach_mem_unit()
599 x_mp = s_mp; in sbd_post_detach_mem_unit()
623 s_basepa = _ptob64(s_mp->sbm_basepfn); in sbd_post_detach_mem_unit()
624 s_nbytes = _ptob64(s_mp->sbm_npages); in sbd_post_detach_mem_unit()
651 for (ml = s_mp->sbm_mlist; ml; ml = ml->ml_next) { in sbd_post_detach_mem_unit()
657 SBD_MEMLIST_DUMP(s_mp->sbm_mlist); in sbd_post_detach_mem_unit()
660 ASSERT(s_mp->sbm_mlist != s_mp->sbm_del_mlist); in sbd_post_detach_mem_unit()
666 for (ml = s_mp->sbm_del_mlist; ml; ml = ml->ml_next) { in sbd_post_detach_mem_unit()
672 SBD_MEMLIST_DUMP(s_mp->sbm_del_mlist); in sbd_post_detach_mem_unit()
675 if (s_mp->sbm_flags & SBD_MFLAG_MEMUPSIZE) { in sbd_post_detach_mem_unit()
716 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_post_detach_mem_unit()
724 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_post_detach_mem_unit()
736 sbd_mem_cleanup(s_mp, t_mp, ep); in sbd_post_detach_mem_unit()
738 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_post_detach_mem_unit()
740 SBD_MEMLIST_DUMP(s_mp->sbm_mlist); in sbd_post_detach_mem_unit()
747 sbd_mem_cleanup(sbd_mem_unit_t *s_mp, sbd_mem_unit_t *t_mp, sbderror_t *ep) in sbd_mem_cleanup() argument
795 if (s_mp != NULL) { in sbd_mem_cleanup()
796 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_mem_cleanup()
802 s_mp->sbm_del_mlist = NULL; in sbd_mem_cleanup()
803 s_mp->sbm_peer = NULL; in sbd_mem_cleanup()
804 s_mp->sbm_flags = 0; in sbd_mem_cleanup()
805 s_mp->sbm_cm.sbdev_busy = 0; in sbd_mem_cleanup()
806 sbd_init_mem_unit_data(s_mp, ep); in sbd_mem_cleanup()
1072 sbd_mem_unit_t *s_mp, *t_mp, *mp; in sbd_release_mem_done() local
1078 s_mp = SBD_GET_BOARD_MEMUNIT(sbp, unit); in sbd_release_mem_done()
1079 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_release_mem_done()
1085 if (s_mp->sbm_flags & SBD_MFLAG_SOURCE) { in sbd_release_mem_done()
1086 t_mp = s_mp->sbm_peer; in sbd_release_mem_done()
1088 ASSERT(t_mp->sbm_peer == s_mp); in sbd_release_mem_done()
1097 ASSERT(s_mp->sbm_flags & SBD_MFLAG_RELOWNER); in sbd_release_mem_done()
1098 ASSERT(s_mp->sbm_flags & SBD_MFLAG_RESERVED); in sbd_release_mem_done()
1100 rv = kphysm_del_release(s_mp->sbm_memhandle); in sbd_release_mem_done()
1109 s_mp->sbm_flags &= ~SBD_MFLAG_RELOWNER; in sbd_release_mem_done()
1119 s_mp->sbm_cm.sbdev_unum, in sbd_release_mem_done()
1122 sbd_mem_cleanup(s_mp, t_mp, ep); in sbd_release_mem_done()
1158 if (s_mp->sbm_del_mlist != NULL) { in sbd_release_mem_done()
1159 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_release_mem_done()
1160 mp = s_mp; in sbd_release_mem_done()
1182 s_mp->sbm_flags |= SBD_MFLAG_RELDONE; in sbd_release_mem_done()
1188 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_release_mem_done()
1195 s_mp->sbm_cm.sbdev_unum); in sbd_release_mem_done()
1197 s_mp->sbm_cm.sbdev_ostate = SBD_STAT_UNCONFIGURED; in sbd_release_mem_done()
1208 sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_release_mem_done()
1247 sbd_mem_unit_t *s_mp, *t_mp; in sbd_cancel_mem() local
1254 s_mp = SBD_GET_BOARD_MEMUNIT(sbp, unit); in sbd_cancel_mem()
1256 state = s_mp->sbm_cm.sbdev_state; in sbd_cancel_mem()
1258 if (s_mp->sbm_flags & SBD_MFLAG_TARGET) { in sbd_cancel_mem()
1263 } else if (s_mp->sbm_flags & SBD_MFLAG_SOURCE) { in sbd_cancel_mem()
1264 t_mp = s_mp->sbm_peer; in sbd_cancel_mem()
1267 ASSERT(t_mp->sbm_peer == s_mp); in sbd_cancel_mem()
1278 ASSERT((s_mp->sbm_flags & SBD_MFLAG_RELOWNER) == 0); in sbd_cancel_mem()
1288 if (s_mp->sbm_del_mlist != NULL) { in sbd_cancel_mem()
1291 sbd_add_memory_spans(sbp, s_mp->sbm_del_mlist); in sbd_cancel_mem()
1302 ASSERT((s_mp->sbm_flags & SBD_MFLAG_RELOWNER) == 0); in sbd_cancel_mem()
1326 if (s_mp->sbm_del_mlist != s_mp->sbm_mlist) in sbd_cancel_mem()
1327 memlist_delete(s_mp->sbm_del_mlist); in sbd_cancel_mem()
1328 s_mp->sbm_del_mlist = NULL; in sbd_cancel_mem()
1330 if (s_mp->sbm_mlist != NULL) { in sbd_cancel_mem()
1331 memlist_delete(s_mp->sbm_mlist); in sbd_cancel_mem()
1332 s_mp->sbm_mlist = NULL; in sbd_cancel_mem()
1335 s_mp->sbm_peer = NULL; in sbd_cancel_mem()
1336 s_mp->sbm_flags = 0; in sbd_cancel_mem()
1337 s_mp->sbm_cm.sbdev_busy = 0; in sbd_cancel_mem()
1338 sbd_init_mem_unit_data(s_mp, ep); in sbd_cancel_mem()
1347 s_mp->sbm_cm.sbdev_unum); in sbd_cancel_mem()
1534 sbd_check_boundaries(struct memlist *orig_memlist, sbd_mem_unit_t *s_mp, in sbd_check_boundaries() argument
1548 _ptob64(s_mp->sbm_basepfn), in sbd_check_boundaries()
1549 _ptob64(s_mp->sbm_npages), in sbd_check_boundaries()
1567 _ptob64(s_mp->sbm_npages), in sbd_check_boundaries()
1575 _ptob64(s_mp->sbm_basepfn), in sbd_check_boundaries()
1607 sbd_mem_unit_t *s_mp, struct memlist *s_ml) in sbd_select_mem_target() argument
1632 s_sbp = s_mp->sbm_cm.sbdev_sbp; in sbd_select_mem_target()
1636 if (sbdp_get_mem_alignment(hdp, s_mp->sbm_cm.sbdev_dip, &sz)) { in sbd_select_mem_target()
1640 f, s_sbp->sb_num, s_mp->sbm_cm.sbdev_unum); in sbd_select_mem_target()
1681 if (s_mp == t_mp) { in sbd_select_mem_target()
1701 if (t_mp->sbm_npages == s_mp->sbm_npages) { in sbd_select_mem_target()
1704 } else if (t_mp->sbm_npages > s_mp->sbm_npages) { in sbd_select_mem_target()
1765 if (t_mp->sbm_npages < s_mp->sbm_npages) { in sbd_select_mem_target()
1790 _ptob64(s_mp->sbm_basepfn), in sbd_select_mem_target()
1806 excess = (s_mp->sbm_basepfn + s_mp->sbm_npages) in sbd_select_mem_target()
1831 ASSERT(x_ml->ml_address == _ptob64(s_mp->sbm_basepfn) + in sbd_select_mem_target()
1910 if (sbd_check_boundaries(phys_install, s_mp, t_mp) != 0) in sbd_select_mem_target()
1923 if (t_mp->sbm_npages < s_mp->sbm_npages) { in sbd_select_mem_target()
1935 pfn = s_mp->sbm_basepfn & ~sm; in sbd_select_mem_target()
1951 &s_mp->sbm_memhandle, d_ml) != 0) { in sbd_select_mem_target()
1962 s_mp->sbm_flags |= SBD_MFLAG_RESERVED; in sbd_select_mem_target()
1972 if (sbd_reserve_mem_spans(&s_mp->sbm_memhandle, t_ml) == 0) { in sbd_select_mem_target()
1994 s_mp->sbm_flags &= ~SBD_MFLAG_RESERVED; in sbd_select_mem_target()
2022 s_mp->sbm_peer = c_mp; in sbd_select_mem_target()
2023 s_mp->sbm_flags |= SBD_MFLAG_SOURCE; in sbd_select_mem_target()
2024 s_mp->sbm_del_mlist = d_ml; /* spans to be deleted, if any */ in sbd_select_mem_target()
2025 s_mp->sbm_mlist = s_ml; in sbd_select_mem_target()
2026 s_mp->sbm_cm.sbdev_busy = 1; in sbd_select_mem_target()
2028 c_mp->sbm_peer = s_mp; in sbd_select_mem_target()
2034 s_mp->sbm_flags &= ~SBD_MFLAG_MEMRESIZE; in sbd_select_mem_target()
2035 if (c_mp->sbm_npages > s_mp->sbm_npages) { in sbd_select_mem_target()
2036 s_mp->sbm_flags |= SBD_MFLAG_MEMUPSIZE; in sbd_select_mem_target()
2038 f, s_mp->sbm_npages, c_mp->sbm_npages); in sbd_select_mem_target()
2039 } else if (c_mp->sbm_npages < s_mp->sbm_npages) { in sbd_select_mem_target()
2040 s_mp->sbm_flags |= SBD_MFLAG_MEMDOWNSIZE; in sbd_select_mem_target()
2042 f, s_mp->sbm_npages, c_mp->sbm_npages); in sbd_select_mem_target()
2534 sbd_detach_memory(sbd_handle_t *hp, sbderror_t *ep, sbd_mem_unit_t *s_mp, in sbd_detach_memory() argument
2541 sbd_board_t *sbp = (sbd_board_t *)s_mp->sbm_cm.sbdev_sbp; in sbd_detach_memory()
2548 if (s_mp->sbm_flags & SBD_MFLAG_SOURCE) { in sbd_detach_memory()
2549 t_mp = s_mp->sbm_peer; in sbd_detach_memory()
2551 ASSERT(t_mp->sbm_peer == s_mp); in sbd_detach_memory()
2558 state = s_mp->sbm_cm.sbdev_state; in sbd_detach_memory()
2564 s_mp->sbm_cm.sbdev_unum); in sbd_detach_memory()
2604 rv = sbdphw_disable_memctrl(hdp, s_mp->sbm_cm.sbdev_dip); in sbd_detach_memory()
2611 s_mp->sbm_cm.sbdev_unum, in sbd_detach_memory()
2612 (void *)s_mp->sbm_cm.sbdev_dip); in sbd_detach_memory()
2669 sbd_mem_cleanup(s_mp, t_mp, ep); in sbd_detach_memory()
2670 if (s_mp->sbm_mlist) { in sbd_detach_memory()
2671 memlist_delete(s_mp->sbm_mlist); in sbd_detach_memory()
2672 s_mp->sbm_mlist = NULL; in sbd_detach_memory()