You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.5 KiB

  1. From 6cb5b0be8837222a1e01745f2cf57cd0e593186d Mon Sep 17 00:00:00 2001
  2. From: Antoine Tenart <antoine.tenart@free-electrons.com>
  3. Date: Mon, 23 Oct 2017 10:28:20 +0200
  4. Subject: [PATCH] Add ARC support
  5. [Alexey: Rebased on top of other patches like RiscV, NIOS2 etc].
  6. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
  7. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
  8. Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1492378 ]
  9. ---
  10. pr/include/md/_linux.cfg | 45 ++++++++++++++++++++++++++++++++++++++++
  11. pr/include/md/_linux.h | 2 ++
  12. 2 files changed, 47 insertions(+)
  13. diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
  14. index fec8525378dc..5f4fa0eac783 100644
  15. --- a/nspr/pr/include/md/_linux.cfg
  16. +++ b/nspr/pr/include/md/_linux.cfg
  17. @@ -1157,6 +1157,51 @@
  18. #define PR_BYTES_PER_WORD_LOG2 3
  19. #define PR_BYTES_PER_DWORD_LOG2 3
  20. +#elif defined(__arc__)
  21. +
  22. +#define IS_LITTLE_ENDIAN 1
  23. +#undef IS_BIG_ENDIAN
  24. +
  25. +#define PR_BYTES_PER_BYTE 1
  26. +#define PR_BYTES_PER_SHORT 2
  27. +#define PR_BYTES_PER_INT 4
  28. +#define PR_BYTES_PER_INT64 8
  29. +#define PR_BYTES_PER_LONG 4
  30. +#define PR_BYTES_PER_FLOAT 4
  31. +#define PR_BYTES_PER_DOUBLE 8
  32. +#define PR_BYTES_PER_WORD 4
  33. +#define PR_BYTES_PER_DWORD 8
  34. +
  35. +#define PR_BITS_PER_BYTE 8
  36. +#define PR_BITS_PER_SHORT 16
  37. +#define PR_BITS_PER_INT 32
  38. +#define PR_BITS_PER_INT64 64
  39. +#define PR_BITS_PER_LONG 32
  40. +#define PR_BITS_PER_FLOAT 32
  41. +#define PR_BITS_PER_DOUBLE 64
  42. +#define PR_BITS_PER_WORD 32
  43. +
  44. +#define PR_BITS_PER_BYTE_LOG2 3
  45. +#define PR_BITS_PER_SHORT_LOG2 4
  46. +#define PR_BITS_PER_INT_LOG2 5
  47. +#define PR_BITS_PER_INT64_LOG2 6
  48. +#define PR_BITS_PER_LONG_LOG2 5
  49. +#define PR_BITS_PER_FLOAT_LOG2 5
  50. +#define PR_BITS_PER_DOUBLE_LOG2 6
  51. +#define PR_BITS_PER_WORD_LOG2 5
  52. +
  53. +#define PR_ALIGN_OF_SHORT 2
  54. +#define PR_ALIGN_OF_INT 4
  55. +#define PR_ALIGN_OF_LONG 4
  56. +#define PR_ALIGN_OF_INT64 4
  57. +#define PR_ALIGN_OF_FLOAT 4
  58. +#define PR_ALIGN_OF_DOUBLE 4
  59. +#define PR_ALIGN_OF_POINTER 4
  60. +#define PR_ALIGN_OF_WORD 4
  61. +
  62. +#define PR_BYTES_PER_WORD_LOG2 2
  63. +#define PR_BYTES_PER_DWORD_LOG2 3
  64. +
  65. #else
  66. #error "Unknown CPU architecture"
  67. diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
  68. index 8e04fad479a1..628b1217e9c8 100644
  69. --- a/nspr/pr/include/md/_linux.h
  70. +++ b/nspr/pr/include/md/_linux.h
  71. @@ -63,6 +63,8 @@
  72. #define _PR_SI_ARCHITECTURE "riscv32"
  73. #elif defined(__riscv) && (__riscv_xlen == 64)
  74. #define _PR_SI_ARCHITECTURE "riscv64"
  75. +#elif defined(__arc__)
  76. +#define _PR_SI_ARCHITECTURE "arc"
  77. #else
  78. #error "Unknown CPU architecture"
  79. #endif
  80. --
  81. 2.17.1