summaryrefslogtreecommitdiff
path: root/src/user/lib/syscall.s
blob: 0af49f3ac53010507c6b8b1c3ca3470fe07d463c (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
.section .text
.global _syscall
.type _syscall, @function
_syscall:
	push %ebx // preserve registers
	push %esi
	push %edi
	push %ebp

	mov 20(%esp), %eax
	mov 24(%esp), %ebx
	mov %esp, %ecx
	mov $_syscall_ret, %edx
	mov 28(%esp), %esi
	mov 32(%esp), %edi
	mov 36(%esp), %ebp
	sysenter

_syscall_ret:
	pop %ebp
	pop %edi
	pop %esi
	pop %ebx
	ret