dl-procinfo.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Processor capability information handling macros - aarch64 version.
  2. Copyright (C) 2017-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _DL_PROCINFO_H
  16. #define _DL_PROCINFO_H 1
  17. #include <sys/auxv.h>
  18. #include <unistd.h>
  19. #include <ldsodefs.h>
  20. #include <sysdep.h>
  21. /* We cannot provide a general printing function. */
  22. #define _dl_procinfo(type, word) -1
  23. /* No additional library search paths. */
  24. #define HWCAP_IMPORTANT HWCAP_ATOMICS
  25. static inline const char *
  26. __attribute__ ((unused))
  27. _dl_hwcap_string (int idx)
  28. {
  29. return (unsigned)idx < _DL_HWCAP_COUNT ? GLRO(dl_aarch64_cap_flags)[idx] : "";
  30. };
  31. static inline int
  32. __attribute__ ((unused))
  33. _dl_string_hwcap (const char *str)
  34. {
  35. for (int i = 0; i < _DL_HWCAP_COUNT; i++)
  36. {
  37. if (strcmp (str, _dl_hwcap_string (i)) == 0)
  38. return i;
  39. }
  40. return -1;
  41. };
  42. /* There're no platforms to filter out. */
  43. #define _DL_HWCAP_PLATFORM 0
  44. #define _dl_string_platform(str) (-1)
  45. #endif /* dl-procinfo.h */