0012-add-hwcap.h-header-file.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From b20b70ad45a75c817b2320bed6c8f463e230c20e Mon Sep 17 00:00:00 2001
  2. From: "max.ma" <max.ma@starfivetech.com>
  3. Date: Mon, 14 Feb 2022 15:40:51 -0800
  4. Subject: [PATCH 12/12] add hwcap.h header file
  5. ---
  6. sysdeps/unix/sysv/linux/riscv/bits/hwcap.h | 30 ++++++++++++++++++++++
  7. 1 file changed, 30 insertions(+)
  8. create mode 100644 sysdeps/unix/sysv/linux/riscv/bits/hwcap.h
  9. diff --git a/sysdeps/unix/sysv/linux/riscv/bits/hwcap.h b/sysdeps/unix/sysv/linux/riscv/bits/hwcap.h
  10. new file mode 100644
  11. index 0000000000..a90e7bb070
  12. --- /dev/null
  13. +++ b/sysdeps/unix/sysv/linux/riscv/bits/hwcap.h
  14. @@ -0,0 +1,30 @@
  15. +/* Defines for bits in AT_HWCAP. RISC-V Linux version.
  16. + Copyright (C) 2021 Free Software Foundation, Inc.
  17. + This file is part of the GNU C Library.
  18. +
  19. + The GNU C Library is free software; you can redistribute it and/or
  20. + modify it under the terms of the GNU Lesser General Public
  21. + License as published by the Free Software Foundation; either
  22. + version 2.1 of the License, or (at your option) any later version.
  23. +
  24. + The GNU C Library is distributed in the hope that it will be useful,
  25. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  27. + Lesser General Public License for more details.
  28. +
  29. + You should have received a copy of the GNU Lesser General Public
  30. + License along with the GNU C Library; if not, see
  31. + <http://www.gnu.org/licenses/>. */
  32. +
  33. +#if !defined (_SYS_AUXV_H) && !defined (_LINUX_RISCV_SYSDEP_H)
  34. +# error "Never include <bits/hwcap.h> directly; use <sys/auxv.h> instead."
  35. +#endif
  36. +
  37. +/* The following must match the kernel's <asm/hwcap.h>. */
  38. +#define HWCAP_ISA_I 0x100 //(1 << ('I' - 'A'))
  39. +#define HWCAP_ISA_M 0x1000 //(1 << ('M' - 'A'))
  40. +#define HWCAP_ISA_A 0x1 //(1 << ('A' - 'A'))
  41. +#define HWCAP_ISA_F 0x20 //(1 << ('F' - 'A'))
  42. +#define HWCAP_ISA_D 0x8 //(1 << ('D' - 'A'))
  43. +#define HWCAP_ISA_C 0x4 //(1 << ('C' - 'A'))
  44. +#define HWCAP_ISA_V 0x200000 //(1 << ('V' - 'A'))
  45. --
  46. 2.33.1