Adapted from patch by: David Cornejo <dcornejo@firetide.com> Reviewed by: freebsd-sparc64 (harti) Approved by: rwatson (mentor)