mali_kbase_smc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. *
  3. * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
  4. *
  5. * This program is free software and is provided to you under the terms of the
  6. * GNU General Public License version 2 as published by the Free Software
  7. * Foundation, and any use by you of this program is subject to the terms
  8. * of such GNU licence.
  9. *
  10. * A copy of the licence is included with the program, and can also be obtained
  11. * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  12. * Boston, MA 02110-1301, USA.
  13. *
  14. */
  15. #ifndef _KBASE_SMC_H_
  16. #define _KBASE_SMC_H_
  17. #ifdef CONFIG_ARM64
  18. #include <mali_kbase.h>
  19. #define SMC_FAST_CALL (1 << 31)
  20. #define SMC_64 (1 << 30)
  21. #define SMC_OEN_OFFSET 24
  22. #define SMC_OEN_MASK (0x3F << SMC_OEN_OFFSET) /* 6 bits */
  23. #define SMC_OEN_SIP (2 << SMC_OEN_OFFSET)
  24. #define SMC_OEN_STD (4 << SMC_OEN_OFFSET)
  25. /**
  26. * kbase_invoke_smc_fid - Perform a secure monitor call
  27. * @fid: The SMC function to call, see SMC Calling convention.
  28. * @arg0: First argument to the SMC.
  29. * @arg1: Second argument to the SMC.
  30. * @arg2: Third argument to the SMC.
  31. *
  32. * See SMC Calling Convention for details.
  33. *
  34. * Return: the return value from the SMC.
  35. */
  36. u64 kbase_invoke_smc_fid(u32 fid, u64 arg0, u64 arg1, u64 arg2);
  37. /**
  38. * kbase_invoke_smc_fid - Perform a secure monitor call
  39. * @oen: Owning Entity number (SIP, STD etc).
  40. * @function_number: The function number within the OEN.
  41. * @smc64: use SMC64 calling convention instead of SMC32.
  42. * @arg0: First argument to the SMC.
  43. * @arg1: Second argument to the SMC.
  44. * @arg2: Third argument to the SMC.
  45. *
  46. * See SMC Calling Convention for details.
  47. *
  48. * Return: the return value from the SMC call.
  49. */
  50. u64 kbase_invoke_smc(u32 oen, u16 function_number, bool smc64,
  51. u64 arg0, u64 arg1, u64 arg2);
  52. #endif // ifdef CONFIG_ARM64
  53. #endif // ifndef _KBASE_SMC_H_