Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

132 lines
3.8 KiB

  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 1989-2013 Free Software Foundation, Inc.
  4. */
  5. #ifndef __ASM_LIBGCC_H
  6. #define __ASM_LIBGCC_H
  7. #define UNITS_PER_WORD 4 /* for ARC */
  8. #define BITS_PER_UNIT 8 /* for ARC */
  9. #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
  10. #define MIN_UNITS_PER_WORD UNITS_PER_WORD
  11. /* Work out the largest "word" size that we can deal with on this target. */
  12. #if MIN_UNITS_PER_WORD > 4
  13. # define LIBGCC2_MAX_UNITS_PER_WORD 8
  14. #elif (MIN_UNITS_PER_WORD > 2 \
  15. || (MIN_UNITS_PER_WORD > 1 && __SIZEOF_LONG_LONG__ > 4))
  16. # define LIBGCC2_MAX_UNITS_PER_WORD 4
  17. #else
  18. # define LIBGCC2_MAX_UNITS_PER_WORD MIN_UNITS_PER_WORD
  19. #endif
  20. /* Work out what word size we are using for this compilation.
  21. The value can be set on the command line. */
  22. #ifndef LIBGCC2_UNITS_PER_WORD
  23. #define LIBGCC2_UNITS_PER_WORD LIBGCC2_MAX_UNITS_PER_WORD
  24. #endif
  25. typedef int QItype __attribute__ ((mode (QI)));
  26. typedef unsigned int UQItype __attribute__ ((mode (QI)));
  27. typedef int HItype __attribute__ ((mode (HI)));
  28. typedef unsigned int UHItype __attribute__ ((mode (HI)));
  29. #if MIN_UNITS_PER_WORD > 1
  30. /* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
  31. typedef int SItype __attribute__ ((mode (SI)));
  32. typedef unsigned int USItype __attribute__ ((mode (SI)));
  33. #if __SIZEOF_LONG_LONG__ > 4
  34. /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */
  35. typedef int DItype __attribute__ ((mode (DI)));
  36. typedef unsigned int UDItype __attribute__ ((mode (DI)));
  37. #if MIN_UNITS_PER_WORD > 4
  38. /* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4. */
  39. typedef int TItype __attribute__ ((mode (TI)));
  40. typedef unsigned int UTItype __attribute__ ((mode (TI)));
  41. #endif
  42. #endif
  43. #endif
  44. #if LIBGCC2_UNITS_PER_WORD == 8
  45. #define W_TYPE_SIZE (8 * BITS_PER_UNIT)
  46. #define Wtype DItype
  47. #define UWtype UDItype
  48. #define HWtype DItype
  49. #define UHWtype UDItype
  50. #define DWtype TItype
  51. #define UDWtype UTItype
  52. #ifdef LIBGCC2_GNU_PREFIX
  53. #define __NW(a,b) __gnu_ ## a ## di ## b
  54. #define __NDW(a,b) __gnu_ ## a ## ti ## b
  55. #else
  56. #define __NW(a,b) __ ## a ## di ## b
  57. #define __NDW(a,b) __ ## a ## ti ## b
  58. #endif
  59. #elif LIBGCC2_UNITS_PER_WORD == 4
  60. #define W_TYPE_SIZE (4 * BITS_PER_UNIT)
  61. #define Wtype SItype
  62. #define UWtype USItype
  63. #define HWtype SItype
  64. #define UHWtype USItype
  65. #define DWtype DItype
  66. #define UDWtype UDItype
  67. #ifdef LIBGCC2_GNU_PREFIX
  68. #define __NW(a,b) __gnu_ ## a ## si ## b
  69. #define __NDW(a,b) __gnu_ ## a ## di ## b
  70. #else
  71. #define __NW(a,b) __ ## a ## si ## b
  72. #define __NDW(a,b) __ ## a ## di ## b
  73. #endif
  74. #elif LIBGCC2_UNITS_PER_WORD == 2
  75. #define W_TYPE_SIZE (2 * BITS_PER_UNIT)
  76. #define Wtype HItype
  77. #define UWtype UHItype
  78. #define HWtype HItype
  79. #define UHWtype UHItype
  80. #define DWtype SItype
  81. #define UDWtype USItype
  82. #ifdef LIBGCC2_GNU_PREFIX
  83. #define __NW(a,b) __gnu_ ## a ## hi ## b
  84. #define __NDW(a,b) __gnu_ ## a ## si ## b
  85. #else
  86. #define __NW(a,b) __ ## a ## hi ## b
  87. #define __NDW(a,b) __ ## a ## si ## b
  88. #endif
  89. #else
  90. #define W_TYPE_SIZE BITS_PER_UNIT
  91. #define Wtype QItype
  92. #define UWtype UQItype
  93. #define HWtype QItype
  94. #define UHWtype UQItype
  95. #define DWtype HItype
  96. #define UDWtype UHItype
  97. #ifdef LIBGCC2_GNU_PREFIX
  98. #define __NW(a,b) __gnu_ ## a ## qi ## b
  99. #define __NDW(a,b) __gnu_ ## a ## hi ## b
  100. #else
  101. #define __NW(a,b) __ ## a ## qi ## b
  102. #define __NDW(a,b) __ ## a ## hi ## b
  103. #endif
  104. #endif
  105. typedef int shift_count_type __attribute__((mode (__libgcc_shift_count__)));
  106. #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
  107. struct DWstruct {Wtype high, low;};
  108. #else
  109. struct DWstruct {Wtype low, high;};
  110. #endif
  111. /* We need this union to unpack/pack DImode values, since we don't have
  112. any arithmetic yet. Incoming DImode parameters are stored into the
  113. `ll' field, and the unpacked result is read from the struct `s'. */
  114. typedef union {
  115. struct DWstruct s;
  116. DWtype ll;
  117. } DWunion;
  118. #endif /* __ASM_LIBGCC_H */