Merge the common parts of the SMCCC handlers
To simplify adding new handlers merge the common parts of the functions
used to call into the arm SMCCC firmware.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36297