Files
codezero/include/l4/lib/math.h
Bahadir Balban cb561ab262 Removed all references th shared page from libposix
Added UTCB functions for full ipc that copy buffer or string payloads
in secondary message registers.

Some posix syscalls now use these utcb functions to copy pathnames.
2009-10-07 22:59:34 +03:00

23 lines
513 B
C

#ifndef __LIB_MATH_H__
#define __LIB_MATH_H__
#define min(x, y) (((x) < (y)) ? (x) : (y))
#define max(x, y) (((x) > (y)) ? (x) : (y))
/* Tests if ranges a-b intersect with range c-d */
static inline int set_intersection(unsigned long a, unsigned long b,
unsigned long c, unsigned long d)
{
/*
* Below is the complement (') of the intersection
* of 2 ranges, much simpler ;-)
*/
if (b <= c || a >= d)
return 0;
/* The rest is always intersecting */
return 1;
}
#endif /* __LIB_MATH_H__ */