1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_via.c 189578 2009-03-09 13:27:33Z imp $"); |
29 30#include "opt_bus.h" 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/malloc.h> 35#include <sys/kernel.h> 36#include <sys/module.h> --- 316 unchanged lines hidden (view full) --- 353 val = pci_read_config(dev, sc->regs[REG_APSIZE], 2); 354 pci_write_config(dev, sc->regs[REG_APSIZE], 355 ((val & ~0xfff) | key), 2); 356 } 357 return 0; 358} 359 360static int |
361agp_via_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) |
362{ 363 struct agp_via_softc *sc = device_get_softc(dev); 364 365 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) 366 return EINVAL; 367 368 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; 369 return 0; 370} 371 372static int |
373agp_via_unbind_page(device_t dev, vm_offset_t offset) |
374{ 375 struct agp_via_softc *sc = device_get_softc(dev); 376 377 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) 378 return EINVAL; 379 380 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; 381 return 0; --- 55 unchanged lines hidden --- |