summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/i386/varsyscall.S
blob: e796a93226067901aafd4b05a825682a0ba3e2cc (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
/*
 * arch/i386/varsyscall.S
 *
 * Common tail-handling code for varadic system calls (which always
 * use the cdecl convention.)
 *
 * The arguments are on the stack; the system call number in %eax.
 */

#ifdef	_REGPARM

#define ARG(n)	(4*n+24)(%esp)
#define SYSNO	ARG(-2)

	.text
	.align	4
	.globl	__syscall_varadic
	.type	__syscall_varadic,@function
__syscall_varadic:
	pushl	%ebx
	pushl	%esi
	pushl	%edi
	pushl	%ebp

	movl	SYSNO,%eax
	movl	ARG(0),%ebx		# Syscall arguments
	movl	ARG(1),%ecx
	movl	ARG(2),%edx
	movl	ARG(3),%esi
	movl	ARG(4),%edi
	movl	ARG(5),%ebp

	jmp	__syscall_common_tail

	.size	__syscall_varadic,.-__syscall_varadic

#endif