Deleted Added
full compact
agp_amd64.c (187100) agp_amd64.c (189578)
1/*-
2 * Copyright (c) 2004, 2005 Jung-uk Kim <jkim@FreeBSD.org>
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) 2004, 2005 Jung-uk Kim <jkim@FreeBSD.org>
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_amd64.c 187100 2009-01-12 16:07:03Z jkim $");
28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_amd64.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>

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

328 return (agp_amd64_via_set_aperture(dev, aperture));
329 break;
330 }
331
332 return (0);
333}
334
335static int
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>

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

328 return (agp_amd64_via_set_aperture(dev, aperture));
329 break;
330 }
331
332 return (0);
333}
334
335static int
336agp_amd64_bind_page(device_t dev, int offset, vm_offset_t physical)
336agp_amd64_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical)
337{
338 struct agp_amd64_softc *sc = device_get_softc(dev);
339
340 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
341 return (EINVAL);
342
343 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] =
344 (physical & 0xfffff000) | ((physical >> 28) & 0x00000ff0) | 3;
345
346 return (0);
347}
348
349static int
337{
338 struct agp_amd64_softc *sc = device_get_softc(dev);
339
340 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
341 return (EINVAL);
342
343 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] =
344 (physical & 0xfffff000) | ((physical >> 28) & 0x00000ff0) | 3;
345
346 return (0);
347}
348
349static int
350agp_amd64_unbind_page(device_t dev, int offset)
350agp_amd64_unbind_page(device_t dev, vm_offset_t offset)
351{
352 struct agp_amd64_softc *sc = device_get_softc(dev);
353
354 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
355 return (EINVAL);
356
357 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
358

--- 161 unchanged lines hidden ---
351{
352 struct agp_amd64_softc *sc = device_get_softc(dev);
353
354 if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT))
355 return (EINVAL);
356
357 sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0;
358

--- 161 unchanged lines hidden ---