Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2013 15:12:10 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
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
Message-ID:  <201306191512.r5JFCAo9060868@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <vm/vm_pageout.h>
 #include <vm/pmap.h>
 
-#include <machine/md_var.h>
 #include <machine/bus.h>
 #include <machine/resource.h>
 #include <sys/rman.h>
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306191512.r5JFCAo9060868>