~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to mit-pthreads/machdep/syscall-ip22-irix-5.2.S

  • Committer: bk at mysql
  • Date: 2000-07-31 19:29:14 UTC
  • Revision ID: sp1r-bk@work.mysql.com-20000731192914-08846
Import changeset

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <sys.s>
 
2
#include <sys/regdef.h>
 
3
 
 
4
/*
 
5
        Kernel syscall interface:
 
6
        Input:
 
7
                v0              syscall number
 
8
        Output:
 
9
 
 
10
        This macro is similar to SYSCALL in sys/syscall.h, but not completely.
 
11
        There's room for optimization, if we assume this will continue to
 
12
        be assembled as one file.
 
13
 
 
14
        Compile with -DPIC for pic code.
 
15
*/
 
16
 
 
17
#ifdef PIC
 
18
#define PICOPT  .option pic2
 
19
#else
 
20
#define PICOPT
 
21
#endif
 
22
 
 
23
 
 
24
#define YSYSCALL(x)                                     \
 
25
        PICOPT;                                                         \
 
26
        .globl          machdep_sys_##x;                \
 
27
        .ent            machdep_sys_##x, 0;             \
 
28
machdep_sys_##x:;                                               \
 
29
        .frame  sp,0,ra;                                        \
 
30
        .set    noreorder;                                      \
 
31
        li      v0, SYS_##x;                                    \
 
32
        syscall;                                                        \
 
33
        bne a3, zero, 1b;                                       \
 
34
        nop;                                                            \
 
35
        j ra;                                                           \
 
36
        nop;                                                            \
 
37
        .end            machdep_sys_##x
 
38
 
 
39
/* ==========================================================================
 
40
 * error code for all syscalls. The error value is returned as the negative
 
41
 * of the errno value.
 
42
 */
 
43
 
 
44
1:
 
45
        subu v0,zero,v0;
 
46
        j ra;
 
47
 
 
48
/* ==========================================================================
 
49
 * lstat
 
50
 */
 
51
        PICOPT;                                                 
 
52
        .globl          machdep_sys_lstat;              
 
53
        .ent            machdep_sys_lstat, 0;           
 
54
machdep_sys_lstat:;                                             
 
55
        .frame  sp,0,ra;                                        
 
56
        .set    noreorder;                                      
 
57
        move a2, a1
 
58
        move a1, a0
 
59
        li   a0, 2
 
60
        li      v0, SYS_lxstat;                                 
 
61
        syscall;                                                        
 
62
        bne a3, zero, 1b;                                       
 
63
        nop;                                                            
 
64
        j ra;                                                   
 
65
        nop;                                                            
 
66
        .end            machdep_sys_lstat
 
67
 
 
68
/* ==========================================================================
 
69
 * fstat
 
70
 */
 
71
        PICOPT;                                                 
 
72
        .globl          machdep_sys_fstat;              
 
73
        .ent            machdep_sys_fstat, 0;           
 
74
machdep_sys_fstat:;                                             
 
75
        .frame  sp,0,ra;                                        
 
76
        .set    noreorder;                                      
 
77
        move a2, a1
 
78
        move a1, a0
 
79
        li   a0, 2
 
80
        li      v0, SYS_fxstat;                                 
 
81
        syscall;                                                        
 
82
        bne a3, zero, 1b;                                       
 
83
        nop;                                                            
 
84
        j ra;                                                   
 
85
        nop;                                                            
 
86
        .end            machdep_sys_fstat
 
87
 
 
88
/* ==========================================================================
 
89
 * stat
 
90
 */
 
91
        PICOPT;                                                 
 
92
        .globl          machdep_sys_stat;               
 
93
        .ent            machdep_sys_stat, 0;            
 
94
machdep_sys_stat:;                                              
 
95
        .frame  sp,0,ra;                                        
 
96
        .set    noreorder;                                      
 
97
        move a2, a1
 
98
        move a1, a0
 
99
        li   a0, 2
 
100
        li      v0, SYS_xstat;                                  
 
101
        syscall;                                                        
 
102
        bne a3, zero, 1b;                                       
 
103
        nop;                                                            
 
104
        j ra;                                                   
 
105
        nop;                                                            
 
106
        .end            machdep_sys_stat