--- sys/pci/agp_nvidia.c 2007-11-08 23:29:53.000000000 +0300 +++ sys/pci/agp_nvidia.c 2007-11-25 13:27:03.000000000 +0300 @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/pci/agp_nvidia.c,v 1.11.2.1 2007/11/08 20:29:53 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/pci/agp_nvidia.c,v 1.12 2007/10/30 22:09:16 jhb Exp $"); /* * Written using information gleaned from the @@ -346,7 +346,7 @@ { struct agp_nvidia_softc *sc; u_int32_t wbc_reg, temp; - volatile u_int32_t *ag_virtual; + u_int32_t off, step; int i; sc = (struct agp_nvidia_softc *)device_get_softc(dev); @@ -370,13 +370,12 @@ "TLB flush took more than 3 seconds.\n"); } - ag_virtual = (volatile u_int32_t *)sc->gatt->ag_virtual; - /* Flush TLB entries. */ - for(i = 0; i < 32 + 1; i++) - temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; - for(i = 0; i < 32 + 1; i++) - temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; + step = PAGE_SIZE / sizeof(u_int32_t); + for(off = 0; off < sc->gatt->ag_entries; off+=step) + temp = sc->gatt->ag_virtual[off]; + for(off = 0; off < sc->gatt->ag_entries; off+=step) + temp = sc->gatt->ag_virtual[off]; return (0); }