From owner-svn-src-all@FreeBSD.ORG Sun Oct 20 23:02:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E5F9E53F; Sun, 20 Oct 2013 23:02:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D358126AD; Sun, 20 Oct 2013 23:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KN2GKM035609; Sun, 20 Oct 2013 23:02:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KN2GvX035608; Sun, 20 Oct 2013 23:02:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201310202302.r9KN2GvX035608@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Oct 2013 23:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256814 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 23:02:17 -0000 Author: nwhitehorn Date: Sun Oct 20 23:02:16 2013 New Revision: 256814 URL: http://svnweb.freebsd.org/changeset/base/256814 Log: Avoid sign overflow if there are more than 2 GB of RAM. Modified: head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sun Oct 20 22:50:57 2013 (r256813) +++ head/sys/powerpc/booke/machdep.c Sun Oct 20 23:02:16 2013 (r256814) @@ -192,7 +192,8 @@ extern int elf32_nxstack; static void cpu_booke_startup(void *dummy) { - int indx, size; + int indx; + unsigned long size; /* Initialise the decrementer-based clock. */ decr_init(); @@ -200,7 +201,7 @@ cpu_booke_startup(void *dummy) /* Good {morning,afternoon,evening,night}. */ cpu_setup(PCPU_GET(cpuid)); - printf("real memory = %ld (%ld MB)\n", ptoa(physmem), + printf("real memory = %lu (%ld MB)\n", ptoa(physmem), ptoa(physmem) / 1048576); realmem = physmem; @@ -210,7 +211,7 @@ cpu_booke_startup(void *dummy) for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { size = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n", + printf("0x%08x - 0x%08x, %lu bytes (%lu pages)\n", phys_avail[indx], phys_avail[indx + 1] - 1, size, size / PAGE_SIZE); } @@ -218,7 +219,7 @@ cpu_booke_startup(void *dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count), + printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count), ptoa(cnt.v_free_count) / 1048576); /* Set up buffers, so they can be used to read disk labels. */