Go to the documentation of this file.
17 #include <asm/types.h>
20 #define GOLDEN_RATIO_PRIME_32 0x9e370001UL
22 #define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL
24 #if BITS_PER_LONG == 32
25 #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32
26 #define hash_long(val, bits) hash_32(val, bits)
27 #elif BITS_PER_LONG == 64
28 #define hash_long(val, bits) hash_64(val, bits)
29 #define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64
31 #error Wordsize not 32 or 64
54 return hash >> (64 -
bits);
63 return hash >> (32 -
bits);
66 static inline unsigned long hash_ptr(
const void *
ptr,
unsigned int bits)
68 return hash_long((
unsigned long)ptr, bits);
71 static inline u32 hash32_ptr(
const void *ptr)
73 unsigned long val = (
unsigned long)ptr;
75 #if BITS_PER_LONG == 64