From owner-svn-src-all@FreeBSD.ORG Wed Jun 19 15:12:11 2013 Return-Path: Delivered-To: svn-src-all@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 0EABCFE0; Wed, 19 Jun 2013 15:12:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00A2F1950; Wed, 19 Jun 2013 15:12:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5JFCA8d060869; Wed, 19 Jun 2013 15:12:10 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5JFCAo9060868; Wed, 19 Jun 2013 15:12:10 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306191512.r5JFCAo9060868@svn.freebsd.org> From: Marius Strobl Date: Wed, 19 Jun 2013 15:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251994 - stable/9/sys/dev/agp X-SVN-Group: stable-9 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: Wed, 19 Jun 2013 15:12:11 -0000 Author: marius Date: Wed Jun 19 15:12:10 2013 New Revision: 251994 URL: http://svnweb.freebsd.org/changeset/base/251994 Log: MFC: r238172 (partial) Don't use Maxmem when the amount of memory is meant. Use realmem instead. Maxmem is not only a MD variable, it represents the highest physical memory address in use. On systems where memory is sparsely layed-out the highest memory address and the amount of memory are not interchangeable. Scaling the AGP aperture based on the actual amount of memory (= realmem) rather than the available memory (= physmem) makes sure there's consistent behaviour across architectures. Modified: stable/9/sys/dev/agp/agp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/agp/agp.c ============================================================================== --- stable/9/sys/dev/agp/agp.c Wed Jun 19 13:37:29 2013 (r251993) +++ stable/9/sys/dev/agp/agp.c Wed Jun 19 15:12:10 2013 (r251994) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -235,7 +234,7 @@ agp_generic_attach(device_t dev) * Work out an upper bound for agp memory allocation. This * uses a heurisitc table from the Linux driver. */ - memsize = ptoa(Maxmem) >> 20; + memsize = ptoa(realmem) >> 20; for (i = 0; i < agp_max_size; i++) { if (memsize <= agp_max[i][0]) break;