]> git.saurik.com Git - apple/xnu.git/blob - tools/tests/execperf/exit-asm.S
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / tools / tests / execperf / exit-asm.S
1 .text
2 .align 2
3 .globl _main
4 _main:
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
15 1:
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
30 1:
31 hlt
32 nop
33 nop
34 nop
35 nop
36 _sysenter_trap:
37 pop %edx
38 mov %esp, %ecx
39 sysenter
40 nop
41 #elif defined(__arm__)
42 push { lr }
43 mov r0, #42
44 mov r12, #1
45 svc 0x00000080
46 bcc 1f
47 1:
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
57 1:
58 nop
59 #else
60 #error Unsupported architecture
61 #endif