1 /* Processor capability information handling macros - aarch64 version.
2    Copyright (C) 2017-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 _DL_PROCINFO_H
20 #define _DL_PROCINFO_H	1
21 
22 #include <sys/auxv.h>
23 #include <unistd.h>
24 #include <ldsodefs.h>
25 #include <sysdep.h>
26 
27 /* We cannot provide a general printing function.  */
28 #define _dl_procinfo(type, word) -1
29 
30 /* No additional library search paths.  */
31 #define HWCAP_IMPORTANT HWCAP_ATOMICS
32 
33 static inline const char *
34 __attribute__ ((unused))
_dl_hwcap_string(int idx)35 _dl_hwcap_string (int idx)
36 {
37   return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
38 };
39 
40 static inline int
41 __attribute__ ((unused))
_dl_string_hwcap(const char * str)42 _dl_string_hwcap (const char *str)
43 {
44   for (int i = 0; i < _DL_HWCAP_COUNT; i++)
45     {
46       if (strcmp (str, _dl_hwcap_string (i)) == 0)
47 	return i;
48     }
49   return -1;
50 };
51 
52 /* There're no platforms to filter out.  */
53 #define _DL_HWCAP_PLATFORM 0
54 
55 #define _dl_string_platform(str) (-1)
56 
57 #endif /* dl-procinfo.h */
58