summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsd-core/ati_pcigart.c8
-rw-r--r--bsd/ati_pcigart.h8
2 files changed, 10 insertions, 6 deletions
diff --git a/bsd-core/ati_pcigart.c b/bsd-core/ati_pcigart.c
index bfb8ab25..ba0b81a7 100644
--- a/bsd-core/ati_pcigart.c
+++ b/bsd-core/ati_pcigart.c
@@ -57,7 +57,8 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
goto done;
}
- address = malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
+ address = (long)contigmalloc((1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE,
+ DRM(M_DRM), M_WAITOK, 0ul, 0xfffffffful, PAGE_SIZE, 0);
if ( !address ) {
DRM_ERROR( "cannot allocate PCI GART page!\n" );
goto done;
@@ -103,7 +104,8 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
return 0;
}
- free( (void *)addr, DRM(M_DRM));
-
+#if __FreeBSD_version > 500000
+ contigfree( (void *)addr, (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM)); /* Not available on 4.x */
+#endif
return 1;
}
diff --git a/bsd/ati_pcigart.h b/bsd/ati_pcigart.h
index bfb8ab25..ba0b81a7 100644
--- a/bsd/ati_pcigart.h
+++ b/bsd/ati_pcigart.h
@@ -57,7 +57,8 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
goto done;
}
- address = malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
+ address = (long)contigmalloc((1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE,
+ DRM(M_DRM), M_WAITOK, 0ul, 0xfffffffful, PAGE_SIZE, 0);
if ( !address ) {
DRM_ERROR( "cannot allocate PCI GART page!\n" );
goto done;
@@ -103,7 +104,8 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
return 0;
}
- free( (void *)addr, DRM(M_DRM));
-
+#if __FreeBSD_version > 500000
+ contigfree( (void *)addr, (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM)); /* Not available on 4.x */
+#endif
return 1;
}