corda/src/bootimage-template.cpp
Joel Dice e505cbe99d more progress towards cross-architecture bootimage builds
This commit fixes a lot of bugs.  All tests are now pass for Linux
x86_64 to Linux i386 cross builds.
2011-08-31 21:18:00 -06:00

31 lines
735 B
C++

const unsigned NAME(BootMask) = (~static_cast<unsigned>(0))
/ NAME(BytesPerWord);
const unsigned NAME(BootShift) = 32 - log(NAME(BytesPerWord));
const unsigned NAME(BootFlatConstant) = 1 << NAME(BootShift);
const unsigned NAME(BootHeapOffset) = 1 << (NAME(BootShift) + 1);
inline unsigned
LABEL(codeMapSize)(unsigned codeSize)
{
return ceiling(codeSize, TargetBitsPerWord) * TargetBytesPerWord;
}
inline unsigned
LABEL(heapMapSize)(unsigned heapSize)
{
return ceiling(heapSize, TargetBitsPerWord * TargetBytesPerWord)
* TargetBytesPerWord;
}
inline object
LABEL(bootObject)(LABEL(uintptr_t)* heap, unsigned offset)
{
if (offset) {
return reinterpret_cast<object>(heap + offset - 1);
} else {
return 0;
}
}