kernel debug: priv can be NULL early on
[minix.git] / lib / libminlib / u64util.c
blobbcddb067f10cbc8999037541ce941d8341dc6a8b
1 /* Few u64 utils implemented in C
2 * Author: Gautam BT
3 */
4 #include <minix/u64.h>
6 u64_t rrotate64(u64_t x, unsigned short b)
8 b %= 64;
9 if ((b &= 63) == 0)
10 return x;
11 return (x >> b) | (x << (64 - b));
14 u64_t rshift64(u64_t x, unsigned short b)
16 if (b >= 64)
17 return 0;
18 return x >> b;
21 u64_t xor64(u64_t a, u64_t b)
23 return a ^ b;
26 u64_t and64(u64_t a, u64_t b)
28 return a & b;
31 u64_t not64(u64_t a)
33 return ~a;