/kernel/trunk/generic/include/macros.h/macros.h |
---|
39,4 → 39,15 |
#define min(a,b) ((a)<(b)?(a):(b)) |
#define max(a,b) ((a)>(b)?(a):(b)) |
/* Return true if the interlvals overlap */ |
static inline int overlaps(__address s1,size_t sz1, __address s2, size_t sz2) |
{ |
__address e1 = s1+sz1; |
__address e2 = s2+sz2; |
return s1 < e2 && s2 < e1; |
} |
/* Compute overlapping of physical addresses */ |
#define PA_overlaps(x,szx,y,szy) overlaps(KA2PA(x),szx,KA2PA(y), szy) |
#endif |