hypercall.S 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* hypercall.S - wrappers for Xen hypercalls */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2013 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <grub/symbol.h>
  20. #include <grub/xen.h>
  21. FUNCTION(grub_xen_hypercall)
  22. pushl %ebp
  23. movl %esp, %ebp
  24. pushl %esi
  25. pushl %edi
  26. pushl %ebx
  27. /* call number already in %eax. */
  28. /* %edx -> %ebx*/
  29. /* %ecx -> %ecx*/
  30. movl %edx, %ebx
  31. movl 8(%ebp), %edx
  32. movl 12(%ebp), %esi
  33. movl 16(%ebp), %edi
  34. movl 20(%ebp), %ebp
  35. int $0x82
  36. popl %ebx
  37. popl %edi
  38. popl %esi
  39. popl %ebp
  40. ret