agp_amd64.c (163181) | agp_amd64.c (173203) |
---|---|
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 163181 2006-10-09 20:26:32Z jkim $"); | 28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_amd64.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> --- 208 unchanged lines hidden (view full) --- 245 246 return (0); 247} 248 249static int 250agp_amd64_detach(device_t dev) 251{ 252 struct agp_amd64_softc *sc = device_get_softc(dev); | 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> --- 208 unchanged lines hidden (view full) --- 245 246 return (0); 247} 248 249static int 250agp_amd64_detach(device_t dev) 251{ 252 struct agp_amd64_softc *sc = device_get_softc(dev); |
253 int i, error; | 253 int i; |
254 | 254 |
255 if ((error = agp_generic_detach(dev))) 256 return (error); | 255 agp_free_cdev(dev); |
257 258 for (i = 0; i < sc->n_mctrl; i++) 259 pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL, 260 pci_cfgregread(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL, 4) & 261 ~AGP_AMD64_APCTRL_GARTEN, 4); 262 263 AGP_SET_APERTURE(dev, sc->initial_aperture); 264 agp_free_gatt(sc->gatt); | 256 257 for (i = 0; i < sc->n_mctrl; i++) 258 pci_cfgregwrite(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL, 259 pci_cfgregread(0, sc->mctrl[i], 3, AGP_AMD64_APCTRL, 4) & 260 ~AGP_AMD64_APCTRL_GARTEN, 4); 261 262 AGP_SET_APERTURE(dev, sc->initial_aperture); 263 agp_free_gatt(sc->gatt); |
264 agp_free_res(dev); |
|
265 266 return (0); 267} 268 269static uint32_t agp_amd64_table[] = { 270 0x02000000, /* 32 MB */ 271 0x04000000, /* 64 MB */ 272 0x08000000, /* 128 MB */ --- 245 unchanged lines hidden --- | 265 266 return (0); 267} 268 269static uint32_t agp_amd64_table[] = { 270 0x02000000, /* 32 MB */ 271 0x04000000, /* 64 MB */ 272 0x08000000, /* 128 MB */ --- 245 unchanged lines hidden --- |