From owner-svn-src-head@FreeBSD.ORG Mon Feb 4 05:16:41 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D6F8255E; Mon, 4 Feb 2013 05:16:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id 770B0DA6; Mon, 4 Feb 2013 05:16:41 +0000 (UTC) Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r145GTjS030618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Feb 2013 16:16:31 +1100 Date: Mon, 4 Feb 2013 16:16:29 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl Subject: Re: svn commit: r246301 - head/sys/kern In-Reply-To: <201302032143.r13LhuQ3053811@svn.freebsd.org> Message-ID: <20130204160720.F1009@besplex.bde.org> References: <201302032143.r13LhuQ3053811@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Zty1sKHG c=1 sm=1 a=9tJy_2lEROAA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=oJKyWqhHDGzF01hoqg8A:9 a=CjuIK1q_8ugA:10 a=mXeW1zBZkXM7NW3O:21 a=MaVhI5ispiHdj2y6:21 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 05:16:41 -0000 On Sun, 3 Feb 2013, Marius Strobl wrote: > Log: > Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant > values to SYSCTL_ULONG(9) where possible. > > Submitted by: bde > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Sun Feb 3 21:30:29 2013 (r246300) > +++ head/sys/kern/kern_malloc.c Sun Feb 3 21:43:55 2013 (r246301) > @@ -186,15 +186,16 @@ struct { > */ > static uma_zone_t mt_zone; > > -static vm_offset_t vm_min_kernel_address = VM_MIN_KERNEL_ADDRESS; > -SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, > - &vm_min_kernel_address, 0, "Min kernel address"); > +SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD, NULL, > + VM_MIN_KERNEL_ADDRESS, "Min kernel address"); SYSCTL_*() (except SYSCTL_PROC()) is conventionally split after CTLFLAG* (to highlight the usual value pointer). This does a different splitting, presumably to highlight the value non-pointer. I'm not sure that that is maintainable. The convention for the usual case is often not followed. > > +SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > #ifndef __sparc64__ > -static vm_offset_t vm_max_kernel_address = VM_MAX_KERNEL_ADDRESS; > + NULL, VM_MAX_KERNEL_ADDRESS, > +#else > + &vm_max_kernel_address, 0, > #endif > -SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLAG_RD, > - &vm_max_kernel_address, 0, "Max kernel address"); > + "Max kernel address"); I barely remember mentioning that. MD macros in general could in theory be any expression (say a function call), but if these ones were non-constant expressions then they wouldn't have worked in the old code either. Bruce