UserlandFS: Make 64 bit clean and enable build for x86_64.

I did not bother to fix the BeOS kernel emulation, so this part is
still left out of the x86_64 build.
This commit is contained in:
Michael Lotz
2015-03-29 16:25:17 +02:00
parent 47ff5824b8
commit ffba66060b
16 changed files with 159 additions and 99 deletions
@@ -303,6 +303,44 @@ struct HashKey64 {
};
// HashKeyPointer
template<typename Value>
struct HashKeyPointer {
HashKeyPointer() {}
HashKeyPointer(const Value& value) : value(value) {}
uint32 GetHashCode() const
{
#if __HAIKU_ARCH_BITS == 32
return (uint32)(addr_t)value;
#elif __HAIKU_ARCH_BITS == 64
uint64 v = (uint64)(addr_t)value;
return (uint32)(v >> 32) ^ (uint32)v;
#else
#error unknown bitness
#endif
}
HashKeyPointer<Value> operator=(const HashKeyPointer<Value>& other)
{
value = other.value;
return *this;
}
bool operator==(const HashKeyPointer<Value>& other) const
{
return (value == other.value);
}
bool operator!=(const HashKeyPointer<Value>& other) const
{
return (value != other.value);
}
Value value;
};
// HashMap
// constructor