diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-08-11 10:57:23 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-08-11 10:57:23 +0000 |
commit | 7a180b0dffd8a6191dc39c284c4b43646bbe8ac6 (patch) | |
tree | 5442aa1b4d2ff26b5330a6478a7d647080cc100a /sys/vm | |
parent | 511fb2556ded7a7b5ce46090532eccce46d77468 (diff) |
Various random fixes from NetBSD.
Including support for zeroing pages in the idle loop (not enabled yet).
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/pglist.h | 54 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 7 | ||||
-rw-r--r-- | sys/vm/vm_param.h | 9 |
3 files changed, 62 insertions, 8 deletions
diff --git a/sys/vm/pglist.h b/sys/vm/pglist.h index 2e17c434f92..db28d210720 100644 --- a/sys/vm/pglist.h +++ b/sys/vm/pglist.h @@ -1,8 +1,60 @@ -/* $OpenBSD: pglist.h,v 1.1 1998/03/01 00:37:58 niklas Exp $ */ +/* $NetBSD: pglist.h,v 1.3 2000/04/24 17:12:02 thorpej Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * 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 NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ #ifndef _PGLIST_H_ #define _PGLIST_H_ +/* + * This defines the type of a page queue, e.g. active list, inactive + * list, etc. + */ TAILQ_HEAD(pglist, vm_page); +/* + * A page free list consists of free pages of unknown contents and free + * pages of all zeros. + */ +#define PGFL_UNKNOWN 0 +#define PGFL_ZEROS 1 +#define PGFL_NQUEUES 2 + +struct pgfreelist { + struct pglist pgfl_queues[PGFL_NQUEUES]; +}; + #endif diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 3c9665221fd..3616fc38b79 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_page.h,v 1.16 2001/08/06 14:03:05 art Exp $ */ +/* $OpenBSD: vm_page.h,v 1.17 2001/08/11 10:57:22 art Exp $ */ /* $NetBSD: vm_page.h,v 1.35 2000/03/26 20:54:48 kleink Exp $ */ /* @@ -149,12 +149,17 @@ struct vm_page { * 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 */ diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index 8d1293309dd..08aedd9e98e 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_param.h,v 1.24 2001/08/06 14:03:05 art Exp $ */ +/* $OpenBSD: vm_param.h,v 1.25 2001/08/11 10:57:22 art Exp $ */ /* $NetBSD: vm_param.h,v 1.25 2000/03/26 20:42:45 kleink Exp $ */ /* @@ -165,11 +165,8 @@ struct _ps_strings { * Round off or truncate to the nearest page. These will work * for either addresses or counts (i.e., 1 byte rounds to 1 page). */ -#define round_page(x) \ - (((x) + PAGE_MASK) & ~PAGE_MASK) -#define trunc_page(x) \ - ((x) & ~PAGE_MASK) - +#define round_page(x) (((x) + PAGE_MASK) & ~PAGE_MASK) +#define trunc_page(x) ((x) & ~PAGE_MASK) #else /* out-of-kernel versions of round_page and trunc_page */ #define round_page(x) \ |