smccc-call.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 <linux/arm-smccc.h>
  16. #include <asm/asm-offsets.h>
  17. .macro SMCCC instr
  18. .cfi_startproc
  19. \instr #0
  20. ldr x4, [sp]
  21. stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
  22. stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
  23. ldr x4, [sp, #8]
  24. cbz x4, 1f /* no quirk structure */
  25. ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
  26. cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6
  27. b.ne 1f
  28. str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
  29. 1: ret
  30. .cfi_endproc
  31. .endm
  32. /*
  33. * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
  34. * unsigned long a3, unsigned long a4, unsigned long a5,
  35. * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
  36. * struct arm_smccc_quirk *quirk)
  37. */
  38. ENTRY(__arm_smccc_smc)
  39. SMCCC smc
  40. ENDPROC(__arm_smccc_smc)
  41. /*
  42. * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
  43. * unsigned long a3, unsigned long a4, unsigned long a5,
  44. * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
  45. * struct arm_smccc_quirk *quirk)
  46. */
  47. ENTRY(__arm_smccc_hvc)
  48. SMCCC hvc
  49. ENDPROC(__arm_smccc_hvc)