]> git.saurik.com Git - apple/xnu.git/blame - tools/tests/execperf/exit-asm.S
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / tools / tests / execperf / exit-asm.S
CommitLineData
6d2010ae 1.text
fe8ab488
A
2 .align 2
3 .globl _main
4_main:
6d2010ae
A
5#if defined(__x86_64__)
6 pushq $0
7 mov %rsp, %rbp
8 andq $0xfffffffffffffff0, %rsp
9 movl $42, %edi
10 movl $0x2000001, %eax
11 movl $0, %ecx
12 movq %rcx, %r10
13 syscall
14 jmp 1f
151:
16 hlt
17 nop
18 nop
19 nop
20 nop
21#elif defined(__i386__)
22 pushl $0
23 mov %esp, %ebp
24 andl $0xfffffff0, %esp
25 subl $12, %esp
26 pushl $42
27 mov $0x40001, %eax
28 call _sysenter_trap
29 jmp 1f
301:
31 hlt
32 nop
33 nop
34 nop
35 nop
36_sysenter_trap:
37 pop %edx
38 mov %esp, %ecx
39 sysenter
40 nop
5ba3f43e
A
41#elif defined(__arm__)
42 push { lr }
43 mov r0, #42
44 mov r12, #1
45 svc 0x00000080
46 bcc 1f
471:
48 nop
49 nop
50 nop
51 nop
52#elif defined(__arm64__)
53 movz x0, #42
54 movz x16, #1
55 svc #0x80
56 b.cc 1f
571:
58 nop
6d2010ae
A
59#else
60#error Unsupported architecture
61#endif