agp_ali.c (153572) | agp_ali.c (173203) |
---|---|
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_ali.c 153572 2005-12-20 21:12:26Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_ali.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> --- 99 unchanged lines hidden (view full) --- 136 137 return 0; 138} 139 140static int 141agp_ali_detach(device_t dev) 142{ 143 struct agp_ali_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> --- 99 unchanged lines hidden (view full) --- 136 137 return 0; 138} 139 140static int 141agp_ali_detach(device_t dev) 142{ 143 struct agp_ali_softc *sc = device_get_softc(dev); |
144 int error; | |
145 u_int32_t attbase; 146 | 144 u_int32_t attbase; 145 |
147 error = agp_generic_detach(dev); 148 if (error) 149 return error; | 146 agp_free_cdev(dev); |
150 151 /* Disable the TLB.. */ 152 pci_write_config(dev, AGP_ALI_TLBCTRL, 0x90, 1); 153 154 /* Put the aperture back the way it started. */ 155 AGP_SET_APERTURE(dev, sc->initial_aperture); 156 attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4); 157 pci_write_config(dev, AGP_ALI_ATTBASE, attbase & 0xfff, 4); 158 159 agp_free_gatt(sc->gatt); | 147 148 /* Disable the TLB.. */ 149 pci_write_config(dev, AGP_ALI_TLBCTRL, 0x90, 1); 150 151 /* Put the aperture back the way it started. */ 152 AGP_SET_APERTURE(dev, sc->initial_aperture); 153 attbase = pci_read_config(dev, AGP_ALI_ATTBASE, 4); 154 pci_write_config(dev, AGP_ALI_ATTBASE, attbase & 0xfff, 4); 155 156 agp_free_gatt(sc->gatt); |
157 agp_free_res(dev); |
|
160 return 0; 161} 162 163#define M 1024*1024 164 165static u_int32_t agp_ali_table[] = { 166 0, /* 0 - invalid */ 167 1, /* 1 - invalid */ --- 108 unchanged lines hidden --- | 158 return 0; 159} 160 161#define M 1024*1024 162 163static u_int32_t agp_ali_table[] = { 164 0, /* 0 - invalid */ 165 1, /* 1 - invalid */ --- 108 unchanged lines hidden --- |