Print this page
patch sccs-keywords
patch vm-cleanup

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/vm/xhat.c
          +++ new/usr/src/uts/common/vm/xhat.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29      -
  30   27  #include <sys/types.h>
  31   28  #include <sys/cmn_err.h>
  32   29  #include <sys/mman.h>
  33   30  #include <sys/systm.h>
  34   31  #include <vm/xhat.h>
  35   32  #include <vm/page.h>
  36   33  #include <vm/as.h>
  37   34  
  38   35  int xhat_debug = 0;
  39   36  
↓ open down ↓ 331 lines elided ↑ open up ↑
 371  368      uint_t flag)
 372  369  {
 373  370          /* This is not supported. Should we return some sort of error? */
 374  371  
 375  372          ASSERT(AS_ISBUSY(as));
 376  373  
 377  374          return (0);
 378  375  }
 379  376  
 380  377  
 381      -/* Assumes that address space is already locked */
 382      -void
 383      -xhat_swapout_all(struct as *as)
 384      -{
 385      -        struct xhat *xh, *xh_nxt;
 386      -
 387      -
 388      -        ASSERT(AS_ISBUSY(as));
 389      -
 390      -        mutex_enter(&as->a_contents);
 391      -        xh = (struct xhat *)as->a_xhat;
 392      -
 393      -        if (xh != NULL) {
 394      -                xhat_hat_hold(xh);
 395      -                ASSERT(xh->holder == NULL);
 396      -                xh->holder = curthread;
 397      -        }
 398      -
 399      -
 400      -        while (xh != NULL) {
 401      -
 402      -                xh_nxt = xh->next;
 403      -                if (xh_nxt != NULL) {
 404      -                        ASSERT(xh_nxt->holder == NULL);
 405      -                        xhat_hat_hold(xh_nxt);
 406      -                        xh_nxt->holder = curthread;
 407      -                }
 408      -
 409      -                mutex_exit(&as->a_contents);
 410      -
 411      -                XHAT_SWAPOUT(xh);
 412      -
 413      -                mutex_enter(&as->a_contents);
 414      -
 415      -                /*
 416      -                 * If the xh is still there (i.e. swapout did not
 417      -                 * destroy it), clear the holder field.
 418      -                 * xh_nxt->prev couldn't have been changed in xhat_attach_xhat()
 419      -                 * because AS_BUSY is set. xhat_detach_xhat() also couldn't
 420      -                 * have modified it because (holder != NULL).
 421      -                 * If there is only one XHAT, just see if a_xhat still
 422      -                 * points to us.
 423      -                 */
 424      -                if (((xh_nxt != NULL) && (xh_nxt->prev == xh)) ||
 425      -                    ((as->a_xhat != NULL) && (as->a_xhat == xh))) {
 426      -                        xhat_hat_rele(xh);
 427      -                        xh->holder = NULL;
 428      -                }
 429      -
 430      -                xh = xh_nxt;
 431      -        }
 432      -
 433      -        mutex_exit(&as->a_contents);
 434      -}
 435      -
 436      -
 437      -
 438      -
 439  378  /*
 440  379   * In the following routines, the appropriate xhat_op
 441  380   * should never attempt to call xhat_detach_xhat(): it will
 442  381   * never succeed since the XHAT is held.
 443  382   */
 444  383  
 445  384  
 446  385  #define XHAT_UNLOAD_CALLBACK_OP (0)
 447  386  #define XHAT_SETATTR_OP         (1)
 448  387  #define XHAT_CLRATTR_OP         (2)
↓ open down ↓ 107 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX