Debian Codegraph @

sysdeps/unix/sysv/linux/aarch64/tst-gcs-helper.h

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 /* AArch64 tests for GCS.
2 Copyright (C) 2025-2026 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19 #ifndef TST_GCS_HELPER_H
20 #define TST_GCS_HELPER_H
21
22 #include <support/check.h>
23 #include <support/support.h>
24 #include <support/test-driver.h>
25
26 #include <stdio.h>
27 #include <sys/auxv.h>
28
29 static bool __check_gcs_status (void)
30 {
31 register unsigned long x16 asm ("x16");
32 asm volatile (
33 "mov x16, #1 /* _CHKFEAT_GCS */\n"
34 "hint 40 /* CHKFEAT_X16 */\n"
35 : "=r" (x16));
36 return x16 ^ 1;
37 }
38
39 #endif // POINTER_GUARD_H