Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src more vm header file changes:



details:   https://anonhg.NetBSD.org/src/rev/465030d6c2fa
branches:  trunk
changeset: 493929:465030d6c2fa
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Jun 27 09:00:14 2000 +0000

description:
more vm header file changes:

        <vm/vm_extern.h> merged into <uvm/uvm_extern.h>
        <vm/vm_page.h> merged into <uvm/uvm_page.h>
        <vm/pmap.h> has become <uvm/uvm_pmap.h>

this leaves just <vm/vm.h> in NetBSD.

diffstat:

 distrib/sets/lists/comp/mi          |    5 +-
 distrib/sets/lists/comp/obsolete.mi |    4 +-
 sys/uvm/uvm_extern.h                |   59 ++++-
 sys/uvm/uvm_page.h                  |  354 +++++++++++++++++++++++++++++-
 sys/uvm/uvm_pmap.h                  |  164 ++++++++++++++
 sys/vm/Makefile                     |    4 +-
 sys/vm/pmap.h                       |  164 --------------
 sys/vm/vm.h                         |    6 +-
 sys/vm/vm_extern.h                  |   65 -----
 sys/vm/vm_page.h                    |  420 ------------------------------------
 10 files changed, 579 insertions(+), 666 deletions(-)

diffs (truncated from 1383 to 300 lines):

diff -r 85bb2ea8d03d -r 465030d6c2fa distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Jun 27 08:49:44 2000 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Jun 27 09:00:14 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.239 2000/06/27 07:18:07 mrg Exp $
+#      $NetBSD: mi,v 1.240 2000/06/27 09:00:15 mrg Exp $
 ./sys                  comp-sysutil-root
 ./usr/bin/addr2line    comp-miscutil-bin
 ./usr/bin/ar           comp-util-bin
@@ -1124,6 +1124,7 @@
 ./usr/include/uvm/uvm_param.h          comp-c-include
 ./usr/include/uvm/uvm_pdaemon.h                comp-c-include
 ./usr/include/uvm/uvm_pglist.h         comp-c-include
+./usr/include/uvm/uvm_pmap.h           comp-c-include
 ./usr/include/uvm/uvm_prot.h           comp-c-include
 ./usr/include/uvm/uvm_stat.h           comp-c-include
 ./usr/include/uvm/uvm_swap.h           comp-c-include
@@ -1131,8 +1132,6 @@
 ./usr/include/varargs.h                comp-c-include
 ./usr/include/vis.h            comp-c-include
 ./usr/include/vm/vm.h          comp-c-include
-./usr/include/vm/vm_extern.h           comp-c-include
-./usr/include/vm/vm_page.h             comp-c-include
 ./usr/include/wchar.h          comp-c-include
 ./usr/include/zconf.h          comp-c-include
 ./usr/include/zlib.h           comp-c-include
diff -r 85bb2ea8d03d -r 465030d6c2fa distrib/sets/lists/comp/obsolete.mi
--- a/distrib/sets/lists/comp/obsolete.mi       Tue Jun 27 08:49:44 2000 +0000
+++ b/distrib/sets/lists/comp/obsolete.mi       Tue Jun 27 09:00:14 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: obsolete.mi,v 1.22 2000/06/27 07:18:08 mrg Exp $
+# $NetBSD: obsolete.mi,v 1.23 2000/06/27 09:00:16 mrg Exp $
 /usr/bin/genclass
 /usr/include/bfd/ansidecl.h
 /usr/include/bfd/bfd.h
@@ -301,10 +301,12 @@
 /usr/include/vm/pmap.h
 /usr/include/vm/swap_pager.h
 /usr/include/vm/vm_conf.h
+/usr/include/vm/vm_extern.h
 /usr/include/vm/vm_inherit.h
 /usr/include/vm/vm_kern.h
 /usr/include/vm/vm_map.h
 /usr/include/vm/vm_object.h
+/usr/include/vm/vm_page.h
 /usr/include/vm/vm_pageout.h
 /usr/include/vm/vm_pager.h
 /usr/include/vm/vm_param.h
diff -r 85bb2ea8d03d -r 465030d6c2fa sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Tue Jun 27 08:49:44 2000 +0000
+++ b/sys/uvm/uvm_extern.h      Tue Jun 27 09:00:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.43 2000/06/26 14:21:17 mrg Exp $      */
+/*     $NetBSD: uvm_extern.h,v 1.44 2000/06/27 09:00:14 mrg Exp $      */
 
 /*
  *
@@ -34,6 +34,41 @@
  * from: Id: uvm_extern.h,v 1.1.2.21 1998/02/07 01:16:53 chs Exp
  */
 
+/*-
+ * Copyright (c) 1992, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)vm_extern.h 8.5 (Berkeley) 5/3/95
+ */
+
 #ifndef _UVM_UVM_EXTERN_H_
 #define _UVM_UVM_EXTERN_H_
 
@@ -287,8 +322,30 @@
 typedef unsigned int  uvm_flag_t;
 typedef int vm_fault_t;
 
+/* XXX clean up later */
+struct buf;
+struct loadavg;
+struct proc;
+struct pmap;
+struct vmspace;
+struct vmtotal;
+struct mount;
+struct vnode;
+struct core;
+
 #ifdef _KERNEL
 
+/* vm_machdep.c */
+void           vmapbuf __P((struct buf *, vsize_t));
+void           vunmapbuf __P((struct buf *, vsize_t));
+void           pagemove __P((caddr_t, caddr_t, size_t));
+#ifndef        cpu_swapin
+void           cpu_swapin __P((struct proc *));
+#endif
+#ifndef        cpu_swapout
+void           cpu_swapout __P((struct proc *));
+#endif
+
 /* uvm_aobj.c */
 struct uvm_object      *uao_create __P((vsize_t, int));
 void                   uao_detach __P((struct uvm_object *));
diff -r 85bb2ea8d03d -r 465030d6c2fa sys/uvm/uvm_page.h
--- a/sys/uvm/uvm_page.h        Tue Jun 27 08:49:44 2000 +0000
+++ b/sys/uvm/uvm_page.h        Tue Jun 27 09:00:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.h,v 1.15 2000/04/24 17:12:01 thorpej Exp $    */
+/*     $NetBSD: uvm_page.h,v 1.16 2000/06/27 09:00:14 mrg Exp $        */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -73,6 +73,147 @@
  * uvm_page.h
  */
 
+/*
+ *     Resident memory system definitions.
+ */
+
+/*
+ *     Management of resident (logical) pages.
+ *
+ *     A small structure is kept for each resident
+ *     page, indexed by page number.  Each structure
+ *     is an element of several lists:
+ *
+ *             A hash table bucket used to quickly
+ *             perform object/offset lookups
+ *
+ *             A list of all pages for a given object,
+ *             so they can be quickly deactivated at
+ *             time of deallocation.
+ *
+ *             An ordered list of pages due for pageout.
+ *
+ *     In addition, the structure contains the object
+ *     and offset to which this page belongs (for pageout),
+ *     and sundry status bits.
+ *
+ *     Fields in this structure are locked either by the lock on the
+ *     object that the page belongs to (O) or by the lock on the page
+ *     queues (P) [or both].
+ */
+
+/*
+ * locking note: the mach version of this data structure had bit
+ * fields for the flags, and the bit fields were divided into two
+ * items (depending on who locked what).  some time, in BSD, the bit
+ * fields were dumped and all the flags were lumped into one short.
+ * that is fine for a single threaded uniprocessor OS, but bad if you
+ * want to actual make use of locking (simple_lock's).  so, we've
+ * seperated things back out again.
+ *
+ * note the page structure has no lock of its own.
+ */
+
+#include <uvm/uvm_extern.h>
+#include <uvm/uvm_pglist.h>
+
+struct vm_page {
+  TAILQ_ENTRY(vm_page) pageq;          /* queue info for FIFO
+                                        * queue or free list (P) */
+  TAILQ_ENTRY(vm_page) hashq;          /* hash table links (O)*/
+  TAILQ_ENTRY(vm_page) listq;          /* pages in same object (O)*/
+
+  struct vm_anon       *uanon;         /* anon (O,P) */
+  struct uvm_object    *uobject;       /* object (O,P) */
+  voff_t               offset;         /* offset into object (O,P) */
+
+  u_short              flags;          /* object flags [O] */
+  u_short              version;        /* version count [O] */
+  u_short              wire_count;     /* wired down map refs [P] */
+  u_short              pqflags;        /* page queue flags [P] */
+  u_int                        loan_count;     /* number of active loans
+                                        * to read: [O or P]
+                                        * to modify: [O _and_ P] */
+  paddr_t              phys_addr;      /* physical address of page */
+#if defined(UVM_PAGE_TRKOWN)
+  /* debugging fields to track page ownership */
+  pid_t                        owner;          /* proc that set PG_BUSY */
+  char                 *owner_tag;     /* why it was set busy */
+#endif
+};
+
+/*
+ * These are the flags defined for vm_page.
+ *
+ * Note: PG_FILLED and PG_DIRTY are added for the filesystems.
+ */
+
+/*
+ * locking rules:
+ *   PG_ ==> locked by object lock
+ *   PQ_ ==> lock by page queue lock 
+ *   PQ_FREE is locked by free queue lock and is mutex with all other PQs
+ *
+ * PG_ZERO is used to indicate that a page has been pre-zero'd.  This flag
+ * is only set when the page is on no queues, and is cleared when the page
+ * is placed on the free list.
+ *
+ * possible deadwood: PG_FAULTING, PQ_LAUNDRY
+ */
+#define        PG_CLEAN        0x0008          /* page has not been modified */
+#define        PG_BUSY         0x0010          /* page is in transit  */
+#define        PG_WANTED       0x0020          /* someone is waiting for page */
+#define        PG_TABLED       0x0040          /* page is in VP table  */
+#define        PG_ZERO         0x0100          /* page is pre-zero'd */
+#define        PG_FAKE         0x0200          /* page is placeholder for pagein */
+#define        PG_FILLED       0x0400          /* client flag to set when filled */
+#define        PG_DIRTY        0x0800          /* client flag to set when dirty */
+#define PG_RELEASED    0x1000          /* page released while paging */
+#define        PG_FAULTING     0x2000          /* page is being faulted in */
+#define PG_CLEANCHK    0x4000          /* clean bit has been checked */
+
+#define PQ_FREE                0x0001          /* page is on free list */
+#define PQ_INACTIVE    0x0002          /* page is in inactive list */
+#define PQ_ACTIVE      0x0004          /* page is in active list */
+#define PQ_LAUNDRY     0x0008          /* page is being cleaned now */
+#define PQ_ANON                0x0010          /* page is part of an anon, rather
+                                          than an uvm_object */
+#define PQ_AOBJ                0x0020          /* page is part of an anonymous
+                                          uvm_object */
+#define PQ_SWAPBACKED  (PQ_ANON|PQ_AOBJ)
+
+/*
+ * physical memory layout structure
+ *
+ * MD vmparam.h must #define:
+ *   VM_PHYSEG_MAX = max number of physical memory segments we support
+ *                (if this is "1" then we revert to a "contig" case)
+ *   VM_PHYSSEG_STRAT: memory sort/search options (for VM_PHYSEG_MAX > 1)
+ *     - VM_PSTRAT_RANDOM:   linear search (random order)
+ *     - VM_PSTRAT_BSEARCH:  binary search (sorted by address)
+ *     - VM_PSTRAT_BIGFIRST: linear search (sorted by largest segment first)
+ *      - others?
+ *   XXXCDC: eventually we should remove contig and old non-contig cases
+ *   and purge all left-over global variables...
+ */
+#define VM_PSTRAT_RANDOM       1
+#define VM_PSTRAT_BSEARCH      2
+#define VM_PSTRAT_BIGFIRST     3
+
+/*
+ * vm_physmemseg: describes one segment of physical memory
+ */
+struct vm_physseg {
+       paddr_t start;                  /* PF# of first page in segment */
+       paddr_t end;                    /* (PF# of last page in segment) + 1 */
+       paddr_t avail_start;            /* PF# of first free page in segment */
+       paddr_t avail_end;              /* (PF# of last free page in segment) +1  */
+       int     free_list;              /* which free list they belong on */
+       struct  vm_page *pgs;           /* vm_page structures (from start) */
+       struct  vm_page *lastpg;        /* vm_page structure for end */
+       struct  pmap_physseg pmseg;     /* pmap specific (MD) data */
+};
+
 #ifdef _KERNEL
 
 /*
@@ -82,16 +223,34 @@
 extern boolean_t vm_page_zero_enable;
 
 /*
- * macros
+ *     Each pageable resident page falls into one of three lists:
+ *
+ *     free    
+ *             Available for allocation now.
+ *     inactive
+ *             Not referenced in any map, but still has an
+ *             object/offset-page mapping, and may be dirty.
+ *             This is the list of pages that should be



Home | Main Index | Thread Index | Old Index