initial commit
[glibc.git] / sysdeps / aarch64 / sys / ifunc.h
1 /* Definitions used by AArch64 indirect function resolvers.
2 Copyright (C) 2019-2022 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 _SYS_IFUNC_H
20 #define _SYS_IFUNC_H
21
22 /* A second argument is passed to the ifunc resolver. */
23 #define _IFUNC_ARG_HWCAP (1ULL << 62)
24
25 /* The prototype of a gnu indirect function resolver on AArch64 is
26
27 ElfW(Addr) ifunc_resolver (uint64_t, const __ifunc_arg_t *);
28
29 the first argument should have the _IFUNC_ARG_HWCAP bit set and
30 the remaining bits should match the AT_HWCAP settings. */
31
32 /* Second argument to an ifunc resolver. */
33 struct __ifunc_arg_t
34 {
35 unsigned long _size; /* Size of the struct, so it can grow. */
36 unsigned long _hwcap;
37 unsigned long _hwcap2;
38 };
39
40 typedef struct __ifunc_arg_t __ifunc_arg_t;
41
42 #endif