sim.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 1999, 2000, 2003 Ralf Baechle
  7. * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  8. */
  9. #ifndef _ASM_SIM_H
  10. #define _ASM_SIM_H
  11. #include <asm/asm-offsets.h>
  12. #define __str2(x) #x
  13. #define __str(x) __str2(x)
  14. #ifdef CONFIG_32BIT
  15. #define save_static_function(symbol) \
  16. __asm__( \
  17. ".text\n\t" \
  18. ".globl\t__" #symbol "\n\t" \
  19. ".align\t2\n\t" \
  20. ".type\t__" #symbol ", @function\n\t" \
  21. ".ent\t__" #symbol ", 0\n__" \
  22. #symbol":\n\t" \
  23. ".frame\t$29, 0, $31\n\t" \
  24. "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
  25. "sw\t$17,"__str(PT_R17)"($29)\n\t" \
  26. "sw\t$18,"__str(PT_R18)"($29)\n\t" \
  27. "sw\t$19,"__str(PT_R19)"($29)\n\t" \
  28. "sw\t$20,"__str(PT_R20)"($29)\n\t" \
  29. "sw\t$21,"__str(PT_R21)"($29)\n\t" \
  30. "sw\t$22,"__str(PT_R22)"($29)\n\t" \
  31. "sw\t$23,"__str(PT_R23)"($29)\n\t" \
  32. "sw\t$30,"__str(PT_R30)"($29)\n\t" \
  33. "j\t" #symbol "\n\t" \
  34. ".end\t__" #symbol "\n\t" \
  35. ".size\t__" #symbol",. - __" #symbol)
  36. #endif /* CONFIG_32BIT */
  37. #ifdef CONFIG_64BIT
  38. #define save_static_function(symbol) \
  39. __asm__( \
  40. ".text\n\t" \
  41. ".globl\t__" #symbol "\n\t" \
  42. ".align\t2\n\t" \
  43. ".type\t__" #symbol ", @function\n\t" \
  44. ".ent\t__" #symbol ", 0\n__" \
  45. #symbol":\n\t" \
  46. ".frame\t$29, 0, $31\n\t" \
  47. "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
  48. "sd\t$17,"__str(PT_R17)"($29)\n\t" \
  49. "sd\t$18,"__str(PT_R18)"($29)\n\t" \
  50. "sd\t$19,"__str(PT_R19)"($29)\n\t" \
  51. "sd\t$20,"__str(PT_R20)"($29)\n\t" \
  52. "sd\t$21,"__str(PT_R21)"($29)\n\t" \
  53. "sd\t$22,"__str(PT_R22)"($29)\n\t" \
  54. "sd\t$23,"__str(PT_R23)"($29)\n\t" \
  55. "sd\t$30,"__str(PT_R30)"($29)\n\t" \
  56. "j\t" #symbol "\n\t" \
  57. ".end\t__" #symbol "\n\t" \
  58. ".size\t__" #symbol",. - __" #symbol)
  59. #endif /* CONFIG_64BIT */
  60. #endif /* _ASM_SIM_H */