From f7048cc4037774e9d6f9e18e986f252317531b35 Mon Sep 17 00:00:00 2001 From: yamt Date: Fri, 8 Feb 2008 11:49:40 +0000 Subject: [PATCH] uvm_uarea_init: fix compilation where PAGE_SIZE is not a constant. (sparc) reported by Tom Spindler. --- sys/uvm/uvm_glue.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c index 0192260eb6c1..f6eb0ad17bf0 100644 --- a/sys/uvm/uvm_glue.c +++ b/sys/uvm/uvm_glue.c @@ -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 -__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); }