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 173203 2007-10-30 22:09:16Z jhb $"); |
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> --- 219 unchanged lines hidden (view full) --- 256 UID_ROOT, 257 GID_WHEEL, 258 0600, 259 "agpgart"); 260 261 return 0; 262} 263 |
264void 265agp_free_cdev(device_t dev) |
266{ 267 struct agp_softc *sc = device_get_softc(dev); 268 269 destroy_dev(sc->as_devnode); |
270} 271 272void 273agp_free_res(device_t dev) 274{ 275 struct agp_softc *sc = device_get_softc(dev); 276 |
277 bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, 278 sc->as_aperture); 279 mtx_destroy(&sc->as_lock); 280 agp_flush_cache(); |
281} 282 283int 284agp_generic_detach(device_t dev) 285{ 286 287 agp_free_cdev(dev); 288 agp_free_res(dev); |
289 return 0; 290} 291 292/** 293 * Default AGP aperture size detection which simply returns the size of 294 * the aperture's PCI resource. 295 */ 296int --- 679 unchanged lines hidden --- |