uvm_uarea_init: fix compilation where PAGE_SIZE is not a constant. (sparc)

reported by Tom Spindler.
This commit is contained in:
yamt 2008-02-08 11:49:40 +00:00
parent 2ec9a34ee9
commit f7048cc403
1 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_glue.c,v 1.116 2008/02/07 12:21:24 yamt Exp $ */
/* $NetBSD: uvm_glue.c,v 1.117 2008/02/08 11:49:40 yamt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.116 2008/02/07 12:21:24 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_glue.c,v 1.117 2008/02/08 11:49:40 yamt Exp $");
#include "opt_coredump.h"
#include "opt_kgdb.h"
@ -343,6 +343,7 @@ static struct pool_allocator uvm_uarea_allocator = {
void
uvm_uarea_init(void)
{
int flags = PR_NOTOUCH;
/*
* specify PR_NOALIGN unless the alignment provided by
@ -350,11 +351,12 @@ uvm_uarea_init(void)
* pool page size (UPSACE) alignment.
*/
uvm_uarea_cache = pool_cache_init(USPACE, USPACE_ALIGN, 0,
#if (USPACE_ALIGN == 0 && USPACE != PAGE_SIZE) || (USPACE_ALIGN % USPACE) != 0
PR_NOALIGN |
#endif
PR_NOTOUCH,
if ((USPACE_ALIGN == 0 && USPACE != PAGE_SIZE) ||
(USPACE_ALIGN % USPACE) != 0) {
flags |= PR_NOALIGN;
}
uvm_uarea_cache = pool_cache_init(USPACE, USPACE_ALIGN, 0, flags,
"uarea", &uvm_uarea_allocator, IPL_NONE, uarea_ctor, NULL, NULL);
}