Deleted Added
full compact
agp_intel.c (165826) agp_intel.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_intel.c 165826 2007-01-06 08:31:31Z takawata $");
28__FBSDID("$FreeBSD: head/sys/dev/agp/agp_intel.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>

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

257 return (0);
258}
259
260static int
261agp_intel_detach(device_t dev)
262{
263 struct agp_intel_softc *sc;
264 u_int32_t reg;
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>

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

257 return (0);
258}
259
260static int
261agp_intel_detach(device_t dev)
262{
263 struct agp_intel_softc *sc;
264 u_int32_t reg;
265 int error;
266
267 sc = device_get_softc(dev);
268
265
266 sc = device_get_softc(dev);
267
269 error = agp_generic_detach(dev);
270 if (error)
271 return (error);
268 agp_free_cdev(dev);
272
273 /* Disable aperture accesses. */
274 switch (pci_get_devid(dev)) {
275 case 0x25008086: /* i820 */
276 case 0x25018086: /* i820 */
277 reg = pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1);
278 printf("%s: set RDCR to %02x\n", __func__, reg & 0xff);
279 pci_write_config(dev, AGP_INTEL_I820_RDCR, reg, 1);

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

300 default: /* Intel Generic (maybe) */
301 reg = pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9);
302 printf("%s: set NBXCFG to %08x\n", __func__, reg);
303 pci_write_config(dev, AGP_INTEL_NBXCFG, reg, 4);
304 }
305 pci_write_config(dev, AGP_INTEL_ATTBASE, 0, 4);
306 AGP_SET_APERTURE(dev, sc->initial_aperture);
307 agp_free_gatt(sc->gatt);
269
270 /* Disable aperture accesses. */
271 switch (pci_get_devid(dev)) {
272 case 0x25008086: /* i820 */
273 case 0x25018086: /* i820 */
274 reg = pci_read_config(dev, AGP_INTEL_I820_RDCR, 1) & ~(1 << 1);
275 printf("%s: set RDCR to %02x\n", __func__, reg & 0xff);
276 pci_write_config(dev, AGP_INTEL_I820_RDCR, reg, 1);

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

297 default: /* Intel Generic (maybe) */
298 reg = pci_read_config(dev, AGP_INTEL_NBXCFG, 4) & ~(1 << 9);
299 printf("%s: set NBXCFG to %08x\n", __func__, reg);
300 pci_write_config(dev, AGP_INTEL_NBXCFG, reg, 4);
301 }
302 pci_write_config(dev, AGP_INTEL_ATTBASE, 0, 4);
303 AGP_SET_APERTURE(dev, sc->initial_aperture);
304 agp_free_gatt(sc->gatt);
305 agp_free_res(dev);
308
309 return (0);
310}
311
312static int
313agp_intel_resume(device_t dev)
314{
315 struct agp_intel_softc *sc;

--- 126 unchanged lines hidden ---
306
307 return (0);
308}
309
310static int
311agp_intel_resume(device_t dev)
312{
313 struct agp_intel_softc *sc;

--- 126 unchanged lines hidden ---