WIP: merge in Illumos kmem implementation.