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.c 190169 2009-03-20 18:30:20Z rnoland $"); |
29 30#include "opt_agp.h" 31#include "opt_bus.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> --- 490 unchanged lines hidden (view full) --- 527 vm_offset_t offset) 528{ 529 struct agp_softc *sc = device_get_softc(dev); 530 vm_offset_t i, j, k; 531 vm_page_t m; 532 int error; 533 534 /* Do some sanity checks first. */ |
535 if ((offset & (AGP_PAGE_SIZE - 1)) != 0 || |
536 offset + mem->am_size > AGP_GET_APERTURE(dev)) { 537 device_printf(dev, "binding memory at bad offset %#x\n", 538 (int)offset); 539 return EINVAL; 540 } 541 542 /* 543 * Allocate the pages early, before acquiring the lock, --- 436 unchanged lines hidden --- |