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/uvm/uvm_extern.h

Version: -  FREEBSD  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  cheribsd  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1  -  FREEBSD-LIBC  -  FREEBSD8-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  3  -  10 

    1 /*      $OpenBSD: uvm_extern.h,v 1.72 2008/11/04 21:37:06 deraadt Exp $ */
    2 /*      $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $      */
    3 
    4 /*
    5  *
    6  * Copyright (c) 1997 Charles D. Cranor and Washington University.
    7  * All rights reserved.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  * 3. All advertising materials mentioning features or use of this software
   18  *    must display the following acknowledgement:
   19  *      This product includes software developed by Charles D. Cranor and
   20  *      Washington University.
   21  * 4. The name of the author may not be used to endorse or promote products
   22  *    derived from this software without specific prior written permission.
   23  *
   24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   26  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   27  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   29  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   33  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   34  *
   35  * from: Id: uvm_extern.h,v 1.1.2.21 1998/02/07 01:16:53 chs Exp
   36  */
   37 
   38 /*-
   39  * Copyright (c) 1991, 1992, 1993
   40  *      The Regents of the University of California.  All rights reserved.
   41  *
   42  * Redistribution and use in source and binary forms, with or without
   43  * modification, are permitted provided that the following conditions
   44  * are met:
   45  * 1. Redistributions of source code must retain the above copyright
   46  *    notice, this list of conditions and the following disclaimer.
   47  * 2. Redistributions in binary form must reproduce the above copyright
   48  *    notice, this list of conditions and the following disclaimer in the
   49  *    documentation and/or other materials provided with the distribution.
   50  * 3. Neither the name of the University nor the names of its contributors
   51  *    may be used to endorse or promote products derived from this software
   52  *    without specific prior written permission.
   53  *
   54  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   55  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   56  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   57  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   58  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   59  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   60  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   61  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   62  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   63  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   64  * SUCH DAMAGE.
   65  *
   66  *      @(#)vm_extern.h 8.5 (Berkeley) 5/3/95
   67  */
   68 
   69 #ifndef _UVM_UVM_EXTERN_H_
   70 #define _UVM_UVM_EXTERN_H_
   71 
   72 /*
   73  * uvm_extern.h: this file defines the external interface to the VM system.
   74  *
   75  * this should be the only file included by non-VM parts of the kernel
   76  * which need access to VM services.   if you want to know the interface
   77  * to the MI VM layer without knowing the details, this is the file to
   78  * learn.
   79  *
   80  * NOTE: vm system calls are prototyped in syscallargs.h
   81  */
   82 
   83 /*
   84  * typedefs, necessary for standard UVM headers.
   85  */
   86 
   87 typedef unsigned int  uvm_flag_t;
   88 typedef int vm_fault_t;
   89 
   90 typedef int vm_inherit_t;       /* XXX: inheritance codes */
   91 typedef off_t voff_t;           /* XXX: offset within a uvm_object */
   92 
   93 union vm_map_object;
   94 typedef union vm_map_object vm_map_object_t;
   95 
   96 struct vm_map_entry;
   97 typedef struct vm_map_entry *vm_map_entry_t;
   98 
   99 struct vm_map;
  100 typedef struct vm_map *vm_map_t;
  101 
  102 struct vm_page;
  103 typedef struct vm_page  *vm_page_t;
  104 
  105 /*
  106  * defines
  107  */
  108 
  109 /*
  110  * the following defines are for uvm_map and functions which call it.
  111  */
  112 
  113 /* protections bits */
  114 #define UVM_PROT_MASK   0x07    /* protection mask */
  115 #define UVM_PROT_NONE   0x00    /* protection none */
  116 #define UVM_PROT_ALL    0x07    /* everything */
  117 #define UVM_PROT_READ   0x01    /* read */
  118 #define UVM_PROT_WRITE  0x02    /* write */
  119 #define UVM_PROT_EXEC   0x04    /* exec */
  120 
  121 /* protection short codes */
  122 #define UVM_PROT_R      0x01    /* read */
  123 #define UVM_PROT_W      0x02    /* write */
  124 #define UVM_PROT_RW     0x03    /* read-write */
  125 #define UVM_PROT_X      0x04    /* exec */
  126 #define UVM_PROT_RX     0x05    /* read-exec */
  127 #define UVM_PROT_WX     0x06    /* write-exec */
  128 #define UVM_PROT_RWX    0x07    /* read-write-exec */
  129 
  130 /* 0x08: not used */
  131 
  132 /* inherit codes */
  133 #define UVM_INH_MASK    0x30    /* inherit mask */
  134 #define UVM_INH_SHARE   0x00    /* "share" */
  135 #define UVM_INH_COPY    0x10    /* "copy" */
  136 #define UVM_INH_NONE    0x20    /* "none" */
  137 #define UVM_INH_DONATE  0x30    /* "donate" << not used */
  138 
  139 /* 0x40, 0x80: not used */
  140 
  141 /* bits 0x700: max protection, 0x800: not used */
  142 
  143 /* bits 0x7000: advice, 0x8000: not used */
  144 
  145 typedef int             vm_prot_t;
  146 
  147 /*
  148  *      Protection values, defined as bits within the vm_prot_t type
  149  *
  150  *   These are funky definitions from old CMU VM and are kept
  151  *   for compatibility reasons, one day they are going to die,
  152  *   just like everybody else.
  153  */
  154 
  155 #define VM_PROT_NONE    ((vm_prot_t) 0x00)
  156 
  157 #define VM_PROT_READ    ((vm_prot_t) 0x01)      /* read permission */
  158 #define VM_PROT_WRITE   ((vm_prot_t) 0x02)      /* write permission */
  159 #define VM_PROT_EXECUTE ((vm_prot_t) 0x04)      /* execute permission */
  160 
  161 /*
  162  *      The default protection for newly-created virtual memory
  163  */
  164 
  165 #define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
  166 
  167 /*
  168  *      The maximum privileges possible, for parameter checking.
  169  */
  170 
  171 #define VM_PROT_ALL     (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
  172 
  173 /* advice: matches MADV_* from sys/mman.h */
  174 #define UVM_ADV_NORMAL  0x0     /* 'normal' */
  175 #define UVM_ADV_RANDOM  0x1     /* 'random' */
  176 #define UVM_ADV_SEQUENTIAL 0x2  /* 'sequential' */
  177 /* 0x3: will need, 0x4: dontneed */
  178 #define UVM_ADV_MASK    0x7     /* mask */
  179 
  180 /* mapping flags */
  181 #define UVM_FLAG_FIXED   0x010000 /* find space */
  182 #define UVM_FLAG_OVERLAY 0x020000 /* establish overlay */
  183 #define UVM_FLAG_NOMERGE 0x040000 /* don't merge map entries */
  184 #define UVM_FLAG_COPYONW 0x080000 /* set copy_on_write flag */
  185 #define UVM_FLAG_AMAPPAD 0x100000 /* for bss: pad amap to reduce malloc() */
  186 #define UVM_FLAG_TRYLOCK 0x200000 /* fail if we can not lock map */
  187 #define UVM_FLAG_HOLE    0x400000 /* no backend */
  188 
  189 /* macros to extract info */
  190 #define UVM_PROTECTION(X)       ((X) & UVM_PROT_MASK)
  191 #define UVM_INHERIT(X)          (((X) & UVM_INH_MASK) >> 4)
  192 #define UVM_MAXPROTECTION(X)    (((X) >> 8) & UVM_PROT_MASK)
  193 #define UVM_ADVICE(X)           (((X) >> 12) & UVM_ADV_MASK)
  194 
  195 #define UVM_MAPFLAG(PROT,MAXPROT,INH,ADVICE,FLAGS) \
  196         ((MAXPROT << 8)|(PROT)|(INH)|((ADVICE) << 12)|(FLAGS))
  197 
  198 /* magic offset value */
  199 #define UVM_UNKNOWN_OFFSET ((voff_t) -1)
  200                                 /* offset not known(obj) or don't care(!obj) */
  201 
  202 /*
  203  * the following defines are for uvm_km_kmemalloc's flags
  204  */
  205 #define UVM_KMF_NOWAIT  0x1                     /* matches M_NOWAIT */
  206 #define UVM_KMF_VALLOC  0x2                     /* allocate VA only */
  207 #define UVM_KMF_CANFAIL 0x4                     /* caller handles failure */
  208 #define UVM_KMF_TRYLOCK UVM_FLAG_TRYLOCK        /* try locking only */
  209 
  210 /*
  211  * the following defines the strategies for uvm_pagealloc_strat()
  212  */
  213 #define UVM_PGA_STRAT_NORMAL    0       /* high -> low free list walk */
  214 #define UVM_PGA_STRAT_ONLY      1       /* only specified free list */
  215 #define UVM_PGA_STRAT_FALLBACK  2       /* ONLY falls back on NORMAL */
  216 
  217 /*
  218  * flags for uvm_pagealloc_strat()
  219  */
  220 #define UVM_PGA_USERESERVE      0x0001  /* ok to use reserve pages */
  221 #define UVM_PGA_ZERO            0x0002  /* returned page must be zeroed */
  222 
  223 /*
  224  * lockflags that control the locking behavior of various functions.
  225  */
  226 #define UVM_LK_ENTER    0x00000001      /* map locked on entry */
  227 #define UVM_LK_EXIT     0x00000002      /* leave map locked on exit */
  228 
  229 /*
  230  * structures
  231  */
  232 
  233 struct buf;
  234 struct core;
  235 struct mount;
  236 struct pglist;
  237 struct proc;
  238 struct ucred;
  239 struct uio;
  240 struct uvm_object;
  241 struct vm_anon;
  242 struct vm_aref;
  243 struct vm_map;
  244 struct vmspace;
  245 struct pmap;
  246 struct vnode;
  247 struct pool;
  248 struct simplelock;
  249 
  250 extern struct pool *uvm_aiobuf_pool;
  251 
  252 /*
  253  * uvmexp: global data structures that are exported to parts of the kernel
  254  * other than the vm system.
  255  */
  256 
  257 struct uvmexp {
  258         /* vm_page constants */
  259         int pagesize;   /* size of a page (PAGE_SIZE): must be power of 2 */
  260         int pagemask;   /* page mask */
  261         int pageshift;  /* page shift */
  262 
  263         /* vm_page counters */
  264         int npages;     /* number of pages we manage */
  265         int free;       /* number of free pages */
  266         int active;     /* number of active pages */
  267         int inactive;   /* number of pages that we free'd but may want back */
  268         int paging;     /* number of pages in the process of being paged out */
  269         int wired;      /* number of wired pages */
  270 
  271         int zeropages;          /* number of zero'd pages */
  272         int reserve_pagedaemon; /* number of pages reserved for pagedaemon */
  273         int reserve_kernel;     /* number of pages reserved for kernel */
  274         int anonpages;          /* number of pages used by anon pagers */
  275         int vnodepages;         /* number of pages used by vnode page cache */
  276         int vtextpages;         /* number of pages used by vtext vnodes */
  277 
  278         /* pageout params */
  279         int freemin;    /* min number of free pages */
  280         int freetarg;   /* target number of free pages */
  281         int inactarg;   /* target number of inactive pages */
  282         int wiredmax;   /* max number of wired pages */
  283         int anonmin;    /* min threshold for anon pages */
  284         int vtextmin;   /* min threshold for vtext pages */
  285         int vnodemin;   /* min threshold for vnode pages */
  286         int anonminpct; /* min percent anon pages */
  287         int vtextminpct;/* min percent vtext pages */
  288         int vnodeminpct;/* min percent vnode pages */
  289 
  290         /* swap */
  291         int nswapdev;   /* number of configured swap devices in system */
  292         int swpages;    /* number of PAGE_SIZE'ed swap pages */
  293         int swpginuse;  /* number of swap pages in use */
  294         int swpgonly;   /* number of swap pages in use, not also in RAM */
  295         int nswget;     /* number of times fault calls uvm_swap_get() */
  296         int nanon;      /* number total of anon's in system */
  297         int nanonneeded;/* number of anons currently needed */
  298         int nfreeanon;  /* number of free anon's */
  299 
  300         /* stat counters */
  301         int faults;             /* page fault count */
  302         int traps;              /* trap count */
  303         int intrs;              /* interrupt count */
  304         int swtch;              /* context switch count */
  305         int softs;              /* software interrupt count */
  306         int syscalls;           /* system calls */
  307         int pageins;            /* pagein operation count */
  308                                 /* pageouts are in pdpageouts below */
  309         int swapins;            /* swapins */
  310         int swapouts;           /* swapouts */
  311         int pgswapin;           /* pages swapped in */
  312         int pgswapout;          /* pages swapped out */
  313         int forks;              /* forks */
  314         int forks_ppwait;       /* forks where parent waits */
  315         int forks_sharevm;      /* forks where vmspace is shared */
  316         int pga_zerohit;        /* pagealloc where zero wanted and zero
  317                                    was available */
  318         int pga_zeromiss;       /* pagealloc where zero wanted and zero
  319                                    not available */
  320         int zeroaborts;         /* number of times page zeroing was
  321                                    aborted */
  322 
  323         /* fault subcounters */
  324         int fltnoram;   /* number of times fault was out of ram */
  325         int fltnoanon;  /* number of times fault was out of anons */
  326         int fltpgwait;  /* number of times fault had to wait on a page */
  327         int fltpgrele;  /* number of times fault found a released page */
  328         int fltrelck;   /* number of times fault relock called */
  329         int fltrelckok; /* number of times fault relock is a success */
  330         int fltanget;   /* number of times fault gets anon page */
  331         int fltanretry; /* number of times fault retrys an anon get */
  332         int fltamcopy;  /* number of times fault clears "needs copy" */
  333         int fltnamap;   /* number of times fault maps a neighbor anon page */
  334         int fltnomap;   /* number of times fault maps a neighbor obj page */
  335         int fltlget;    /* number of times fault does a locked pgo_get */
  336         int fltget;     /* number of times fault does an unlocked get */
  337         int flt_anon;   /* number of times fault anon (case 1a) */
  338         int flt_acow;   /* number of times fault anon cow (case 1b) */
  339         int flt_obj;    /* number of times fault is on object page (2a) */
  340         int flt_prcopy; /* number of times fault promotes with copy (2b) */
  341         int flt_przero; /* number of times fault promotes with zerofill (2b) */
  342 
  343         /* daemon counters */
  344         int pdwoke;     /* number of times daemon woke up */
  345         int pdrevs;     /* number of times daemon rev'd clock hand */
  346         int pdswout;    /* number of times daemon called for swapout */
  347         int pdfreed;    /* number of pages daemon freed since boot */
  348         int pdscans;    /* number of pages daemon scanned since boot */
  349         int pdanscan;   /* number of anonymous pages scanned by daemon */
  350         int pdobscan;   /* number of object pages scanned by daemon */
  351         int pdreact;    /* number of pages daemon reactivated since boot */
  352         int pdbusy;     /* number of times daemon found a busy page */
  353         int pdpageouts; /* number of times daemon started a pageout */
  354         int pdpending;  /* number of times daemon got a pending pagout */
  355         int pddeact;    /* number of pages daemon deactivates */
  356         int pdreanon;   /* anon pages reactivated due to min threshold */
  357         int pdrevnode;  /* vnode pages reactivated due to min threshold */
  358         int pdrevtext;  /* vtext pages reactivated due to min threshold */
  359 
  360         int fpswtch;    /* FPU context switches */
  361         int kmapent;    /* number of kernel map entries */
  362 };
  363 
  364 #ifdef _KERNEL
  365 extern struct uvmexp uvmexp;
  366 #endif
  367 
  368 /*
  369  * Finally, bring in standard UVM headers.
  370  */
  371 #include <sys/vmmeter.h>
  372 #include <sys/queue.h>
  373 #include <sys/tree.h>
  374 #include <uvm/uvm_param.h>
  375 #include <sys/lock.h>
  376 #include <sys/mutex.h>
  377 #include <uvm/uvm_page.h>
  378 #include <uvm/uvm_pmap.h>
  379 #include <uvm/uvm_map.h>
  380 #include <uvm/uvm_fault.h>
  381 #include <uvm/uvm_pager.h>
  382 
  383 /*
  384  * Shareable process virtual address space.
  385  * May eventually be merged with vm_map.
  386  * Several fields are temporary (text, data stuff).
  387  */
  388 struct vmspace {
  389         struct  vm_map vm_map;  /* VM address map */
  390         int     vm_refcnt;      /* number of references */
  391         caddr_t vm_shm;         /* SYS5 shared memory private data XXX */
  392 /* we copy from vm_startcopy to the end of the structure on fork */
  393 #define vm_startcopy vm_rssize
  394         segsz_t vm_rssize;      /* current resident set size in pages */
  395         segsz_t vm_swrss;       /* resident set size before last swap */
  396         segsz_t vm_tsize;       /* text size (pages) XXX */
  397         segsz_t vm_dsize;       /* data size (pages) XXX */
  398         segsz_t vm_dused;       /* data segment length (pages) XXX */
  399         segsz_t vm_ssize;       /* stack size (pages) */
  400         caddr_t vm_taddr;       /* user virtual address of text XXX */
  401         caddr_t vm_daddr;       /* user virtual address of data XXX */
  402         caddr_t vm_maxsaddr;    /* user VA at max stack growth */
  403         caddr_t vm_minsaddr;    /* user VA at top of stack */
  404 };
  405 
  406 #ifdef _KERNEL
  407 
  408 /*
  409  * the various kernel maps, owned by MD code
  410  */
  411 extern struct vm_map *exec_map;
  412 extern struct vm_map *kernel_map;
  413 extern struct vm_map *kmem_map;
  414 extern struct vm_map *phys_map;
  415 
  416 
  417 /*
  418  * macros
  419  */
  420 
  421 /* zalloc zeros memory, alloc does not */
  422 #define uvm_km_zalloc(MAP,SIZE) uvm_km_alloc1(MAP,SIZE,0,TRUE)
  423 #define uvm_km_alloc(MAP,SIZE)  uvm_km_alloc1(MAP,SIZE,0,FALSE)
  424 
  425 #endif /* _KERNEL */
  426 
  427 #ifdef  pmap_resident_count
  428 #define vm_resident_count(vm) (pmap_resident_count((vm)->vm_map.pmap))
  429 #else
  430 #define vm_resident_count(vm) ((vm)->vm_rssize)
  431 #endif
  432 
  433 /* XXX clean up later */
  434 struct buf;
  435 struct loadavg;
  436 struct proc;
  437 struct pmap;
  438 struct vmspace;
  439 struct vmtotal;
  440 struct mount;
  441 struct vnode;
  442 struct core;
  443 
  444 #ifdef _KERNEL
  445 
  446 /* vm_machdep.c */
  447 void            vmapbuf(struct buf *, vsize_t);
  448 void            vunmapbuf(struct buf *, vsize_t);
  449 void            cpu_fork(struct proc *, struct proc *, void *, size_t,
  450                     void (*)(void *), void *);
  451 
  452 /* uvm_aobj.c */
  453 struct uvm_object       *uao_create(vsize_t, int);
  454 void                    uao_detach(struct uvm_object *);
  455 void                    uao_detach_locked(struct uvm_object *);
  456 void                    uao_reference(struct uvm_object *);
  457 void                    uao_reference_locked(struct uvm_object *);
  458 
  459 /* uvm_fault.c */
  460 int                     uvm_fault(vm_map_t, vaddr_t, 
  461                                 vm_fault_t, vm_prot_t);
  462                                 /* handle a page fault */
  463 
  464 /* uvm_glue.c */
  465 #if defined(KGDB)
  466 void                    uvm_chgkprot(caddr_t, size_t, int);
  467 #endif
  468 void                    uvm_fork(struct proc *, struct proc *, boolean_t,
  469                             void *, size_t, void (*)(void *), void *);
  470 void                    uvm_exit(struct proc *);
  471 void                    uvm_init_limits(struct proc *);
  472 boolean_t               uvm_kernacc(caddr_t, size_t, int);
  473 __dead void             uvm_scheduler(void);
  474 
  475 int                     uvm_vslock(struct proc *, caddr_t, size_t,
  476                             vm_prot_t);
  477 void                    uvm_vsunlock(struct proc *, caddr_t, size_t);
  478 
  479 
  480 /* uvm_init.c */
  481 void                    uvm_init(void); 
  482                                 /* init the uvm system */
  483 
  484 /* uvm_io.c */
  485 int                     uvm_io(vm_map_t, struct uio *, int);
  486 
  487 #define UVM_IO_FIXPROT  0x01
  488 
  489 /* uvm_km.c */
  490 vaddr_t                 uvm_km_alloc1(vm_map_t, vsize_t, vsize_t, boolean_t);
  491 void                    uvm_km_free(vm_map_t, vaddr_t, vsize_t);
  492 void                    uvm_km_free_wakeup(vm_map_t, vaddr_t,
  493                                                 vsize_t);
  494 vaddr_t                 uvm_km_kmemalloc(vm_map_t, struct uvm_object *,
  495                                                 vsize_t, int);
  496 struct vm_map           *uvm_km_suballoc(vm_map_t, vaddr_t *,
  497                                 vaddr_t *, vsize_t, int,
  498                                 boolean_t, vm_map_t);
  499 vaddr_t                 uvm_km_valloc(vm_map_t, vsize_t);
  500 vaddr_t                 uvm_km_valloc_align(vm_map_t, vsize_t, vsize_t);
  501 vaddr_t                 uvm_km_valloc_wait(vm_map_t, vsize_t);
  502 vaddr_t                 uvm_km_valloc_prefer_wait(vm_map_t, vsize_t,
  503                                         voff_t);
  504 vaddr_t                 uvm_km_alloc_poolpage1(vm_map_t,
  505                                 struct uvm_object *, boolean_t);
  506 void                    uvm_km_free_poolpage1(vm_map_t, vaddr_t);
  507 
  508 void                    *uvm_km_getpage(boolean_t, int *);
  509 void                    uvm_km_putpage(void *);
  510 
  511 /* uvm_map.c */
  512 #define uvm_map(_m, _a, _sz, _u, _f, _al, _fl) uvm_map_p(_m, _a, _sz, _u, _f, _al, _fl, 0)
  513 int                     uvm_map_p(vm_map_t, vaddr_t *, vsize_t,
  514                                 struct uvm_object *, voff_t, vsize_t,
  515                                 uvm_flag_t, struct proc *);
  516 int                     uvm_map_pageable(vm_map_t, vaddr_t, 
  517                                 vaddr_t, boolean_t, int);
  518 int                     uvm_map_pageable_all(vm_map_t, int, vsize_t);
  519 boolean_t               uvm_map_checkprot(vm_map_t, vaddr_t,
  520                                 vaddr_t, vm_prot_t);
  521 int                     uvm_map_protect(vm_map_t, vaddr_t, 
  522                                 vaddr_t, vm_prot_t, boolean_t);
  523 struct vmspace          *uvmspace_alloc(vaddr_t, vaddr_t,
  524                                 boolean_t, boolean_t);
  525 void                    uvmspace_init(struct vmspace *, struct pmap *,
  526                                 vaddr_t, vaddr_t, boolean_t, boolean_t);
  527 void                    uvmspace_exec(struct proc *, vaddr_t, vaddr_t);
  528 struct vmspace          *uvmspace_fork(struct vmspace *);
  529 void                    uvmspace_free(struct vmspace *);
  530 void                    uvmspace_share(struct proc *, struct proc *);
  531 
  532 
  533 /* uvm_meter.c */
  534 void                    uvm_meter(void);
  535 int                     uvm_sysctl(int *, u_int, void *, size_t *, 
  536                                 void *, size_t, struct proc *);
  537 void                    uvm_total(struct vmtotal *);
  538 
  539 /* uvm_mmap.c */
  540 int                     uvm_mmap(vm_map_t, vaddr_t *, vsize_t,
  541                                 vm_prot_t, vm_prot_t, int, 
  542                                 caddr_t, voff_t, vsize_t, struct proc *);
  543 
  544 /* uvm_page.c */
  545 struct vm_page          *uvm_pagealloc_strat(struct uvm_object *,
  546                                 voff_t, struct vm_anon *, int, int, int);
  547 #define uvm_pagealloc(obj, off, anon, flags) \
  548             uvm_pagealloc_strat((obj), (off), (anon), (flags), \
  549                                 UVM_PGA_STRAT_NORMAL, 0)
  550 vaddr_t                 uvm_pagealloc_contig(vaddr_t, vaddr_t,
  551                                 vaddr_t, vaddr_t);
  552 void                    uvm_pagerealloc(struct vm_page *, 
  553                                              struct uvm_object *, voff_t);
  554 /* Actually, uvm_page_physload takes PF#s which need their own type */
  555 void                    uvm_page_physload(paddr_t, paddr_t,
  556                                                paddr_t, paddr_t, int);
  557 void                    uvm_setpagesize(void);
  558 void                    uvm_shutdown(void);
  559 
  560 /* uvm_pager.c */
  561 void                    uvm_aio_biodone1(struct buf *);
  562 void                    uvm_aio_biodone(struct buf *);
  563 void                    uvm_aio_aiodone(struct buf *);
  564 
  565 /* uvm_pdaemon.c */
  566 void                    uvm_pageout(void *);
  567 void                    uvm_aiodone_daemon(void *);
  568 
  569 /* uvm_pglist.c */
  570 int                     uvm_pglistalloc(psize_t, paddr_t,
  571                                 paddr_t, paddr_t, paddr_t,
  572                                 struct pglist *, int, int); 
  573 void                    uvm_pglistfree(struct pglist *);
  574 
  575 /* uvm_swap.c */
  576 void                    uvm_swap_init(void);
  577 
  578 /* uvm_unix.c */
  579 int                     uvm_coredump(struct proc *, struct vnode *, 
  580                                 struct ucred *, struct core *);
  581 void                    uvm_grow(struct proc *, vaddr_t);
  582 
  583 /* uvm_user.c */
  584 void                    uvm_deallocate(vm_map_t, vaddr_t, vsize_t);
  585 
  586 /* uvm_vnode.c */
  587 void                    uvm_vnp_setsize(struct vnode *, voff_t);
  588 void                    uvm_vnp_sync(struct mount *);
  589 void                    uvm_vnp_terminate(struct vnode *);
  590                                 /* terminate a uvm/uvn object */
  591 boolean_t               uvm_vnp_uncache(struct vnode *);
  592 struct uvm_object       *uvn_attach(void *, vm_prot_t);
  593 
  594 /* kern_malloc.c */
  595 void                    kmeminit_nkmempages(void);
  596 void                    kmeminit(void);
  597 extern u_int            nkmempages;
  598 
  599 #endif /* _KERNEL */
  600 
  601 #endif /* _UVM_UVM_EXTERN_H_ */

Cache object: b07e9a6bde73fdd7e0583730662e55fb


[ 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.