Print this page
patch sccs-keywords
patch vm-cleanup

*** 22,34 **** /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - #pragma ident "%Z%%M% %I% %E% SMI" - - #include <sys/types.h> #include <sys/cmn_err.h> #include <sys/mman.h> #include <sys/systm.h> #include <vm/xhat.h> --- 22,31 ----
*** 376,443 **** return (0); } - /* Assumes that address space is already locked */ - void - xhat_swapout_all(struct as *as) - { - struct xhat *xh, *xh_nxt; - - - ASSERT(AS_ISBUSY(as)); - - mutex_enter(&as->a_contents); - xh = (struct xhat *)as->a_xhat; - - if (xh != NULL) { - xhat_hat_hold(xh); - ASSERT(xh->holder == NULL); - xh->holder = curthread; - } - - - while (xh != NULL) { - - xh_nxt = xh->next; - if (xh_nxt != NULL) { - ASSERT(xh_nxt->holder == NULL); - xhat_hat_hold(xh_nxt); - xh_nxt->holder = curthread; - } - - mutex_exit(&as->a_contents); - - XHAT_SWAPOUT(xh); - - mutex_enter(&as->a_contents); - - /* - * If the xh is still there (i.e. swapout did not - * destroy it), clear the holder field. - * xh_nxt->prev couldn't have been changed in xhat_attach_xhat() - * because AS_BUSY is set. xhat_detach_xhat() also couldn't - * have modified it because (holder != NULL). - * If there is only one XHAT, just see if a_xhat still - * points to us. - */ - if (((xh_nxt != NULL) && (xh_nxt->prev == xh)) || - ((as->a_xhat != NULL) && (as->a_xhat == xh))) { - xhat_hat_rele(xh); - xh->holder = NULL; - } - - xh = xh_nxt; - } - - mutex_exit(&as->a_contents); - } - - - - /* * In the following routines, the appropriate xhat_op * should never attempt to call xhat_detach_xhat(): it will * never succeed since the XHAT is held. */ --- 373,382 ----