Changeset e2650d3 in mainline for kernel/generic/include/macros.h


Ignore:
Timestamp:
2010-07-20T13:53:36Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4738d84
Parents:
4d0f97d
Message:

rename PA_overlaps to PA_OVERLAPS
be more tolerant about some cases of overlapping zones (when it is actually not an issue)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/macros.h

    r4d0f97d re2650d3  
    4747 * @param s2  Start address of the second interval.
    4848 * @param sz2 Size of the second interval.
     49 *
    4950 */
    5051NO_TRACE static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2,
     
    5556       
    5657        return ((s1 < e2) && (s2 < e1));
     58}
     59
     60/** Return true if the second interval is within the first interval.
     61 *
     62 * @param s1  Start address of the first interval.
     63 * @param sz1 Size of the first interval.
     64 * @param s2  Start address of the second interval.
     65 * @param sz2 Size of the second interval.
     66 *
     67 */
     68NO_TRACE static inline int iswithin(uintptr_t s1, size_t sz1, uintptr_t s2,
     69    size_t sz2)
     70{
     71        uintptr_t e1 = s1 + sz1;
     72        uintptr_t e2 = s2 + sz2;
     73       
     74        return ((s1 <= s2) && (e1 >= e2));
    5775}
    5876
     
    7492
    7593/* Compute overlapping of physical addresses */
    76 #define PA_overlaps(x, szx, y, szy) \
     94#define PA_OVERLAPS(x, szx, y, szy) \
    7795        overlaps(KA2PA((x)), (szx), KA2PA((y)), (szy))
    7896
Note: See TracChangeset for help on using the changeset viewer.