Eliminate some magic numbers.

This commit is contained in:
Peter Wemm 1999-09-01 06:34:24 +00:00
parent 68db232834
commit 1be9d26e4a
2 changed files with 8 additions and 8 deletions

View File

@ -104,13 +104,13 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (!rle) {
if (*rid < 0)
return 0;
if (type == SYS_RES_IRQ && *rid > 1)
if (type == SYS_RES_IRQ && *rid >= ISA_NIRQ)
return 0;
if (type == SYS_RES_DRQ && *rid > 1)
if (type == SYS_RES_DRQ && *rid >= ISA_NDRQ)
return 0;
if (type != SYS_RES_MEMORY && *rid > 3)
if (type != SYS_RES_MEMORY && *rid >= ISA_NMEM)
return 0;
if (type == SYS_RES_IOPORT && *rid > 7)
if (type == SYS_RES_IOPORT && *rid >= ISA_NPORT)
return 0;
resource_list_add(rl, type, *rid, start, end, count);
}

View File

@ -104,13 +104,13 @@ isa_alloc_resource(device_t bus, device_t child, int type, int *rid,
if (!rle) {
if (*rid < 0)
return 0;
if (type == SYS_RES_IRQ && *rid > 1)
if (type == SYS_RES_IRQ && *rid >= ISA_NIRQ)
return 0;
if (type == SYS_RES_DRQ && *rid > 1)
if (type == SYS_RES_DRQ && *rid >= ISA_NDRQ)
return 0;
if (type != SYS_RES_MEMORY && *rid > 3)
if (type != SYS_RES_MEMORY && *rid >= ISA_NMEM)
return 0;
if (type == SYS_RES_IOPORT && *rid > 7)
if (type == SYS_RES_IOPORT && *rid >= ISA_NPORT)
return 0;
resource_list_add(rl, type, *rid, start, end, count);
}