smccc.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-09-09 GuEe-GUI The first version
  9. */
  10. #include <stdint.h>
  11. /*
  12. * The ARM SMCCC v1.0 calling convention provides the following guarantees about registers:
  13. * Register Modified Return State
  14. * X0...X3 Yes Result values
  15. * X4...X17 Yes Unpredictable
  16. * X18...X30 No Preserved
  17. * SP_EL0 No Preserved
  18. * SP_ELx No Preserved
  19. */
  20. struct arm_smccc_ret
  21. {
  22. uint64_t x0; /* Parameter registers */
  23. uint64_t x1; /* Parameter registers */
  24. uint64_t x2; /* Parameter registers */
  25. uint64_t x3; /* Parameter registers */
  26. uint64_t x6; /* Parameter register: Optional Session ID register */
  27. };
  28. struct arm_smccc_ret arm_smc_call(uint32_t w0, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6, uint32_t w7);
  29. struct arm_smccc_ret arm_hvc_call(uint32_t w0, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6, uint32_t w7);