smccc-call.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2015, Linaro Limited
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License Version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #include <linux/linkage.h>
  15. #include <asm/asm-offsets.h>
  16. .macro SMCCC instr
  17. .cfi_startproc
  18. \instr #0
  19. ldr x4, [sp]
  20. stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
  21. stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
  22. ret
  23. .cfi_endproc
  24. .endm
  25. /*
  26. * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
  27. * unsigned long a3, unsigned long a4, unsigned long a5,
  28. * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
  29. */
  30. ENTRY(arm_smccc_smc)
  31. SMCCC smc
  32. ENDPROC(arm_smccc_smc)
  33. /*
  34. * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
  35. * unsigned long a3, unsigned long a4, unsigned long a5,
  36. * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
  37. */
  38. ENTRY(arm_smccc_hvc)
  39. SMCCC hvc
  40. ENDPROC(arm_smccc_hvc)