{
u_int8_t key;
key = ffs(pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1) & 0x0f);
key = pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1) & 0x0f;
return (1 << (24 + (key ? key : 5)));
switch (key) {
case 0:
return 512 * 1024 * 1024;
case 8:
return 256 * 1024 * 1024;
case 12:
return 128 * 1024 * 1024;
case 14:
return 64 * 1024 * 1024;
case 15:
return 32 * 1024 * 1024;
default:
device_printf(dev, "Unknown aperture size key 0x%x\n", key);
return 0;
}
static int