sim.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #define nabi_no_regargs
  37. #endif /* CONFIG_32BIT */
  38. #ifdef CONFIG_64BIT
  39. #define save_static_function(symbol) \
  40. __asm__( \
  41. ".text\n\t" \
  42. ".globl\t" #symbol "\n\t" \
  43. ".align\t2\n\t" \
  44. ".type\t" #symbol ", @function\n\t" \
  45. ".ent\t" #symbol ", 0\n" \
  46. #symbol":\n\t" \
  47. ".frame\t$29, 0, $31\n\t" \
  48. "sd\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \
  49. "sd\t$17,"__str(PT_R17)"($29)\n\t" \
  50. "sd\t$18,"__str(PT_R18)"($29)\n\t" \
  51. "sd\t$19,"__str(PT_R19)"($29)\n\t" \
  52. "sd\t$20,"__str(PT_R20)"($29)\n\t" \
  53. "sd\t$21,"__str(PT_R21)"($29)\n\t" \
  54. "sd\t$22,"__str(PT_R22)"($29)\n\t" \
  55. "sd\t$23,"__str(PT_R23)"($29)\n\t" \
  56. "sd\t$30,"__str(PT_R30)"($29)\n\t" \
  57. "j\t_" #symbol "\n\t" \
  58. ".end\t" #symbol "\n\t" \
  59. ".size\t" #symbol",. - " #symbol)
  60. #define nabi_no_regargs \
  61. unsigned long __dummy0, \
  62. unsigned long __dummy1, \
  63. unsigned long __dummy2, \
  64. unsigned long __dummy3, \
  65. unsigned long __dummy4, \
  66. unsigned long __dummy5, \
  67. unsigned long __dummy6, \
  68. unsigned long __dummy7,
  69. #endif /* CONFIG_64BIT */
  70. #endif /* _ASM_SIM_H */