syscall.S 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #define SYSCALL(name,n) \
  41. .globl name ; \
  42. name: ; \
  43. li r0,n ; \
  44. sc ; \
  45. blr
  46. .text
  47. /*
  48. * Make sure these functions are in the same order as they
  49. * appear in the "include/syscall.h" header file !!!
  50. */
  51. SYSCALL(mon_getc,SYSCALL_GETC)
  52. SYSCALL(mon_tstc,SYSCALL_TSTC)
  53. SYSCALL(mon_putc,SYSCALL_PUTC)
  54. SYSCALL(mon_puts,SYSCALL_PUTS)
  55. SYSCALL(mon_printf,SYSCALL_PRINTF)
  56. SYSCALL(mon_install_hdlr,SYSCALL_INSTALL_HDLR)
  57. SYSCALL(mon_free_hdlr,SYSCALL_FREE_HDLR)
  58. SYSCALL(mon_malloc,SYSCALL_MALLOC)
  59. SYSCALL(mon_free,SYSCALL_FREE)
  60. #endif /* CONFIG_ARM XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */