Updated to fedora-glibc-20051219T1003
[glibc.git] / sysdeps / powerpc / dl-procinfo.h
blob8edc5e539a7119920c596581a0d6ad2a885f2d06
1 /* Processor capability information handling macros. PowerPC version.
2 Copyright (C) 2005 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, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 02111-1307 USA. */
20 #ifndef _DL_PROCINFO_H
21 #define _DL_PROCINFO_H 1
23 #include <ldsodefs.h>
24 #include <sysdep.h> /* This defines the PPC_FEATURE_* macros. */
26 /* There are 16 bits used, but they are bits 16..31. */
27 #define _DL_HWCAP_FIRST 16
28 #define _DL_HWCAP_COUNT 32
30 /* These bits influence library search. */
31 #define HWCAP_IMPORTANT (PPC_FEATURE_HAS_ALTIVEC \
32 | PPC_FEATURE_POWER4 \
33 | PPC_FEATURE_POWER5 \
34 | PPC_FEATURE_POWER5_PLUS \
35 | PPC_FEATURE_CELL)
37 /* We don't use AT_PLATFORM. */
38 #define _DL_HWCAP_PLATFORM 0
39 #define _dl_string_platform(str) (-1)
41 static inline const char *
42 __attribute__ ((unused))
43 _dl_hwcap_string (int idx)
45 return GLRO(dl_powerpc_cap_flags)[idx - _DL_HWCAP_FIRST];
48 static inline int
49 __attribute__ ((unused))
50 _dl_string_hwcap (const char *str)
52 for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
53 if (strcmp (str, _dl_hwcap_string (i)) == 0)
54 return i;
55 return -1;
58 #ifdef IS_IN_rtld
59 static inline int
60 __attribute__ ((unused))
61 _dl_procinfo (int word)
63 _dl_printf ("AT_HWCAP: ");
65 for (int i = _DL_HWCAP_FIRST; i < _DL_HWCAP_COUNT; ++i)
66 if (word & (1 << i))
67 _dl_printf (" %s", _dl_hwcap_string (i));
69 _dl_printf ("\n");
71 return 0;
73 #endif
75 #endif /* dl-procinfo.h */