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
(cherry picked from commit 48a7e53db78293ba2723cecfb3a3d5d23ea8e44d)