From owner-svn-src-stable@FreeBSD.ORG Sat Oct 31 18:54:27 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46897106566C; Sat, 31 Oct 2009 18:54:27 +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 F0B748FC1C; Sat, 31 Oct 2009 18:54:26 +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 n9VIsQ2G099601; Sat, 31 Oct 2009 18:54:26 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9VIsQYQ099590; Sat, 31 Oct 2009 18:54:26 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910311854.n9VIsQYQ099590@svn.freebsd.org> From: Alan Cox Date: Sat, 31 Oct 2009 18:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198728 - in stable/8/sys: . amd64/include amd64/include/xen arm/include cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/include ia64/include kern mips/includ... X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2009 18:54:27 -0000 Author: alc Date: Sat Oct 31 18:54:26 2009 New Revision: 198728 URL: http://svn.freebsd.org/changeset/base/198728 Log: MFC r197316 Add a new sysctl for reporting all of the supported page sizes. Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/param.h stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/arm/include/param.h stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/i386/include/param.h stable/8/sys/ia64/include/param.h stable/8/sys/kern/kern_mib.c stable/8/sys/mips/include/param.h stable/8/sys/powerpc/include/param.h stable/8/sys/sparc64/include/param.h stable/8/sys/sun4v/include/param.h stable/8/sys/sys/systm.h Modified: stable/8/sys/amd64/include/param.h ============================================================================== --- stable/8/sys/amd64/include/param.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/amd64/include/param.h Sat Oct 31 18:54:26 2009 (r198728) @@ -118,6 +118,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/8/sys/mips/include/param.h ============================================================================== --- stable/8/sys/mips/include/param.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/mips/include/param.h Sat Oct 31 18:54:26 2009 (r198728) @@ -115,6 +115,8 @@ #define SEGOFSET (NBSEG-1) /* byte offset into segment */ #define SEGSHIFT 22 /* LOG2(NBSEG) */ +#define MAXPAGESIZES 1 /* maximum number of supported page sizes */ + /* XXXimp: This has moved to vmparam.h */ /* Also, this differs from the mips2 definition, but likely is better */ /* since this means the kernel won't chew up TLBs when it is executing */ Modified: stable/8/sys/powerpc/include/param.h ============================================================================== --- stable/8/sys/powerpc/include/param.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/powerpc/include/param.h Sat Oct 31 18:54:26 2009 (r198728) @@ -98,6 +98,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/8/sys/sparc64/include/param.h ============================================================================== --- stable/8/sys/sparc64/include/param.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/sparc64/include/param.h Sat Oct 31 18:54:26 2009 (r198728) @@ -121,6 +121,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/8/sys/sun4v/include/param.h ============================================================================== --- stable/8/sys/sun4v/include/param.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/sun4v/include/param.h Sat Oct 31 18:54:26 2009 (r198728) @@ -116,6 +116,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/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Sat Oct 31 18:46:55 2009 (r198727) +++ stable/8/sys/sys/systm.h Sat Oct 31 18:54:26 2009 (r198728) @@ -54,6 +54,7 @@ extern int kstack_pages; /* number of ke extern int nswap; /* size of swap space */ +extern u_long pagesizes[]; /* supported page sizes */ extern long physmem; /* physical memory */ extern long realmem; /* 'real' memory */