diff options
author | cokane <cokane@FreeBSD.org> | 2002-04-15 18:57:26 +0000 |
---|---|---|
committer | cokane <cokane@FreeBSD.org> | 2002-04-15 18:57:26 +0000 |
commit | 4ab1aeb8f11d968fb0aad7ce3a8bc7fa9000db34 (patch) | |
tree | a2fdc6a91d38fed5a5623bef749b971ec2bee44b /sys/dev/agp | |
parent | 31dc2e2cc426590eef1626c19b77a7f4491f82e3 (diff) | |
download | FreeBSD-src-4ab1aeb8f11d968fb0aad7ce3a8bc7fa9000db34.zip FreeBSD-src-4ab1aeb8f11d968fb0aad7ce3a8bc7fa9000db34.tar.gz |
Fix some nits in AMD AGP driver. Remove excess malloc and move a bzero
out of the way, so it won't cause trouble.
Submitted by: Frank Mayher <frank@exit.com>
MFC after: 1 week
Diffstat (limited to 'sys/dev/agp')
-rw-r--r-- | sys/dev/agp/agp_amd.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/agp/agp_amd.c b/sys/dev/agp/agp_amd.c index df27fca..527765d 100644 --- a/sys/dev/agp/agp_amd.c +++ b/sys/dev/agp/agp_amd.c @@ -112,8 +112,6 @@ agp_amd_alloc_gatt(device_t dev) * Allocate the page directory. */ gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); - bzero(gatt->ag_vdir, AGP_PAGE_SIZE); - if (!gatt->ag_vdir) { if (bootverbose) device_printf(dev, @@ -122,6 +120,8 @@ agp_amd_alloc_gatt(device_t dev) free(gatt, M_AGP); return 0; } + bzero(gatt->ag_vdir, AGP_PAGE_SIZE); + gatt->ag_pdir = vtophys((vm_offset_t) gatt->ag_vdir); if(bootverbose) device_printf(dev, "gatt -> ag_pdir %8x\n", @@ -133,14 +133,7 @@ agp_amd_alloc_gatt(device_t dev) if(bootverbose) device_printf(dev, "allocating GATT for %d AGP page entries\n", gatt->ag_entries); - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), M_AGP, - M_NOWAIT); - if(!gatt->ag_virtual) { - if(bootverbose) - device_printf(dev, "allocation failed\n"); - free(gatt, M_AGP); - return 0; - } + gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual); /* |