diff options
Diffstat (limited to 'sys/uvm/uvm_page.h')
-rw-r--r-- | sys/uvm/uvm_page.h | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/sys/uvm/uvm_page.h b/sys/uvm/uvm_page.h index 9d3f67513ca..e5b01d58a95 100644 --- a/sys/uvm/uvm_page.h +++ b/sys/uvm/uvm_page.h @@ -1,9 +1,9 @@ -/* $OpenBSD: uvm_page.h,v 1.13 2001/11/12 01:26:09 art Exp $ */ -/* $NetBSD: uvm_page.h,v 1.19 2000/12/28 08:24:55 chs Exp $ */ +/* $OpenBSD: uvm_page.h,v 1.14 2001/11/28 19:28:15 art Exp $ */ +/* $NetBSD: uvm_page.h,v 1.27 2001/06/28 00:26:38 thorpej Exp $ */ -/* +/* * Copyright (c) 1997 Charles D. Cranor and Washington University. - * Copyright (c) 1991, 1993, The Regents of the University of California. + * Copyright (c) 1991, 1993, The Regents of the University of California. * * All rights reserved. * @@ -21,7 +21,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Charles D. Cranor, - * Washington University, the University of California, Berkeley and + * Washington University, 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 @@ -45,17 +45,17 @@ * * Copyright (c) 1987, 1990 Carnegie-Mellon University. * All rights reserved. - * + * * Permission to use, copy, modify and distribute this software and * its documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND + * + * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" + * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU @@ -128,14 +128,22 @@ struct vm_page { 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 flags: 16, /* object flags [O] */ + version: 16; /* version count [O] */ + + u_int wire_count: 16, /* wired down map refs [P] */ + pqflags: 8, /* page queue flags [P] */ + : 8; + 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 */ + +#ifdef __HAVE_VM_PAGE_MD + struct vm_page_md mdpage; /* pmap-specific data */ +#endif + #if defined(UVM_PAGE_TRKOWN) /* debugging fields to track page ownership */ pid_t owner; /* proc that set PG_BUSY */ @@ -145,14 +153,12 @@ struct vm_page { /* * 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_ ==> 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 @@ -172,12 +178,12 @@ struct vm_page { #define PG_PAGER1 0x1000 /* pager-specific flag */ -#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_ANON 0x0010 /* page is part of an anon, rather +#define PQ_FREE 0x01 /* page is on free list */ +#define PQ_INACTIVE 0x02 /* page is in inactive list */ +#define PQ_ACTIVE 0x04 /* page is in active list */ +#define PQ_ANON 0x10 /* page is part of an anon, rather than an uvm_object */ -#define PQ_AOBJ 0x0020 /* page is part of an anonymous +#define PQ_AOBJ 0x20 /* page is part of an anonymous uvm_object */ #define PQ_SWAPBACKED (PQ_ANON|PQ_AOBJ) #define PQ_ENCRYPT 0x0040 /* page needs {en,de}cryption */ @@ -210,7 +216,9 @@ struct vm_physseg { 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 */ +/* #ifdef __HAVE_PMAP_PHYSSEG XXX */ struct pmap_physseg pmseg; /* pmap specific (MD) data */ +/* #endif */ }; #ifdef _KERNEL @@ -224,7 +232,7 @@ extern boolean_t vm_page_zero_enable; /* * Each pageable resident page falls into one of three lists: * - * free + * free * Available for allocation now. * inactive * Not referenced in any map, but still has an @@ -254,7 +262,7 @@ extern int vm_nphysseg; #ifdef UVM_PAGE_INLINE #define PAGE_INLINE static __inline -#else +#else #define PAGE_INLINE /* nothing */ #endif /* UVM_PAGE_INLINE */ @@ -270,6 +278,7 @@ void uvm_page_own __P((struct vm_page *, char *)); boolean_t uvm_page_physget __P((paddr_t *)); #endif void uvm_page_rehash __P((void)); +void uvm_page_recolor __P((int)); void uvm_pageidlezero __P((void)); PAGE_INLINE int uvm_lock_fpageq __P((void)); @@ -308,6 +317,12 @@ static int vm_physseg_find __P((paddr_t, int *)); #define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr) /* + * Compute the page color bucket for a given page. + */ +#define VM_PGCOLOR_BUCKET(pg) \ + (atop(VM_PAGE_TO_PHYS((pg))) & uvmexp.colormask) + +/* * when VM_PHYSSEG_MAX is 1, we can simplify these functions */ |