summaryrefslogtreecommitdiff
path: root/mit-pthreads/machdep/syscall-sparc-sunos-5.3.S
blob: 822055ad04e9dd6b412c271863e75188747facaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* ==== syscall.S ============================================================
 * Copyright (c) 1994 Chris Provenzano, proven@mit.edu
 * All rights reserved.
 *
 */

#ifndef lint
	.text
	.asciz "$Id$";
#endif
 
#define _ASM
#include <sys/syscall.h>

/*
 * Initial asm stuff for all functions.
 */
	.text
	.align	4

/* ==========================================================================
 * error code for all syscalls. The error value is returned as the negative
 * of the errno value.
 */

1:
	sub		%r0, %o0, %o0
2:
	retl
	nop

/* ==========================================================================
 * machdep_sys_fork()
 */
    .globl machdep_sys_fork;

machdep_sys_fork:;

    mov SYS_fork, %g1;
    ta 0;
    bcs 1b;
    nop;
    tst %o1
    bne,a __fork_parent
    mov  %g0, %o0
__fork_parent:;
    retl
    nop;	/* Added by monty to keep sparc assembler happy */

/* ========================================================================== 
 * Berkeley socket stuff
 * 
 * ==========================================================================
 * machdep_sys_socketcall()
 */
    .globl machdep_sys_socketcall;

machdep_sys_socketcall:;

	mov 83, %g1;   			
	ta 0;							
	bcs,a 2b;						
	sub %r0,%o0,%o0;				
	retl							
	nop;	/* Added by monty to keep sparc assembler happy */