clarify the purpose of this project
[nyanglibc.git] / misc / pkey_set.s
blobf8685432734b0a471d8ee7992d5bbdaab10ed603
1 .text
2 .p2align 4,,15
3 .globl pkey_set
4 .type pkey_set, @function
5 pkey_set:
6 cmpl $15, %edi
7 ja .L5
8 cmpl $3, %esi
9 ja .L5
10 xorl %r8d, %r8d
11 addl %edi, %edi
12 movl %r8d, %ecx
13 #APP
14 # 27 "../sysdeps/unix/sysv/linux/x86/arch-pkey.h" 1
15 .byte 0x0f, 0x01, 0xee
16 # 0 "" 2
17 #NO_APP
18 movl $3, %edx
19 movl %edi, %ecx
20 sall %cl, %edx
21 sall %cl, %esi
22 movl %r8d, %ecx
23 notl %edx
24 andl %edx, %eax
25 movl %r8d, %edx
26 orl %esi, %eax
27 #APP
28 # 36 "../sysdeps/unix/sysv/linux/x86/arch-pkey.h" 1
29 .byte 0x0f, 0x01, 0xef
30 # 0 "" 2
31 #NO_APP
32 xorl %eax, %eax
33 ret
34 .p2align 4,,10
35 .p2align 3
36 .L5:
37 movq __libc_errno@gottpoff(%rip), %rax
38 movl $22, %fs:(%rax)
39 movl $-1, %eax
40 ret
41 .size pkey_set, .-pkey_set