Deleted Added
full compact
agp_i810.c (172187) agp_i810.c (173203)
1/*-
2 * Copyright (c) 2000 Doug Rabson
3 * Copyright (c) 2000 Ruslan Ermilov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

26 */
27
28/*
29 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
30 * 852GM/855GM/865G support added by David Dawes <dawes@xfree86.org>
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Doug Rabson
3 * Copyright (c) 2000 Ruslan Ermilov
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

26 */
27
28/*
29 * Fixes for 830/845G support: David Dawes <dawes@xfree86.org>
30 * 852GM/855GM/865G support added by David Dawes <dawes@xfree86.org>
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/agp/agp_i810.c 172187 2007-09-15 18:16:35Z alc $");
34__FBSDID("$FreeBSD: head/sys/dev/agp/agp_i810.c 173203 2007-10-30 22:09:16Z jhb $");
35
36#include "opt_bus.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

578
579 return 0;
580}
581
582static int
583agp_i810_detach(device_t dev)
584{
585 struct agp_i810_softc *sc = device_get_softc(dev);
35
36#include "opt_bus.h"
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>
41#include <sys/kernel.h>
42#include <sys/module.h>

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

578
579 return 0;
580}
581
582static int
583agp_i810_detach(device_t dev)
584{
585 struct agp_i810_softc *sc = device_get_softc(dev);
586 int error;
587
586
588 error = agp_generic_detach(dev);
589 if (error)
590 return error;
587 agp_free_cdev(dev);
591
592 /* Clear the GATT base. */
593 if ( sc->chiptype == CHIP_I810 ) {
594 bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0);
595 } else {
596 unsigned int pgtblctl;
597 pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
598 pgtblctl &= ~1;

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

603 AGP_SET_APERTURE(dev, sc->initial_aperture);
604
605 if ( sc->chiptype == CHIP_I810 ) {
606 contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP);
607 }
608 free(sc->gatt, M_AGP);
609
610 bus_release_resources(dev, sc->sc_res_spec, sc->sc_res);
588
589 /* Clear the GATT base. */
590 if ( sc->chiptype == CHIP_I810 ) {
591 bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0);
592 } else {
593 unsigned int pgtblctl;
594 pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
595 pgtblctl &= ~1;

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

600 AGP_SET_APERTURE(dev, sc->initial_aperture);
601
602 if ( sc->chiptype == CHIP_I810 ) {
603 contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP);
604 }
605 free(sc->gatt, M_AGP);
606
607 bus_release_resources(dev, sc->sc_res_spec, sc->sc_res);
608 agp_free_res(dev);
611
612 return 0;
613}
614
615/**
616 * Sets the PCI resource size of the aperture on i830-class and below chipsets,
617 * while returning failure on later chipsets when an actual change is
618 * requested.

--- 387 unchanged lines hidden ---
609
610 return 0;
611}
612
613/**
614 * Sets the PCI resource size of the aperture on i830-class and below chipsets,
615 * while returning failure on later chipsets when an actual change is
616 * requested.

--- 387 unchanged lines hidden ---