interrupts.S 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (C) 2012 - Virtual Open Systems and Columbia University
  3. * Author: Christoffer Dall <c.dall@virtualopensystems.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License, version 2, as
  7. * published by the Free Software Foundation.
  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. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #include <linux/linkage.h>
  19. .text
  20. /********************************************************************
  21. * Call function in Hyp mode
  22. *
  23. *
  24. * unsigned long kvm_call_hyp(void *hypfn, ...);
  25. *
  26. * This is not really a variadic function in the classic C-way and care must
  27. * be taken when calling this to ensure parameters are passed in registers
  28. * only, since the stack will change between the caller and the callee.
  29. *
  30. * Call the function with the first argument containing a pointer to the
  31. * function you wish to call in Hyp mode, and subsequent arguments will be
  32. * passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the
  33. * function pointer can be passed). The function being called must be mapped
  34. * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
  35. * passed in r0 (strictly 32bit).
  36. *
  37. * A function pointer with a value of 0xffffffff has a special meaning,
  38. * and is used to implement __hyp_get_vectors in the same way as in
  39. * arch/arm/kernel/hyp_stub.S.
  40. *
  41. * The calling convention follows the standard AAPCS:
  42. * r0 - r3: caller save
  43. * r12: caller save
  44. * rest: callee save
  45. */
  46. ENTRY(kvm_call_hyp)
  47. hvc #0
  48. bx lr
  49. ENDPROC(kvm_call_hyp)