AsmGetRegsMips.S 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2017 The Android Open Source Project
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  18. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  19. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  20. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  21. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  22. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  23. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  24. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  25. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  26. * SUCH DAMAGE.
  27. */
  28. .text
  29. .type AsmGetRegs, %function
  30. .globl AsmGetRegs
  31. .ent AsmGetRegs
  32. .balign 16
  33. AsmGetRegs:
  34. .cfi_startproc
  35. .cfi_def_cfa $sp, 0
  36. .set push
  37. .set noreorder
  38. .cpload $t9
  39. sw $zero, 0($a0)
  40. .set noat
  41. sw $at, 4($a0)
  42. .set at
  43. sw $v0, 8($a0)
  44. sw $v1, 12($a0)
  45. sw $a0, 16($a0)
  46. sw $a1, 20($a0)
  47. sw $a2, 24($a0)
  48. sw $a3, 28($a0)
  49. sw $t0, 32($a0)
  50. sw $t1, 36($a0)
  51. sw $t2, 40($a0)
  52. sw $t3, 44($a0)
  53. sw $t4, 48($a0)
  54. sw $t5, 52($a0)
  55. sw $t6, 56($a0)
  56. sw $t7, 60($a0)
  57. sw $s0, 64($a0)
  58. sw $s1, 68($a0)
  59. sw $s2, 72($a0)
  60. sw $s3, 76($a0)
  61. sw $s4, 80($a0)
  62. sw $s5, 84($a0)
  63. sw $s6, 88($a0)
  64. sw $s7, 92($a0)
  65. sw $t8, 96($a0)
  66. sw $t9, 100($a0)
  67. sw $k0, 104($a0)
  68. sw $k1, 108($a0)
  69. sw $gp, 112($a0)
  70. sw $sp, 116($a0)
  71. sw $s8, 120($a0)
  72. sw $ra, 124($a0)
  73. jalr $zero, $ra
  74. sw $ra, 128($a0) // set PC to the calling function
  75. .set pop
  76. .cfi_endproc
  77. .size AsmGetRegs, .-AsmGetRegs
  78. .end AsmGetRegs