uh_entry.S 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  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 as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #include <linux/linkage.h>
  16. #include <linux/uh.h>
  17. SYM_CODE_START(uh_call)
  18. entry:
  19. stp x1, x0, [sp, #-16]!
  20. stp x3, x2, [sp, #-16]!
  21. stp x5, x4, [sp, #-16]!
  22. stp x7, x6, [sp, #-16]!
  23. back:
  24. smc #0x0
  25. /* save smc return result to x8 */
  26. mov x8, x0
  27. /* interrupted case does not need x0-x7 be restored */
  28. cmp x8, #0x1
  29. b.eq back
  30. ldp x7, x6, [sp], #16
  31. ldp x5, x4, [sp], #16
  32. ldp x3, x2, [sp], #16
  33. ldp x1, x0, [sp], #16
  34. cmp x8, #0x0
  35. /* busy return case does need x0-x7 be restored */
  36. b.ne entry
  37. ret
  38. SYM_CODE_END(uh_call)