diff options
| author | Coleman Kane <cokane@FreeBSD.org> | 2002-04-15 18:57:26 +0000 |
|---|---|---|
| committer | Coleman Kane <cokane@FreeBSD.org> | 2002-04-15 18:57:26 +0000 |
| commit | 9264fbc80a210e152cd88ac9f5f5ac0adb22f055 (patch) | |
| tree | a2fdc6a91d38fed5a5623bef749b971ec2bee44b /sys/dev | |
| parent | 7b0e82a919853ba4721885c4647034df51e5df62 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -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 df27fca306a8..527765d08268 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); /* |
