From owner-freebsd-arch@FreeBSD.ORG Tue Mar 1 06:44:39 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDBA016A4CE; Tue, 1 Mar 2005 06:44:39 +0000 (GMT) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87DB943D60; Tue, 1 Mar 2005 06:44:39 +0000 (GMT) (envelope-from wes@softweyr.com) Received: from zaphod.softweyr.com (cpe-66-75-60-23.san.res.rr.com [66.75.60.23]) by smtp-relay.omnis.com (Postfix) with ESMTP id 8207014077E4; Mon, 28 Feb 2005 22:44:38 -0800 (PST) From: Wes Peters Organization: Softweyr.COM To: obrien@freebsd.org Date: Mon, 28 Feb 2005 22:44:38 -0800 User-Agent: KMail/1.7.2 References: <200502282142.j1SLgvhh067909@repoman.freebsd.org> <20050301041945.GA85655@dragon.nuxi.com> In-Reply-To: <20050301041945.GA85655@dragon.nuxi.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_W9AJCLS/87tB/ON" Message-Id: <200502282244.38877@zaphod.softweyr.com> cc: arch@freebsd.org Subject: Review request (Re: cvs commit: src/sys/i386/i386 machdep.c et al) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2005 06:44:39 -0000 --Boundary-00=_W9AJCLS/87tB/ON Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday 28 February 2005 20:19, David O'Brien wrote: > On Mon, Feb 28, 2005 at 09:42:57PM +0000, Wes Peters wrote: > > wes 2005-02-28 21:42:57 UTC > > FreeBSD src repository > > Modified files: > > sys/i386/i386 machdep.c > > sys/kern kern_mib.c > > sys/sys sysctl.h systm.h > > Log: > > Add a sysctl that records the amount of physical memory in the machine. > > > > Submitted by: Nicko Dehaine > > MFC after: 1 day > > Uh, I hope you will fix the build on all non-i386 platforms before you > MFC. Where were they suppose to get the 'realmem' definition from? I've tested the attached patch on sparc64. Does this look OK for the rest of the arches? I left amd64 out since you have (apparently) already fixed that. -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com --Boundary-00=_W9AJCLS/87tB/ON Content-Type: text/x-diff; charset="iso-8859-1"; name="realmem.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="realmem.patch" Index: alpha/alpha/machdep.c =================================================================== RCS file: /ncvs/src/sys/alpha/alpha/machdep.c,v retrieving revision 1.232 diff -u -r1.232 machdep.c --- alpha/alpha/machdep.c 6 Feb 2005 01:55:06 -0000 1.232 +++ alpha/alpha/machdep.c 1 Mar 2005 14:35:38 -0000 @@ -194,6 +194,7 @@ struct msgbuf *msgbufp=0; long Maxmem = 0; +long realmem = 0; long totalphysmem; /* total amount of physical memory in system */ long resvmem; /* amount of memory reserved for PROM */ @@ -250,6 +251,7 @@ #endif printf("real memory = %ld (%ld MB)\n", alpha_ptob(Maxmem), alpha_ptob(Maxmem) / 1048576); + realmem = (long)alpha_ptob(Maxmem); /* * Display any holes after the first chunk of extended memory. Index: ia64/ia64/machdep.c =================================================================== RCS file: /ncvs/src/sys/ia64/ia64/machdep.c,v retrieving revision 1.196 diff -u -r1.196 machdep.c --- ia64/ia64/machdep.c 6 Feb 2005 01:55:07 -0000 1.196 +++ ia64/ia64/machdep.c 1 Mar 2005 14:34:25 -0000 @@ -143,6 +143,7 @@ struct msgbuf *msgbufp=0; long Maxmem = 0; +long realmem = 0; vm_offset_t phys_avail[100]; @@ -246,6 +247,7 @@ #endif printf("real memory = %ld (%ld MB)\n", ia64_ptob(Maxmem), ia64_ptob(Maxmem) / 1048576); + realmem = (long)ia64_ptob(Maxmem); /* * Display any holes after the first chunk of extended memory. Index: pc98/i386/machdep.c =================================================================== RCS file: /ncvs/src/sys/pc98/i386/machdep.c,v retrieving revision 1.353 diff -u -r1.353 machdep.c --- pc98/i386/machdep.c 24 Feb 2005 13:15:05 -0000 1.353 +++ pc98/i386/machdep.c 1 Mar 2005 14:33:52 -0000 @@ -196,6 +196,7 @@ #endif long Maxmem = 0; +long realmem = 0; vm_paddr_t phys_avail[10]; @@ -228,6 +229,8 @@ #endif printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), ptoa((uintmax_t)Maxmem) / 1048576); + realmem = (long)ptoa((uintmax_t)Maxmem); + /* * Display any holes after the first chunk of extended memory. */ Index: sparc64/sparc64/machdep.c =================================================================== RCS file: /ncvs/src/sys/sparc64/sparc64/machdep.c,v retrieving revision 1.121 diff -u -r1.121 machdep.c --- sparc64/sparc64/machdep.c 6 Feb 2005 01:55:08 -0000 1.121 +++ sparc64/sparc64/machdep.c 1 Mar 2005 14:33:36 -0000 @@ -118,6 +118,7 @@ int cold = 1; long Maxmem; +long realmem; char pcpu0[PCPU_PAGES * PAGE_SIZE]; struct trapframe frame0; @@ -198,6 +199,7 @@ physsz += sparc64_memreg[i].mr_size; printf("real memory = %lu (%lu MB)\n", physsz, physsz / (1024 * 1024)); + realmem = (long)physsz; vm_ksubmap_init(&kmi); Index: powerpc/powerpc/machdep.c =================================================================== RCS file: /ncvs/src/sys/powerpc/powerpc/machdep.c,v retrieving revision 1.82 diff -u -r1.82 machdep.c --- powerpc/powerpc/machdep.c 6 Feb 2005 01:55:08 -0000 1.82 +++ powerpc/powerpc/machdep.c 1 Mar 2005 14:33:13 -0000 @@ -160,6 +160,7 @@ void asm_panic(char *); long Maxmem = 0; +long realmem = 0; struct pmap ofw_pmap; extern int ofmsr; @@ -197,6 +198,7 @@ #endif printf("real memory = %ld (%ld MB)\n", ptoa(Maxmem), ptoa(Maxmem) / 1048576); + realmem = (long)ptoa(Maxmem); /* * Display any holes after the first chunk of extended memory. --Boundary-00=_W9AJCLS/87tB/ON--