6 |
* The arguments are on the stack; the system call number in %eax. |
* The arguments are on the stack; the system call number in %eax. |
7 |
*/ |
*/ |
8 |
|
|
9 |
#define ARG(n) (4*n+20)(%esp) |
#define ARG(n) (4*(n)+24)(%esp) |
10 |
|
#define SYSNO ARG(-2) |
11 |
|
|
12 |
.text |
.text |
13 |
.align 4 |
.align 4 |
14 |
.globl __syscall_common |
.globl __syscall_common |
15 |
.type __syscall_common,@function |
.type __syscall_common,@function |
16 |
__syscall_common: |
__syscall_common: |
|
#ifdef _REGPARM |
|
|
xchgl %ebx,(%esp) |
|
|
#else |
|
|
popl %eax |
|
17 |
pushl %ebx |
pushl %ebx |
|
#endif |
|
18 |
pushl %esi |
pushl %esi |
19 |
pushl %edi |
pushl %edi |
20 |
pushl %ebp |
pushl %ebp |
21 |
|
|
22 |
#ifdef _REGPARM |
#ifdef _REGPARM |
|
xchgl %eax,%ebx |
|
23 |
xchgl %ecx,%edx |
xchgl %ecx,%edx |
24 |
|
movl %eax,%ebx |
25 |
|
movl SYSNO,%eax |
26 |
movl ARG(0),%esi |
movl ARG(0),%esi |
27 |
movl ARG(1),%edi |
movl ARG(1),%edi |
28 |
movl ARG(2),%ebp |
movl ARG(2),%ebp |
29 |
#else |
#else |
30 |
|
movl SYSNO,%eax |
31 |
movl ARG(0),%ebx # Syscall arguments |
movl ARG(0),%ebx # Syscall arguments |
32 |
movl ARG(1),%ecx |
movl ARG(1),%ecx |
33 |
movl ARG(2),%edx |
movl ARG(2),%edx |
45 |
popl %edi |
popl %edi |
46 |
popl %esi |
popl %esi |
47 |
popl %ebx |
popl %ebx |
48 |
|
popl %edx # Drop system call number |
49 |
|
|
50 |
jb 1f |
jb 1f |
51 |
|
|