syscall.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #include <ppc_asm.tmpl>
  2. #include <ppc_defs.h>
  3. #include <syscall.h>
  4. #ifdef CONFIG_ARM /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
  5. #warning ARM version not implemented yet /* XXXXXXXXXXXXXXXXXXXXXXXXXXXX */
  6. .global mon_getc
  7. .type mon_getc,function
  8. mon_getc:
  9. .global mon_tstc
  10. .type mon_tstc,function
  11. mon_tstc:
  12. .global mon_putc
  13. .type mon_putc,function
  14. mon_putc:
  15. .global mon_puts
  16. .type mon_puts,function
  17. mon_puts:
  18. .global mon_printf
  19. .type mon_printf,function
  20. mon_printf:
  21. .global mon_install_hdlr
  22. .type mon_install_hdlr,function
  23. mon_install_hdlr:
  24. .global mon_free_hdlr
  25. .type mon_free_hdlr,function
  26. mon_free_hdlr:
  27. .global mon_malloc
  28. .type mon_malloc,function
  29. mon_malloc:
  30. .global mon_free
  31. .type mon_free,function
  32. mon_free:
  33. @ args = 0, pretend = 0, frame = 0
  34. @ frame_needed = 1, current_function_anonymous_args = 0
  35. mov ip, sp
  36. stmfd sp!, {fp, ip, lr, pc}
  37. sub fp, ip, #4
  38. ldmea fp, {fp, sp, pc}
  39. #else /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
  40. #ifdef CONFIG_I386 /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
  41. #define SYMBOL_NAME(X) X
  42. #define SYMBOL_NAME_LABEL(X) X##:
  43. #define SYSCALL(name,n) \
  44. .globl SYMBOL_NAME(name) ; \
  45. SYMBOL_NAME_LABEL(name) ; \
  46. ret
  47. #endif /* CONFIG_I386 */
  48. #ifdef CONFIG_PPC
  49. #define SYSCALL(name,n) \
  50. .globl name ; \
  51. name: ; \
  52. li r0,n ; \
  53. sc ; \
  54. blr
  55. #endif /* CONFIG_PPC */
  56. .text
  57. /*
  58. * Make sure these functions are in the same order as they
  59. * appear in the "include/syscall.h" header file !!!
  60. */
  61. SYSCALL(mon_getc,SYSCALL_GETC)
  62. SYSCALL(mon_tstc,SYSCALL_TSTC)
  63. SYSCALL(mon_putc,SYSCALL_PUTC)
  64. SYSCALL(mon_puts,SYSCALL_PUTS)
  65. SYSCALL(mon_printf,SYSCALL_PRINTF)
  66. SYSCALL(mon_install_hdlr,SYSCALL_INSTALL_HDLR)
  67. SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
  68. SYSCALL(mon_malloc,SYSCALL_MALLOC)
  69. SYSCALL(mon_free,SYSCALL_FREE)
  70. #endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */