this is cherry-picked from osbmk. the cherry-pick was
performed by i, leah rowe. this is adapted from shmalebx's
patch there, in osboot
specifically, these patches from osbmk are being imported:
327a39ef058d5385bf8c1a1b09bac8db6a51b016
5139ad4be4df1835ce154f39161eef4f7c31ee1a