Subversion Repositories Kolibri OS

Rev

Rev 3747 | Rev 4110 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3747 Rev 4103
Line 47... Line 47...
47
        (((x) + (__y - 1)) / __y) * __y;                \
47
        (((x) + (__y - 1)) / __y) * __y;                \
48
}                                                       \
48
}                                                       \
49
)
49
)
Line 50... Line 50...
50
 
50
 
-
 
51
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-
 
52
#define DIV_ROUND_UP_ULL(ll,d) \
51
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
53
        ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
52
#define DIV_ROUND_CLOSEST(x, divisor)(                  \
54
#define DIV_ROUND_CLOSEST(x, divisor)(                  \
53
{                                                       \
55
{                                                       \
54
         typeof(divisor) __divisor = divisor;            \
56
         typeof(divisor) __divisor = divisor;            \
55
         (((x) + ((__divisor) / 2)) / (__divisor));      \
57
         (((x) + ((__divisor) / 2)) / (__divisor));      \
56
}                                                       \
58
}                                                       \
Line -... Line 59...
-
 
59
)
-
 
60
 
-
 
61
 
-
 
62
#define clamp_t(type, val, min, max) ({         \
-
 
63
        type __val = (val);                     \
-
 
64
        type __min = (min);                     \
-
 
65
        type __max = (max);                     \
-
 
66
        __val = __val < __min ? __min: __val;   \
-
 
67
        __val > __max ? __max: __val; })
-
 
68
 
57
)
69
 
58
 
70
 
59
/**
71
/**
60
 * upper_32_bits - return bits 32-63 of a number
72
 * upper_32_bits - return bits 32-63 of a number
61
 * @n: the number we're accessing
73
 * @n: the number we're accessing
Line 251... Line 263...
251
 
263
 
Line 252... Line 264...
252
#define in_dbg_master() (0)
264
#define in_dbg_master() (0)
Line 253... Line -...
253
 
-
 
254
#define HZ 100
-
 
255
 
-
 
256
#define time_after(a,b)         \
-
 
257
        (typecheck(unsigned long, a) && \
-
 
258
        typecheck(unsigned long, b) && \
265
 
Line 259... Line 266...
259
        ((long)(b) - (long)(a) < 0))
266
#define HZ 100
260
 
267
 
261
struct tvec_base;
268
struct tvec_base;