OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [mips64/] [kernel/] [scall_n32.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * This file is subject to the terms and conditions of the GNU General Public
3
 * License.  See the file "COPYING" in the main directory of this archive
4
 * for more details.
5
 *
6
 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 01 by Ralf Baechle
7
 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8
 * Copyright (C) 2001 MIPS Technologies, Inc.
9
 */
10
#include 
11
#include 
12
#include 
13
#include 
14
#include 
15
#include 
16
#include 
17
#include 
18
 
19
/* This duplicates the definition from  */
20
#define PT_TRACESYS     0x00000002      /* tracing system calls */
21
 
22
/* This duplicates the definition from  */
23
#define SIGILL          4               /* Illegal instruction (ANSI).  */
24
 
25
#ifndef CONFIG_MIPS32_O32
26
/* No O32, so define handle_sys here */
27
#define handle_sysn32 handle_sys
28
#endif
29
 
30
        .align  5
31
NESTED(handle_sysn32, PT_SIZE, sp)
32
#ifndef CONFIG_MIPS32_O32
33
        .set    noat
34
        SAVE_SOME
35
        STI
36
        .set    at
37
#endif
38
        ld      t1, PT_EPC(sp)          # skip syscall on return
39
 
40
        subu    t0, v0, __NR_N32_Linux  # check syscall number
41
        sltiu   t0, t0, __NR_N32_Linux_syscalls + 1
42
        daddiu  t1, 4                   # skip to next instruction
43
        beqz    t0, not_n32_scall
44
        sd      t1, PT_EPC(sp)
45
 
46
        dsll    t0, v0, 3               # offset into table
47
        ld      t2, (sysn32_call_table - (__NR_N32_Linux * 8))(t0)
48
 
49
        sd      a3, PT_R26(sp)          # save a3 for syscall restarting
50
 
51
        ld      t0, TASK_PTRACE($28)    # syscall tracing enabled?
52
        andi    t0, PT_TRACESYS
53
        bnez    t0, trace_a_syscall
54
 
55
        jalr    t2                      # Do The Real Thing (TM)
56
 
57
        li      t0, -EMAXERRNO - 1      # error?
58
        sltu    t0, t0, v0
59
        sd      t0, PT_R7(sp)           # set error flag
60
        beqz    t0, 1f
61
 
62
        negu    v0                      # error
63
        sd      v0, PT_R0(sp)           # set flag for syscall restarting
64
1:      sd      v0, PT_R2(sp)           # result
65
 
66
ret_from_sys_call:
67
        mfc0    t0, CP0_STATUS
68
        xori    t0, t0, 1
69
        ori     t0, t0, 1
70
        mtc0    t0, CP0_STATUS
71
 
72
        ld      t2, TASK_NEED_RESCHED($28)
73
        bnez    t2, n32_reschedule
74
        lw      v0, TASK_SIGPENDING($28)
75
        bnez    v0, signal_return
76
 
77
restore_all:
78
        RESTORE_SOME
79
        RESTORE_SP
80
        eret
81
 
82
/* Put this behind restore_all for the sake of the branch prediction.  */
83
signal_return:
84
        .type   signal_return, @function
85
 
86
        mfc0    t0, CP0_STATUS
87
        ori     t0, t0, 1
88
        mtc0    t0, CP0_STATUS
89
 
90
        SAVE_STATIC
91
        move    a0, zero
92
        move    a1, sp
93
        jal     do_signal
94
        RESTORE_STATIC
95
        b       restore_all
96
 
97
n32_reschedule:
98
        SAVE_STATIC
99
        jal     schedule
100
        b       ret_from_sys_call
101
 
102
/* ------------------------------------------------------------------------ */
103
 
104
trace_a_syscall:
105
        SAVE_STATIC
106
        sd      t2,PT_R1(sp)
107
        jal     syscall_trace
108
        ld      t2,PT_R1(sp)
109
 
110
        ld      a0, PT_R4(sp)           # Restore argument registers
111
        ld      a1, PT_R5(sp)
112
        ld      a2, PT_R6(sp)
113
        ld      a3, PT_R7(sp)
114
        jalr    t2
115
 
116
        li      t0, -EMAXERRNO - 1      # error?
117
        sltu    t0, t0, v0
118
        sd      t0, PT_R7(sp)           # set error flag
119
        beqz    t0, 1f
120
 
121
        negu    v0                      # error
122
        sd      v0, PT_R0(sp)           # set flag for syscall restarting
123
1:      sd      v0, PT_R2(sp)           # result
124
 
125
        jal     syscall_trace
126
        j       ret_from_sys_call
127
 
128
not_n32_scall:
129
        /* This is not an n32 compatibility syscall, pass it on to
130
           the n64 syscall handlers.  */
131
        j       handle_sys64
132
 
133
        END(handle_sysn32)
134
 
135
EXPORT(sysn32_call_table)
136
        PTR     sys_read                        /* 6000 */
137
        PTR     sys_write
138
        PTR     sys_open
139
        PTR     sys_close
140
        PTR     sys_newstat
141
        PTR     sys_newfstat                    /* 6005 */
142
        PTR     sys_newlstat
143
        PTR     sys_poll
144
        PTR     sys_lseek
145
        PTR     sys_mmap
146
        PTR     sys_mprotect                    /* 6010 */
147
        PTR     sys_munmap
148
        PTR     sys_brk
149
        PTR     sys32_rt_sigaction
150
        PTR     sys32_rt_sigprocmask
151
        PTR     sys32_ioctl                     /* 6015 */
152
        PTR     sys_pread
153
        PTR     sys_pwrite
154
        PTR     sys32_readv
155
        PTR     sys32_writev
156
        PTR     sys_access                      /* 6020 */
157
        PTR     sys_pipe
158
        PTR     sys32_select
159
        PTR     sys_sched_yield
160
        PTR     sys_mremap
161
        PTR     sys_msync                       /* 6025 */
162
        PTR     sys_mincore
163
        PTR     sys_madvise
164
        PTR     sys_shmget
165
        PTR     sys_shmat
166
        PTR     sys_shmctl                      /* 6030 */
167
        PTR     sys_dup
168
        PTR     sys_dup2
169
        PTR     sys_pause
170
        PTR     sys32_nanosleep
171
        PTR     sys32_getitimer                 /* 6035 */
172
        PTR     sys32_setitimer
173
        PTR     sys_alarm
174
        PTR     sys_getpid
175
        PTR     sys32_sendfile
176
        PTR     sys_socket                      /* 6040 */
177
        PTR     sys_connect
178
        PTR     sys_accept
179
        PTR     sys_sendto
180
        PTR     sys_recvfrom
181
        PTR     sys32_sendmsg                   /* 6045 */
182
        PTR     sys32_recvmsg
183
        PTR     sys_shutdown
184
        PTR     sys_bind
185
        PTR     sys_listen
186
        PTR     sys_getsockname                 /* 6050 */
187
        PTR     sys_getpeername
188
        PTR     sys_socketpair
189
        PTR     sys32_setsockopt
190
        PTR     sys_getsockopt
191
        PTR     sys_clone                       /* 6055 */
192
        PTR     sys_fork
193
        PTR     sys32_execve
194
        PTR     sys_exit
195
        PTR     sys32_wait4
196
        PTR     sys_kill                        /* 6060 */
197
        PTR     sys32_newuname
198
        PTR     sys_semget
199
        PTR     sys_semop
200
        PTR     sys_semctl
201
        PTR     sys_shmdt                       /* 6065 */
202
        PTR     sys_msgget
203
        PTR     sys_msgsnd
204
        PTR     sys_msgrcv
205
        PTR     sys_msgctl
206
        PTR     sys32_fcntl                     /* 6070 */
207
        PTR     sys_flock
208
        PTR     sys_fsync
209
        PTR     sys_fdatasync
210
        PTR     sys_truncate
211
        PTR     sys_ftruncate                   /* 6075 */
212
        PTR     sys32_getdents
213
        PTR     sys_getcwd
214
        PTR     sys_chdir
215
        PTR     sys_fchdir
216
        PTR     sys_rename                      /* 6080 */
217
        PTR     sys_mkdir
218
        PTR     sys_rmdir
219
        PTR     sys_creat
220
        PTR     sys_link
221
        PTR     sys_unlink                      /* 6085 */
222
        PTR     sys_symlink
223
        PTR     sys_readlink
224
        PTR     sys_chmod
225
        PTR     sys_fchmod
226
        PTR     sys_chown                       /* 6090 */
227
        PTR     sys_fchown
228
        PTR     sys_lchown
229
        PTR     sys_umask
230
        PTR     sys32_gettimeofday
231
        PTR     sys32_getrlimit                 /* 6095 */
232
        PTR     sys32_getrusage
233
        PTR     sys32_sysinfo
234
        PTR     sys32_times
235
        PTR     sys_ptrace
236
        PTR     sys_getuid                      /* 6100 */
237
        PTR     sys_syslog
238
        PTR     sys_getgid
239
        PTR     sys_setuid
240
        PTR     sys_setgid
241
        PTR     sys_geteuid                     /* 6105 */
242
        PTR     sys_getegid
243
        PTR     sys_setpgid
244
        PTR     sys_getppid
245
        PTR     sys_getpgrp
246
        PTR     sys_setsid                      /* 6110 */
247
        PTR     sys_setreuid
248
        PTR     sys_setregid
249
        PTR     sys_getgroups
250
        PTR     sys_setgroups
251
        PTR     sys_setresuid                   /* 6115 */
252
        PTR     sys_getresuid
253
        PTR     sys_setresgid
254
        PTR     sys_getresgid
255
        PTR     sys_getpgid
256
        PTR     sys_setfsuid                    /* 6120 */
257
        PTR     sys_setfsgid
258
        PTR     sys_getsid
259
        PTR     sys_capget
260
        PTR     sys_capset
261
        PTR     sys32_rt_sigpending             /* 6125 */
262
        PTR     sys32_rt_sigtimedwait
263
        PTR     sys32_rt_sigqueueinfo
264
        PTR     sys32_rt_sigsuspend
265
        PTR     sys32_sigaltstack
266
        PTR     sys32_utime                     /* 6130 */
267
        PTR     sys_mknod
268
        PTR     sys32_personality
269
        PTR     sys_ustat
270
        PTR     sys32_statfs
271
        PTR     sys32_fstatfs                   /* 6135 */
272
        PTR     sys_sysfs
273
        PTR     sys_getpriority
274
        PTR     sys_setpriority
275
        PTR     sys_sched_setparam
276
        PTR     sys_sched_getparam              /* 6140 */
277
        PTR     sys_sched_setscheduler
278
        PTR     sys_sched_getscheduler
279
        PTR     sys_sched_get_priority_max
280
        PTR     sys_sched_get_priority_min
281
        PTR     sys32_sched_rr_get_interval     /* 6145 */
282
        PTR     sys_mlock
283
        PTR     sys_munlock
284
        PTR     sys_mlockall
285
        PTR     sys_munlockall
286
        PTR     sys_vhangup                     /* 6150 */
287
        PTR     sys_pivot_root
288
        PTR     sys32_sysctl
289
        PTR     sys_prctl
290
        PTR     sys32_adjtimex
291
        PTR     sys32_setrlimit                 /* 6155 */
292
        PTR     sys_chroot
293
        PTR     sys_sync
294
        PTR     sys_acct
295
        PTR     sys32_settimeofday
296
        PTR     sys_mount                       /* 6160 */
297
        PTR     sys_umount
298
        PTR     sys_swapon
299
        PTR     sys_swapoff
300
        PTR     sys_reboot
301
        PTR     sys_sethostname                 /* 6165 */
302
        PTR     sys_setdomainname
303
        PTR     sys_create_module
304
        PTR     sys_init_module
305
        PTR     sys_delete_module
306
        PTR     sys_get_kernel_syms             /* 6170 */
307
        PTR     sys_query_module
308
        PTR     sys_quotactl
309
        PTR     sys_nfsservctl
310
        PTR     sys_ni_syscall                  /* res. for getpmsg */
311
        PTR     sys_ni_syscall                  /* 6175  for putpmsg */
312
        PTR     sys_ni_syscall                  /* res. for afs_syscall */
313
        PTR     sys_ni_syscall                  /* res. for security */
314
        PTR     sys_gettid
315
        PTR     sys32_readahead
316
        PTR     sys_setxattr                    /* 6180 */
317
        PTR     sys_lsetxattr
318
        PTR     sys_fsetxattr
319
        PTR     sys_getxattr
320
        PTR     sys_lgetxattr
321
        PTR     sys_fgetxattr                   /* 6185 */
322
        PTR     sys_listxattr
323
        PTR     sys_llistxattr
324
        PTR     sys_flistxattr
325
        PTR     sys_removexattr
326
        PTR     sys_lremovexattr                /* 6190 */
327
        PTR     sys_fremovexattr
328
        PTR     sys_tkill
329
        PTR     sys_ni_syscall
330
        PTR     sys_ni_syscall                  /* res. for futex */
331
        PTR     sys_ni_syscall                  /* 6195 rs. sched_setaffinity */
332
        PTR     sys_ni_syscall                  /* res. f. sched_getaffinity */
333
        PTR     sys_cacheflush
334
        PTR     sys_cachectl
335
        PTR     sys_sysmips
336
        PTR     sys_ni_syscall                  /* 6200 */
337
        PTR     sys_ni_syscall
338
        PTR     sys_ni_syscall
339
        PTR     sys_ni_syscall
340
        PTR     sys_ni_syscall
341
        PTR     sys_ni_syscall                  /* 6205 */
342
        PTR     sys_ni_syscall
343
        PTR     sys_ni_syscall
344
        PTR     sys_ni_syscall
345
        PTR     sys_ni_syscall
346
        PTR     sys_ni_syscall                  /* 6210 */
347
        PTR     sysn32_rt_sigreturn
348
        PTR     sys_fcntl
349
        PTR     sys_ni_syscall
350
        PTR     sys_ni_syscall
351
        PTR     sys_semtimedop                  /* 6215 */
352
        PTR     sys_ni_syscall
353
        PTR     sys_ni_syscall
354
        PTR     sys_ni_syscall
355
        PTR     sys_sendfile64

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.