Deleted Added
full compact
agp_intel.c (189578) agp_intel.c (190169)
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>
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_intel.c 189578 2009-03-09 13:27:33Z imp $");
28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_intel.c 190169 2009-03-20 18:30:20Z rnoland $");
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>

--- 329 unchanged lines hidden (view full) ---

366
367static int
368agp_intel_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
369{
370 struct agp_intel_softc *sc;
371
372 sc = device_get_softc(dev);
373
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>

--- 329 unchanged lines hidden (view full) ---

366
367static int
368agp_intel_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
369{
370 struct agp_intel_softc *sc;
371
372 sc = device_get_softc(dev);
373
374 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
374 if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
375 return (EINVAL);
376
377 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 0x17;
378 return (0);
379}
380
381static int
382agp_intel_unbind_page(device_t dev, vm_offset_t offset)
383{
384 struct agp_intel_softc *sc;
385
386 sc = device_get_softc(dev);
387
375 return (EINVAL);
376
377 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 0x17;
378 return (0);
379}
380
381static int
382agp_intel_unbind_page(device_t dev, vm_offset_t offset)
383{
384 struct agp_intel_softc *sc;
385
386 sc = device_get_softc(dev);
387
388 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
388 if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
389 return (EINVAL);
390
391 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
392 return (0);
393}
394
395static void
396agp_intel_flush_tlb(device_t dev)

--- 43 unchanged lines hidden ---
389 return (EINVAL);
390
391 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
392 return (0);
393}
394
395static void
396agp_intel_flush_tlb(device_t dev)

--- 43 unchanged lines hidden ---