uh_entry.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 "uh.h"
  17. #if defined(CONFIG_ARCH_QCOM)
  18. SYM_CODE_START(uh_call)
  19. entry:
  20. stp x1, x0, [sp, #-16]!
  21. stp x3, x2, [sp, #-16]!
  22. stp x5, x4, [sp, #-16]!
  23. stp x7, x6, [sp, #-16]!
  24. back:
  25. smc #0x0
  26. /* save smc return result to x8 */
  27. mov x8, x0
  28. /* interrupted case does not need x0-x7 be restored */
  29. cmp x8, #0x1
  30. b.eq back
  31. ldp x7, x6, [sp], #16
  32. ldp x5, x4, [sp], #16
  33. ldp x3, x2, [sp], #16
  34. ldp x1, x0, [sp], #16
  35. cmp x8, #0x0
  36. /* busy return case does need x0-x7 be restored */
  37. b.ne entry
  38. ret
  39. SYM_CODE_END(uh_call)
  40. #endif