Lines Matching defs:gatt
62 u_int32_t *ag_virtual; /* virtual address of gatt */
63 bus_addr_t ag_physical; /* bus address of gatt */
69 struct agp_amd_gatt *gatt;
100 struct agp_amd_gatt *gatt;
104 gatt = malloc(sizeof(struct agp_amd_gatt), M_AGP, M_WAITOK);
108 &gatt->ag_dmamap, &vdir, &gatt->ag_pdir,
109 &gatt->ag_dmaseg, 1, &gatt->ag_nseg) != 0) {
110 printf("failed to allocate GATT\n");
111 free(gatt, M_AGP);
115 gatt->ag_vdir = (u_int32_t *)vdir;
116 gatt->ag_entries = entries;
117 gatt->ag_virtual = (u_int32_t *)((char *)vdir + AGP_PAGE_SIZE);
118 gatt->ag_physical = gatt->ag_pdir + AGP_PAGE_SIZE;
119 gatt->ag_size = AGP_PAGE_SIZE + entries * sizeof(u_int32_t);
121 memset(gatt->ag_vdir, 0, AGP_PAGE_SIZE);
122 memset(gatt->ag_virtual, 0, entries * sizeof(u_int32_t));
125 * Map the pages of the GATT into the page directory.
131 gatt->ag_vdir[i] = (gatt->ag_physical + i * AGP_PAGE_SIZE) | 1;
138 return gatt;
143 agp_amd_free_gatt(struct agp_softc *sc, struct agp_amd_gatt *gatt)
145 agp_free_dmamem(sc->as_dmat, gatt->ag_size,
146 gatt->ag_dmamap, (void *)gatt->ag_virtual, &gatt->ag_dmaseg,
147 gatt->ag_nseg);
148 free(gatt, M_AGP);
172 struct agp_amd_gatt *gatt;
200 gatt = agp_amd_alloc_gatt(sc);
201 if (gatt)
206 * aperture so that the gatt size reduces.
213 asc->gatt = gatt;
215 /* Install the gatt. */
216 WRITE4(AGP_AMD751_ATTBASE, gatt->ag_physical);
247 /* Clear the GATT base */
253 agp_amd_free_gatt(sc, asc->gatt);
303 if (offset < 0 || offset >= (asc->gatt->ag_entries << AGP_PAGE_SHIFT))
306 asc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1;
315 if (offset < 0 || offset >= (asc->gatt->ag_entries << AGP_PAGE_SHIFT))
318 asc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;