xref: /linux/tools/testing/selftests/x86/clang_helpers_64.S (revision d53b8e36925256097a08d7cb749198d85cbf9b2b)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * 64-bit assembly helpers for asm operations that lack support in both gcc and
4 * clang. For example, clang asm does not support segment prefixes.
5 */
6.global dereference_seg_base
7
8dereference_seg_base:
9	mov %gs:(0), %rax
10	ret
11
12.global test_page
13.global test_syscall_insn
14
15.pushsection ".text", "ax"
16.balign 4096
17test_page: .globl test_page
18	.fill 4094,1,0xcc
19
20test_syscall_insn:
21	syscall
22
23.ifne . - test_page - 4096
24	.error "test page is not one page long"
25.endif
26.popsection
27
28.section .note.GNU-stack,"",%progbits
29