Rev 4342 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4342 | Rev 4691 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | */ |
33 | */ |
34 | 34 | ||
35 | #ifndef LIBC_MACROS_H_ |
35 | #ifndef LIBC_MACROS_H_ |
36 | #define LIBC_MACROS_H_ |
36 | #define LIBC_MACROS_H_ |
37 | 37 | ||
38 | #define SIZE2KB(size) ((size) >> 10) |
38 | #define min(a, b) ((a) < (b) ? (a) : (b)) |
39 | #define SIZE2MB(size) ((size) >> 20) |
39 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
40 | 40 | ||
41 | #define KB2SIZE(kb) ((kb) << 10) |
41 | #define SIZE2KB(size) ((size) >> 10) |
42 | #define MB2SIZE(mb) ((mb) << 20) |
42 | #define SIZE2MB(size) ((size) >> 20) |
43 | 43 | ||
- | 44 | #define KB2SIZE(kb) ((kb) << 10) |
|
- | 45 | #define MB2SIZE(mb) ((mb) << 20) |
|
- | 46 | ||
44 | #define STRING(arg) STRING_ARG(arg) |
47 | #define STRING(arg) STRING_ARG(arg) |
45 | #define STRING_ARG(arg) #arg |
48 | #define STRING_ARG(arg) #arg |
- | 49 | ||
- | 50 | #define LOWER32(arg) ((arg) & 0xffffffff) |
|
- | 51 | #define UPPER32(arg) (((arg) >> 32) & 0xffffffff) |
|
- | 52 | ||
- | 53 | #define MERGE_LOUP32(lo, up) \ |
|
- | 54 | ((((uint64_t) (lo)) & 0xffffffff) \ |
|
- | 55 | | ((((uint64_t) (up)) & 0xffffffff) << 32)) |
|
46 | 56 | ||
47 | #endif |
57 | #endif |
48 | 58 | ||
49 | /** @} |
59 | /** @} |
50 | */ |
60 | */ |