build-many-glibcs.py: Add openrisc hard float glibc variant
[glibc.git] / sysdeps / unix / sysv / linux / arm / dl-procinfo.h
blob49cf0008b292034298404db437b9432b1c8208fc
1 /* Linux/ARM version of processor capability information handling macros.
2 Copyright (C) 2001-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 #ifndef _DL_PROCINFO_H
20 #define _DL_PROCINFO_H 1
22 #include <ldsodefs.h>
23 #include <sysdep.h>
25 #define _DL_HWCAP_COUNT 27
27 /* Low 28 bits are allocated in HWCAP. */
28 #define _DL_HWCAP_LAST 27
30 /* Low 7 bits are allocated in HWCAP2. */
31 #define _DL_HWCAP2_LAST 6
33 /* The kernel provides platform data but it is not interesting. */
34 #define _DL_HWCAP_PLATFORM 0
37 static inline const char *
38 __attribute__ ((unused))
39 _dl_hwcap_string (int idx)
41 return GLRO(dl_arm_cap_flags)[idx];
44 static inline int
45 __attribute__ ((unused))
46 _dl_procinfo (unsigned int type, unsigned long int word)
48 switch(type)
50 case AT_HWCAP:
51 _dl_printf ("AT_HWCAP: ");
53 for (int i = 0; i <= _DL_HWCAP_LAST; ++i)
54 if (word & (1 << i))
55 _dl_printf (" %s", _dl_hwcap_string (i));
56 break;
57 case AT_HWCAP2:
59 unsigned int offset = _DL_HWCAP_LAST + 1;
61 _dl_printf ("AT_HWCAP2: ");
63 for (int i = 0; i <= _DL_HWCAP2_LAST; ++i)
64 if (word & (1 << i))
65 _dl_printf (" %s", _dl_hwcap_string (offset + i));
66 break;
68 default:
69 /* Fallback to generic output mechanism. */
70 return -1;
72 _dl_printf ("\n");
73 return 0;
76 #define HWCAP_IMPORTANT (HWCAP_ARM_VFP | HWCAP_ARM_NEON)
78 #define _dl_string_platform(str) (-1)
80 #endif /* dl-procinfo.h */