Checking for LP64 is non-portable as it assumes that ILP32 and LP64
are the only two ABIs that exist, but CheriBSD supports an additional
ABI where long is still 64-bit but pointers are 128-bit capabilities,
and thus LP64 is not defined. We could change this to check the
value of SIZEOF_LONG, since the code here only cares about that
aspect of the ABI, however in this instance, the only real reason an
ifdef is used at all is to be able to get log2(sizeof(u_long)), but if
we instead multiply and divide rather than shift, and let the compiler
optimise that to a shift, we can just use sizeof(u_long) instead. Note
also that VMBUS_EVTFLAGS_MAX could always just have been defined as
VMBUS_EVTFLAGS_SIZE / sizeof(u_long).
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable