sunos_asm.S 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* $Id: sunos_asm.S,v 1.15 2000/01/11 17:33:21 jj Exp $
  2. * sunos_asm.S: SunOS system calls which must have a low-level
  3. * entry point to operate correctly.
  4. *
  5. * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  6. *
  7. * Based upon preliminary work which is:
  8. *
  9. * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
  10. */
  11. #include <asm/ptrace.h>
  12. .text
  13. .align 4
  14. /* When calling ret_sys_call, %o0 should contain the same
  15. * value as in [%sp + STACKFRAME_SZ + PT_I0] */
  16. /* SunOS getpid() returns pid in %o0 and ppid in %o1 */
  17. .globl sunos_getpid
  18. sunos_getpid:
  19. call sys_getppid
  20. nop
  21. call sys_getpid
  22. st %o0, [%sp + STACKFRAME_SZ + PT_I1]
  23. b ret_sys_call
  24. st %o0, [%sp + STACKFRAME_SZ + PT_I0]
  25. /* SunOS getuid() returns uid in %o0 and euid in %o1 */
  26. .globl sunos_getuid
  27. sunos_getuid:
  28. call sys_geteuid16
  29. nop
  30. call sys_getuid16
  31. st %o0, [%sp + STACKFRAME_SZ + PT_I1]
  32. b ret_sys_call
  33. st %o0, [%sp + STACKFRAME_SZ + PT_I0]
  34. /* SunOS getgid() returns gid in %o0 and egid in %o1 */
  35. .globl sunos_getgid
  36. sunos_getgid:
  37. call sys_getegid16
  38. nop
  39. call sys_getgid16
  40. st %o0, [%sp + STACKFRAME_SZ + PT_I1]
  41. b ret_sys_call
  42. st %o0, [%sp + STACKFRAME_SZ + PT_I0]
  43. /* SunOS's execv() call only specifies the argv argument, the
  44. * environment settings are the same as the calling processes.
  45. */
  46. .globl sunos_execv
  47. sunos_execv:
  48. st %g0, [%sp + STACKFRAME_SZ + PT_I2]
  49. call sparc_execve
  50. add %sp, STACKFRAME_SZ, %o0
  51. b ret_sys_call
  52. ld [%sp + STACKFRAME_SZ + PT_I0], %o0