VM: munmap used by VM for itself is no longer used
[minix.git] / include / minix / hash.h
blobb4aab0103429f95bf6813ec5628a08c27c02a6a5
2 #ifndef _MINIX_HASH_H
3 #define _MINIX_HASH_H 1
5 #include <stdint.h>
7 /* This code is taken from:
8 * lookup3.c, by Bob Jenkins, May 2006, Public Domain.
9 * (macro names modified)
12 #define hash_rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
14 #define hash_mix(a,b,c) \
15 { \
16 a -= c; a ^= hash_rot(c, 4); c += b; \
17 b -= a; b ^= hash_rot(a, 6); a += c; \
18 c -= b; c ^= hash_rot(b, 8); b += a; \
19 a -= c; a ^= hash_rot(c,16); c += b; \
20 b -= a; b ^= hash_rot(a,19); a += c; \
21 c -= b; c ^= hash_rot(b, 4); b += a; \
24 #define hash_final(a,b,c) \
25 { \
26 c ^= b; c -= hash_rot(b,14); \
27 a ^= c; a -= hash_rot(c,11); \
28 b ^= a; b -= hash_rot(a,25); \
29 c ^= b; c -= hash_rot(b,16); \
30 a ^= c; a -= hash_rot(c,4); \
31 b ^= a; b -= hash_rot(a,14); \
32 c ^= b; c -= hash_rot(b,24); \
35 #define hash_i_64(a, u, v) { \
36 u32_t i1 = (a), i2 = ex64lo(u), i3 = ex64hi(u); \
37 hash_mix(i1, i2, i3); \
38 hash_final(i1, i2, i3); \
39 (v) = i3; \
42 #define hash_32(n, v) { \
43 u32_t i1 = 0xa5a5a5a5, i2 = 0x12345678, i3 = n; \
44 hash_mix(i1, i2, i3); \
45 hash_final(i1, i2, i3); \
46 (v) = i3; \
49 #endif