]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Calculate the number of pages the GATT spans when reading from each page
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 7 Mar 2008 13:36:38 +0000 (13:36 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 7 Mar 2008 13:36:38 +0000 (13:36 +0000)
commitce6d690203aa1d4b7e7d6d608d3905d49c388e1b
treec1311f8cd9f24b9dbcc849f73902d4158fd7d6c6
parent233f8184ecfa5df4a666a64792a97db0ecdc9d66
Calculate the number of pages the GATT spans when reading from each page
to flush the TLB instead of hardcoding a size of 33 pages.  Apertures of
32MB and 64MB only use a 16 page GATT and an aperture of 128MB only uses
a 32 page GATT, so without this the code could walk off the end of the
pointer and cause a page fault if the next page was unmapped.  Also, for
aperture sizes > 128MB, not all of the pages would be read.  The Linux
driver has the same bug.

MFC after: 1 week
Tested by: Frédéric PRACA  frederic.praca of freebsd-fr.org
sys/dev/agp/agp_nvidia.c