diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2009-06-11 17:06:07 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2009-06-11 17:06:07 +0000 |
commit | 446188d1e6d517ed7cd1116a85505f4ebb1731d0 (patch) | |
tree | 0b750c6ce593cf15425e104eec338803366e2d97 /sys/dev/agp | |
parent | e76f11f441aa03e85f97886b2fd6c2228dc119f4 (diff) | |
download | src-446188d1e6d517ed7cd1116a85505f4ebb1731d0.tar.gz src-446188d1e6d517ed7cd1116a85505f4ebb1731d0.zip |
Notes
Diffstat (limited to 'sys/dev/agp')
-rw-r--r-- | sys/dev/agp/agp_ali.c | 8 | ||||
-rw-r--r-- | sys/dev/agp/agp_amd.c | 8 | ||||
-rw-r--r-- | sys/dev/agp/agp_ati.c | 8 | ||||
-rw-r--r-- | sys/dev/agp/agp_nvidia.c | 18 | ||||
-rw-r--r-- | sys/dev/agp/agp_sis.c | 8 |
5 files changed, 24 insertions, 26 deletions
diff --git a/sys/dev/agp/agp_ali.c b/sys/dev/agp/agp_ali.c index f6ecd78f3261..09ebb2bdb6da 100644 --- a/sys/dev/agp/agp_ali.c +++ b/sys/dev/agp/agp_ali.c @@ -206,11 +206,11 @@ agp_ali_set_aperture(device_t dev, u_int32_t aperture) } static int -agp_ali_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_ali_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_ali_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; @@ -218,11 +218,11 @@ agp_ali_bind_page(device_t dev, int offset, vm_offset_t physical) } static int -agp_ali_unbind_page(device_t dev, int offset) +agp_ali_unbind_page(device_t dev, vm_offset_t offset) { struct agp_ali_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index e0cb6799963d..fabb9b13472c 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -342,11 +342,11 @@ agp_amd_set_aperture(device_t dev, u_int32_t aperture) } static int -agp_amd_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_amd_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_amd_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; @@ -357,11 +357,11 @@ agp_amd_bind_page(device_t dev, int offset, vm_offset_t physical) } static int -agp_amd_unbind_page(device_t dev, int offset) +agp_amd_unbind_page(device_t dev, vm_offset_t offset) { struct agp_amd_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; diff --git a/sys/dev/agp/agp_ati.c b/sys/dev/agp/agp_ati.c index 05022f29361a..4c56df13ca39 100644 --- a/sys/dev/agp/agp_ati.c +++ b/sys/dev/agp/agp_ati.c @@ -315,11 +315,11 @@ agp_ati_set_aperture(device_t dev, u_int32_t aperture) } static int -agp_ati_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_ati_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_ati_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; @@ -328,11 +328,11 @@ agp_ati_bind_page(device_t dev, int offset, vm_offset_t physical) } static int -agp_ati_unbind_page(device_t dev, int offset) +agp_ati_unbind_page(device_t dev, vm_offset_t offset) { struct agp_ati_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; diff --git a/sys/dev/agp/agp_nvidia.c b/sys/dev/agp/agp_nvidia.c index 9aa082c5a90f..105f8a6ff827 100644 --- a/sys/dev/agp/agp_nvidia.c +++ b/sys/dev/agp/agp_nvidia.c @@ -90,8 +90,8 @@ static int agp_nvidia_attach(device_t); static int agp_nvidia_detach(device_t); static u_int32_t agp_nvidia_get_aperture(device_t); static int agp_nvidia_set_aperture(device_t, u_int32_t); -static int agp_nvidia_bind_page(device_t, int, vm_offset_t); -static int agp_nvidia_unbind_page(device_t, int); +static int agp_nvidia_bind_page(device_t, vm_offset_t, vm_offset_t); +static int agp_nvidia_unbind_page(device_t, vm_offset_t); static int nvidia_init_iorr(u_int32_t, u_int32_t); @@ -312,12 +312,12 @@ agp_nvidia_set_aperture(device_t dev, u_int32_t aperture) } static int -agp_nvidia_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_nvidia_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_nvidia_softc *sc = device_get_softc(dev); u_int32_t index; - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return (EINVAL); index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT; @@ -327,12 +327,12 @@ agp_nvidia_bind_page(device_t dev, int offset, vm_offset_t physical) } static int -agp_nvidia_unbind_page(device_t dev, int offset) +agp_nvidia_unbind_page(device_t dev, vm_offset_t offset) { struct agp_nvidia_softc *sc = device_get_softc(dev); u_int32_t index; - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return (EINVAL); index = (sc->pg_offset + offset) >> AGP_PAGE_SHIFT; @@ -341,8 +341,8 @@ agp_nvidia_unbind_page(device_t dev, int offset) return (0); } -static int -agp_nvidia_flush_tlb (device_t dev, int offset) +static void +agp_nvidia_flush_tlb (device_t dev) { struct agp_nvidia_softc *sc; u_int32_t wbc_reg, temp; @@ -378,8 +378,6 @@ agp_nvidia_flush_tlb (device_t dev, int offset) temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; for(i = 0; i < pages; i++) temp = ag_virtual[i * PAGE_SIZE / sizeof(u_int32_t)]; - - return (0); } #define SYSCFG 0xC0010010 diff --git a/sys/dev/agp/agp_sis.c b/sys/dev/agp/agp_sis.c index f85fa116ab23..e8f542bfe306 100644 --- a/sys/dev/agp/agp_sis.c +++ b/sys/dev/agp/agp_sis.c @@ -227,11 +227,11 @@ agp_sis_set_aperture(device_t dev, u_int32_t aperture) } static int -agp_sis_bind_page(device_t dev, int offset, vm_offset_t physical) +agp_sis_bind_page(device_t dev, vm_offset_t offset, vm_offset_t physical) { struct agp_sis_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; @@ -239,11 +239,11 @@ agp_sis_bind_page(device_t dev, int offset, vm_offset_t physical) } static int -agp_sis_unbind_page(device_t dev, int offset) +agp_sis_unbind_page(device_t dev, vm_offset_t offset) { struct agp_sis_softc *sc = device_get_softc(dev); - if (offset < 0 || offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) + if (offset >= (sc->gatt->ag_entries << AGP_PAGE_SHIFT)) return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; |