The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/vm/vm_external.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * HISTORY
   28  * $Log:        vm_external.h,v $
   29  * Revision 2.5  91/05/14  17:48:31  mrt
   30  *      Correcting copyright
   31  * 
   32  * Revision 2.4  91/02/05  17:57:53  mrt
   33  *      Changed to new Mach copyright
   34  *      [91/02/01  16:31:29  mrt]
   35  * 
   36  * Revision 2.3  90/05/29  18:38:36  rwd
   37  *      Picked up rfr changes.
   38  *      [90/04/12  13:46:56  rwd]
   39  * 
   40  * Revision 2.2  90/01/11  11:47:31  dbg
   41  *      Added changes from mainline:
   42  *              Remember bitmap size, for safer deallocation.
   43  *              [89/10/16  15:32:58  af]
   44  *              Declare vm_external_destroy().
   45  *              [89/08/08            mwyoung]
   46  * 
   47  * Revision 2.1  89/08/03  16:44:46  rwd
   48  * Created.
   49  * 
   50  * Revision 2.3  89/04/18  21:24:53  mwyoung
   51  *      Created.
   52  *      [89/04/18            mwyoung]
   53  * 
   54  */
   55 
   56 #ifndef _VM_VM_EXTERNAL_H_
   57 #define _VM_VM_EXTERNAL_H_
   58 
   59 /*
   60  *      External page management hint technology
   61  *
   62  *      The data structure exported by this module maintains
   63  *      a (potentially incomplete) map of the pages written
   64  *      to external storage for a range of virtual memory.
   65  */
   66 
   67 /*
   68  *      The data structure representing the state of pages
   69  *      on external storage.
   70  */
   71 
   72 typedef struct vm_external {
   73         int             existence_size; /* Size of the following bitmap */
   74         char            *existence_map; /* A bitmap of pages that have
   75                                          * been written to backing
   76                                          * storage.
   77                                          */
   78         int             existence_count;/* Number of bits turned on in
   79                                          * existence_map.
   80                                          */
   81 } *vm_external_t;
   82 
   83 #define VM_EXTERNAL_NULL        ((vm_external_t) 0)
   84 
   85 #define VM_EXTERNAL_SMALL_SIZE  128
   86 #define VM_EXTERNAL_LARGE_SIZE  8192
   87 
   88 /*
   89  *      The states that may be recorded for a page of external storage.
   90  */
   91 
   92 typedef int     vm_external_state_t;
   93 #define VM_EXTERNAL_STATE_EXISTS                1
   94 #define VM_EXTERNAL_STATE_UNKNOWN               2
   95 #define VM_EXTERNAL_STATE_ABSENT                3
   96 
   97 
   98 /*
   99  *      Routines exported by this module.
  100  */
  101 
  102 extern void             vm_external_module_initialize();
  103                                                 /* Initialize the module */
  104 
  105 extern vm_external_t    vm_external_create();   /* Create a vm_external_t */
  106 extern void vm_external_destroy();              /* Destroy one */
  107 
  108 extern void             vm_external_state_set();/* Set state of a page. */
  109 #define vm_external_state_get(e,offset) (((e) != VM_EXTERNAL_NULL) ? \
  110                                           _vm_external_state_get(e, offset) : \
  111                                           VM_EXTERNAL_STATE_UNKNOWN)
  112                                                 /* Retrieve the state
  113                                                  * for a given page, if known.
  114                                                  */
  115 extern vm_external_state_t _vm_external_state_get();
  116                                                 /* HIDDEN routine */
  117 
  118 #endif  _VM_VM_EXTERNAL_H_

Cache object: cf7f1e35835227381de7f9bc6a273a56


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.