svn commit: r251994 - stable/9/sys/dev/agp

Marius Strobl marius at FreeBSD.org
Wed Jun 19 15:12:11 UTC 2013


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;


More information about the svn-src-stable-9 mailing list