Linux Audio

Check our new training course

Linux debugging, profiling, tracing and performance analysis training

Apr 14-17, 2025
Register
Loading...
v4.6
 
 1#include <as-layout.h>
 2
 3.section .__syscall_stub, "ax"
 4
 5	.globl batch_syscall_stub
 6batch_syscall_stub:
 7	/* load pointer to first operation */
 8	mov	$(STUB_DATA+8), %esp
 9
10again:
11	/* load length of additional data */
12	mov	0x0(%esp), %eax
13
14	/* if(length == 0) : end of list */
15	/* write possible 0 to header */
16	mov	%eax, STUB_DATA+4
17	cmpl	$0, %eax
18	jz	done
19
20	/* save current pointer */
21	mov	%esp, STUB_DATA+4
22
23	/* skip additional data */
24	add	%eax, %esp
25
26	/* load syscall-# */
27	pop	%eax
28
29	/* load syscall params */
30	pop	%ebx
31	pop	%ecx
32	pop	%edx
33	pop	%esi
34 	pop	%edi
35	pop	%ebp
36
37	/* execute syscall */
38	int	$0x80
39
40	/* check return value */
41	pop	%ebx
42	cmp	%ebx, %eax
43	je	again
44
45done:
46	/* save return value */
47	mov	%eax, STUB_DATA
48
49	/* stop */
50	int3
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#include <as-layout.h>
 3
 4.section .__syscall_stub, "ax"
 5
 6	.globl batch_syscall_stub
 7batch_syscall_stub:
 8	/* load pointer to first operation */
 9	mov	$(STUB_DATA+8), %esp
10
11again:
12	/* load length of additional data */
13	mov	0x0(%esp), %eax
14
15	/* if(length == 0) : end of list */
16	/* write possible 0 to header */
17	mov	%eax, STUB_DATA+4
18	cmpl	$0, %eax
19	jz	done
20
21	/* save current pointer */
22	mov	%esp, STUB_DATA+4
23
24	/* skip additional data */
25	add	%eax, %esp
26
27	/* load syscall-# */
28	pop	%eax
29
30	/* load syscall params */
31	pop	%ebx
32	pop	%ecx
33	pop	%edx
34	pop	%esi
35 	pop	%edi
36	pop	%ebp
37
38	/* execute syscall */
39	int	$0x80
40
41	/* check return value */
42	pop	%ebx
43	cmp	%ebx, %eax
44	je	again
45
46done:
47	/* save return value */
48	mov	%eax, STUB_DATA
49
50	/* stop */
51	int3