setjmp.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2004,2007 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include <grub/symbol.h>
  19. #include <grub/dl.h>
  20. .file "setjmp.S"
  21. GRUB_MOD_LICENSE "GPLv3+"
  22. .text
  23. /*
  24. * int grub_setjmp (grub_jmp_buf env)
  25. */
  26. FUNCTION(grub_setjmp)
  27. stw 1, 0(3)
  28. stw 14, 4(3)
  29. stw 15, 8(3)
  30. stw 16, 12(3)
  31. stw 17, 16(3)
  32. stw 18, 20(3)
  33. stw 19, 24(3)
  34. stw 20, 28(3)
  35. stw 21, 32(3)
  36. stw 22, 36(3)
  37. stw 23, 40(3)
  38. stw 24, 44(3)
  39. stw 25, 48(3)
  40. stw 26, 52(3)
  41. stw 27, 56(3)
  42. stw 28, 60(3)
  43. stw 29, 64(3)
  44. stw 30, 68(3)
  45. stw 31, 72(3)
  46. mflr 4
  47. stw 4, 76(3)
  48. mfcr 4
  49. stw 4, 80(3)
  50. li 3, 0
  51. blr
  52. /*
  53. * int grub_longjmp (grub_jmp_buf env, int val)
  54. */
  55. FUNCTION(grub_longjmp)
  56. lwz 1, 0(3)
  57. lwz 14, 4(3)
  58. lwz 15, 8(3)
  59. lwz 16, 12(3)
  60. lwz 17, 16(3)
  61. lwz 18, 20(3)
  62. lwz 19, 24(3)
  63. lwz 20, 28(3)
  64. lwz 21, 32(3)
  65. lwz 22, 36(3)
  66. lwz 23, 40(3)
  67. lwz 24, 44(3)
  68. lwz 25, 48(3)
  69. lwz 26, 52(3)
  70. lwz 27, 56(3)
  71. lwz 28, 60(3)
  72. lwz 29, 64(3)
  73. lwz 30, 68(3)
  74. lwz 31, 72(3)
  75. lwz 5, 76(3)
  76. mtlr 5
  77. lwz 5, 80(3)
  78. mtcr 5
  79. mr. 3, 4
  80. bne 1f
  81. li 3, 1
  82. 1: blr