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;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to