These macros have substantially identical implementations on each
platform. Use roundup2/rounddown2 for round_page/trunc_page.
This version standardizes on not adding an explicit cast as that
appears to be required on at least one powerpc port. A couple of
tweaks were required to make this work.
Obtained from: CheriBSD