Subversion Repositories HelenOS-historic

Rev

Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1702 Rev 1780
Line 44... Line 44...
44
 
44
 
45
#define min(a,b)    ((a)<(b)?(a):(b))
45
#define min(a,b)    ((a)<(b)?(a):(b))
46
#define max(a,b)    ((a)>(b)?(a):(b))
46
#define max(a,b)    ((a)>(b)?(a):(b))
47
 
47
 
48
/** Return true if the interlvals overlap. */
48
/** Return true if the interlvals overlap. */
49
static inline int overlaps(__address s1, size_t sz1, __address s2, size_t sz2)
49
static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2)
50
{
50
{
51
    __address e1 = s1+sz1;
51
    uintptr_t e1 = s1+sz1;
52
    __address e2 = s2+sz2;
52
    uintptr_t e2 = s2+sz2;
53
 
53
 
54
    return s1 < e2 && s2 < e1;
54
    return s1 < e2 && s2 < e1;
55
}
55
}
56
/* Compute overlapping of physical addresses */
56
/* Compute overlapping of physical addresses */
57
#define PA_overlaps(x,szx,y,szy)  overlaps(KA2PA(x),szx,KA2PA(y), szy)
57
#define PA_overlaps(x,szx,y,szy)  overlaps(KA2PA(x),szx,KA2PA(y), szy)