root/arch/sparc/kernel/sunos_asm.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* $Id: sunos_asm.S,v 1.8 1995/11/25 00:58:29 davem 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 
  12 #include <asm/cprefix.h>
  13 #include <asm/ptrace.h>
  14 
  15         /* Note that for dual value returning system calls we
  16          * need to store the second one ourselves in the pt_regs
  17          * trap-frame.  linux_sparc_syscall does %o0 for us
  18          * however.
  19          */
  20 
  21         .text
  22         .align 4
  23 
  24         /* SunOS getpid() returns pid in %o0 and ppid in %o1 */
  25         .globl  C_LABEL(sunos_getpid)
  26 C_LABEL(sunos_getpid):
  27         save    %sp, -STACKFRAME_SZ, %sp
  28         call    C_LABEL(sys_getpid)
  29         nop
  30 
  31         mov     %o0, %i0
  32 
  33         call    C_LABEL(sys_getppid)
  34         nop     
  35 
  36         st      %o0, [%fp + STACKFRAME_SZ + PT_I1]
  37 
  38         ret
  39         restore
  40 
  41         /* SunOS getuid() returns uid in %o0 and euid in %o1 */
  42         .globl  C_LABEL(sunos_getuid)
  43 C_LABEL(sunos_getuid):
  44         save    %sp, -STACKFRAME_SZ, %sp
  45         call    C_LABEL(sys_getuid)
  46         nop
  47 
  48         mov     %o0, %i0
  49 
  50         call    C_LABEL(sys_geteuid)
  51         nop
  52 
  53         st      %o0, [%fp + STACKFRAME_SZ + PT_I1]
  54 
  55         ret
  56         restore
  57 
  58         /* SunOS getgid() returns gid in %o0 and egid in %o1 */
  59         .globl  C_LABEL(sunos_getgid)
  60 C_LABEL(sunos_getgid):
  61         save    %sp, -STACKFRAME_SZ, %sp
  62         call    C_LABEL(sys_getgid)
  63         nop
  64 
  65         mov     %o0, %i0
  66 
  67         call    C_LABEL(sys_getegid)
  68         nop
  69 
  70         st      %o0, [%fp + STACKFRAME_SZ + PT_I1]
  71 
  72         ret
  73         restore
  74 
  75         /* SunOS's execv() call only specifies the argv argument, the
  76          * environment settings are the same as the calling processes.
  77          */
  78         .globl  C_LABEL(sunos_execv)
  79 C_LABEL(sunos_execv):
  80         save    %sp, -STACKFRAME_SZ, %sp
  81 
  82         st      %g0, [%fp + STACKFRAME_SZ + PT_I2]
  83         call    C_LABEL(sparc_execve)
  84         add     %fp, STACKFRAME_SZ, %o0
  85 
  86         st      %o0, [%fp + STACKFRAME_SZ + PT_I1]
  87 
  88         ret
  89         restore
  90 

/* [previous][next][first][last][top][bottom][index][help] */