2011-09-01 03:18:00 +00:00
|
|
|
const unsigned NAME(BootMask) = (~static_cast<unsigned>(0))
|
2014-07-11 15:50:18 +00:00
|
|
|
/ NAME(BytesPerWord);
|
2011-09-01 03:18:00 +00:00
|
|
|
|
2015-06-23 20:07:48 +00:00
|
|
|
const unsigned NAME(BootShift) UNUSED = 32 - avian::util::log(NAME(BytesPerWord));
|
2011-09-01 03:18:00 +00:00
|
|
|
|
2014-07-11 15:50:18 +00:00
|
|
|
inline unsigned LABEL(codeMapSize)(unsigned codeSize)
|
2011-09-01 03:18:00 +00:00
|
|
|
{
|
2014-07-11 15:50:18 +00:00
|
|
|
return avian::util::ceilingDivide(codeSize, TargetBitsPerWord)
|
|
|
|
* TargetBytesPerWord;
|
2011-09-01 03:18:00 +00:00
|
|
|
}
|
|
|
|
|
2014-07-11 15:50:18 +00:00
|
|
|
inline unsigned LABEL(heapMapSize)(unsigned heapSize)
|
2011-09-01 03:18:00 +00:00
|
|
|
{
|
2014-07-11 15:50:18 +00:00
|
|
|
return avian::util::ceilingDivide(heapSize,
|
|
|
|
TargetBitsPerWord * TargetBytesPerWord)
|
|
|
|
* TargetBytesPerWord;
|
2011-09-01 03:18:00 +00:00
|
|
|
}
|
|
|
|
|
2014-07-11 15:50:18 +00:00
|
|
|
inline object LABEL(bootObject)(LABEL(uintptr_t) * heap, unsigned offset)
|
2011-09-01 03:18:00 +00:00
|
|
|
{
|
|
|
|
if (offset) {
|
|
|
|
return reinterpret_cast<object>(heap + offset - 1);
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|