omap4smc.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*++
  2. Copyright (c) 2013 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. omap4smc.S
  5. Abstract:
  6. This module implements assembly routines necessary for initializing the
  7. OMAP4.
  8. Author:
  9. Chris Stevens 14-Jan-2014
  10. Environment:
  11. Kernel mode
  12. --*/
  13. ##
  14. ## ------------------------------------------------------------------ Includes
  15. ##
  16. #include <minoca/kernel/arm.inc>
  17. ##
  18. ## --------------------------------------------------------------- Definitions
  19. ##
  20. ##
  21. ## ---------------------------------------------------------------------- Code
  22. ##
  23. ASSEMBLY_FILE_HEADER
  24. ##
  25. ## ULONG
  26. ## HlpOmap4SmcCommand (
  27. ## ULONG Argument1,
  28. ## ULONG Argument2,
  29. ## ULONG Command
  30. ## )
  31. ##
  32. /*++
  33. Routine Description:
  34. This routine executes an SMC command up to secure mode. The OMAP4 defines
  35. a software interface for non-secure software to request certain services
  36. using the SMC command.
  37. Arguments:
  38. Argument1 - Supplies the 32-bit value to put into R0. This is dependent on
  39. which command is issued.
  40. Argument2 - Supplies the 32-bit value to put into R1. This is also
  41. dependent on the command issued.
  42. Command - Supplies the SMC command number to issue.
  43. Return Value:
  44. Returns the result as passed back from the SMC command.
  45. --*/
  46. FUNCTION HlpOmap4SmcCommand
  47. stmdb sp!, {%r4-%r12, %lr} @ Save registers.
  48. mov %r12, %r2 @ Move command into place.
  49. DSB @ Data synchronization barrier.
  50. smc #0 @ Execute the SMC instruction.
  51. ldmia sp!, {%r4-%r12, %lr} @ Restore registers.
  52. bx %lr
  53. END_FUNCTION HlpOmap4SmcCommand