diff options
author | Adam Jackson <ajax@redhat.com> | 2008-10-09 00:34:42 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-11-24 23:40:03 -0500 |
commit | b21311a99d58997cd1fc68726d0848242e9c34fc (patch) | |
tree | beb4d165b9e023d216873ef5877128c401596b60 | |
parent | 41be6b3f0dc0baa1c6ae8d2b41a6be73ca0e7268 (diff) |
Bus: Remove unused RemoveOverlaps
-rw-r--r-- | hw/xfree86/common/xf86Bus.c | 85 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Bus.h | 2 |
2 files changed, 0 insertions, 87 deletions
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 8d3d9bbe3..7aab953f5 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -1335,91 +1335,6 @@ xf86ResourceBrokerInit(void) xf86PrintResList(3, Acc); } -#define MEM_ALIGN (1024 * 1024) - -/* - * RemoveOverlaps() -- remove overlaps between resources of the - * same kind. - * Beware: This function doesn't check for access attributes. - * At resource broker initialization this is no problem as this - * only deals with exclusive resources. - */ - -void -RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, Bool useEstimated) -{ - resPtr pRes; - memType size, newsize, adjust; - - if (!target) - return; - - if (!(target->res_type & ResOverlap)) /* only touch overlaps */ - return; - - for (pRes = list; pRes; pRes = pRes->next) { - if (pRes == target - || ((pRes->res_type & ResTypeMask) != - (target->res_type & ResTypeMask)) - || pRes->block_begin > target->block_end - || pRes->block_end < target->block_begin) - continue; - - if (pRes->block_begin <= target->block_begin) { - - /* Special cases */ - if (pRes->block_end >= target->block_end) { - /* - * If pRes fully contains target, don't do anything - * unless target can overlap. - */ - if (target->res_type & ResOverlap) { - /* Nullify range but keep its ResOverlap bit on */ - target->block_end = target->block_begin - 1; - return; - } else - continue; - } else { -#if 0 /* Don't trim start address - we trust what we got */ - /* - * If !pow2Alignment trim start address: !pow2Alingment - * is only set when estimated OS addresses are handled. - * In cases where the target and pRes have the same - * starting address, reduce the size of the target - * (given it's an estimate). - */ - if (!pow2Alignment) - target->block_begin = pRes->block_end + 1; - else -#endif - if (pRes->block_begin == target->block_begin) - target->block_end = pRes->block_end; - else - continue; - } - } else { - /* Trim target to remove the overlap */ - target->block_end = pRes->block_begin - 1; - } - if (pow2Alignment) { - /* - * Align to a power of two. This requires finding the - * largest power of two that is smaller than the adjusted - * size. - */ - size = target->block_end - target->block_begin + 1; - newsize = 1UL << (sizeof(memType) * 8 - 1); - while (!(newsize & size)) - newsize >>= 1; - target->block_end = target->block_begin + newsize - 1; - } else if (target->block_end > MEM_ALIGN) { - /* Align the end to MEM_ALIGN */ - if ((adjust = (target->block_end + 1) % MEM_ALIGN)) - target->block_end -= adjust; - } - } -} - /* * Resource registration */ diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index c5f5dcce7..c2d5bb7d4 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -140,7 +140,5 @@ BusType StringToBusType(const char* busID, const char **retID); Bool xf86IsSubsetOf(resRange range, resPtr list); resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type); resPtr xf86FindIntersect(resRange Range, resPtr list); -void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment, - Bool useEstimated); #endif /* _XF86_BUS_H */ |