Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Allow a pool's pagesz to larger than the VM page size.
details: https://anonhg.NetBSD.org/src/rev/de1545cbbc00
branches: trunk
changeset: 486967:de1545cbbc00
user: pk <pk%NetBSD.org@localhost>
date: Wed May 31 15:29:42 2000 +0000
description:
Allow a pool's pagesz to larger than the VM page size.
Enforce the required page alignment restriction in pool_prime_page().
diffstat:
sys/kern/subr_pool.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r c8b76adb7c8f -r de1545cbbc00 sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c Wed May 31 15:27:33 2000 +0000
+++ b/sys/kern/subr_pool.c Wed May 31 15:29:42 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pool.c,v 1.35 2000/05/31 15:03:54 pk Exp $ */
+/* $NetBSD: subr_pool.c,v 1.36 2000/05/31 15:29:42 pk Exp $ */
/*-
* Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -404,7 +404,7 @@
/*
* Check arguments and construct default values.
*/
- if (!powerof2(pagesz) || pagesz > PAGE_SIZE)
+ if (!powerof2(pagesz))
panic("pool_init: page size invalid (%lx)\n", (u_long)pagesz);
if (alloc == NULL && release == NULL) {
@@ -1025,6 +1025,9 @@
unsigned int ioff = pp->pr_itemoffset;
int s, n;
+ if (((u_long)cp & (pp->pr_pagesz - 1)) != 0)
+ panic("pool_prime_page: %s: unaligned page", pp->pr_wchan);
+
if ((pp->pr_roflags & PR_PHINPAGE) != 0) {
ph = (struct pool_item_header *)(cp + pp->pr_phoffset);
} else {
Home |
Main Index |
Thread Index |
Old Index