From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 1 08:45:45 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43B061065676; Sun, 1 Nov 2009 08:45:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F2178FC18; Sun, 1 Nov 2009 08:45:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nA18jjdW017751; Sun, 1 Nov 2009 08:45:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA18jice017741; Sun, 1 Nov 2009 08:45:44 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200911010845.nA18jice017741@svn.freebsd.org> From: Alan Cox Date: Sun, 1 Nov 2009 08:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198742 - in stable/7/sys: . amd64/include arm/include contrib/pf i386/include ia64/include kern powerpc/include sparc64/include sun4v/include sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2009 08:45:45 -0000 Author: alc Date: Sun Nov 1 08:45:44 2009 New Revision: 198742 URL: http://svn.freebsd.org/changeset/base/198742 Log: MFC r197316 Add a new sysctl for reporting all of the supported page sizes. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/include/param.h stable/7/sys/arm/include/param.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/include/param.h stable/7/sys/ia64/include/param.h stable/7/sys/kern/kern_mib.c stable/7/sys/powerpc/include/param.h stable/7/sys/sparc64/include/param.h stable/7/sys/sun4v/include/param.h stable/7/sys/sys/systm.h Modified: stable/7/sys/amd64/include/param.h ============================================================================== --- stable/7/sys/amd64/include/param.h Sun Nov 1 08:20:30 2009 (r198741) +++ stable/7/sys/amd64/include/param.h Sun Nov 1 08:45:44 2009 (r198742) @@ -115,6 +115,8 @@ #define NBPML4 (1ul<flags & SCTL_MASK32) { + /* + * Recreate the "pagesizes" array with 32-bit elements. Truncate + * any page size greater than UINT32_MAX to zero. + */ + for (i = 0; i < MAXPAGESIZES; i++) + pagesizes32[i] = (uint32_t)pagesizes[i]; + + error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + } else +#endif + error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + return (error); +} +SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, + NULL, 0, sysctl_hw_pagesizes, "LU", "Supported page sizes"); + static char machine_arch[] = MACHINE_ARCH; SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD, machine_arch, 0, "System architecture"); Modified: stable/7/sys/powerpc/include/param.h ============================================================================== --- stable/7/sys/powerpc/include/param.h Sun Nov 1 08:20:30 2009 (r198741) +++ stable/7/sys/powerpc/include/param.h Sun Nov 1 08:45:44 2009 (r198742) @@ -81,6 +81,8 @@ #define PAGE_MASK (PAGE_SIZE - 1) #define NPTEPG (PAGE_SIZE/(sizeof (pt_entry_t))) +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* includes pcb */ #endif Modified: stable/7/sys/sparc64/include/param.h ============================================================================== --- stable/7/sys/sparc64/include/param.h Sun Nov 1 08:20:30 2009 (r198741) +++ stable/7/sys/sparc64/include/param.h Sun Nov 1 08:45:44 2009 (r198742) @@ -107,6 +107,8 @@ #define PAGE_SIZE_MAX PAGE_SIZE_4M #define PAGE_MASK_MAX PAGE_MASK_4M +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ #endif Modified: stable/7/sys/sun4v/include/param.h ============================================================================== --- stable/7/sys/sun4v/include/param.h Sun Nov 1 08:20:30 2009 (r198741) +++ stable/7/sys/sun4v/include/param.h Sun Nov 1 08:45:44 2009 (r198742) @@ -102,6 +102,8 @@ #define PAGE_SIZE_MAX PAGE_SIZE_4M #define PAGE_MASK_MAX PAGE_MASK_4M +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + #ifndef KSTACK_PAGES #define KSTACK_PAGES 4 /* pages of kernel stack (with pcb) */ #endif Modified: stable/7/sys/sys/systm.h ============================================================================== --- stable/7/sys/sys/systm.h Sun Nov 1 08:20:30 2009 (r198741) +++ stable/7/sys/sys/systm.h Sun Nov 1 08:45:44 2009 (r198742) @@ -60,6 +60,7 @@ extern u_int nselcoll; /* select collis extern struct mtx sellock; /* select lock variable */ extern struct cv selwait; /* select conditional variable */ +extern u_long pagesizes[]; /* supported page sizes */ extern long physmem; /* physical memory */ extern long realmem; /* 'real' memory */