/drivers/net/wireless/bcmdhd/include/typedefs.h

https://bitbucket.org/EaglesBlood_Development/eb_grouper · C Header · 312 lines · 181 code · 109 blank · 22 comment · 5 complexity · bc5d22d6ca0e1294df91b8b099224e8e MD5 · raw file

  1. /*
  2. * Copyright (C) 1999-2011, Broadcom Corporation
  3. *
  4. * Unless you and Broadcom execute a separate written software license
  5. * agreement governing use of this software, this software is licensed to you
  6. * under the terms of the GNU General Public License version 2 (the "GPL"),
  7. * available at http://www.broadcom.com/licenses/GPLv2.php, with the
  8. * following added to such license:
  9. *
  10. * As a special exception, the copyright holders of this software give you
  11. * permission to link this software with independent modules, and to copy and
  12. * distribute the resulting executable under terms of your choice, provided that
  13. * you also meet, for each linked independent module, the terms and conditions of
  14. * the license of that module. An independent module is a module which is not
  15. * derived from this software. The special exception does not apply to any
  16. * modifications of the software.
  17. *
  18. * Notwithstanding the above, under no circumstances may you combine this
  19. * software in any way with any other Broadcom software provided under a license
  20. * other than the GPL, without Broadcom's express prior written consent.
  21. * $Id: typedefs.h 290055 2011-10-15 21:26:26Z $
  22. */
  23. #ifndef _TYPEDEFS_H_
  24. #define _TYPEDEFS_H_
  25. #ifdef SITE_TYPEDEFS
  26. #include "site_typedefs.h"
  27. #else
  28. #ifdef __cplusplus
  29. #define TYPEDEF_BOOL
  30. #ifndef FALSE
  31. #define FALSE false
  32. #endif
  33. #ifndef TRUE
  34. #define TRUE true
  35. #endif
  36. #else
  37. #endif
  38. #if defined(__x86_64__)
  39. #define TYPEDEF_UINTPTR
  40. typedef unsigned long long int uintptr;
  41. #endif
  42. #if defined(_NEED_SIZE_T_)
  43. typedef long unsigned int size_t;
  44. #endif
  45. #if defined(__sparc__)
  46. #define TYPEDEF_ULONG
  47. #endif
  48. #if !defined(LINUX_HYBRID) || defined(LINUX_PORT)
  49. #define TYPEDEF_UINT
  50. #ifndef TARGETENV_android
  51. #define TYPEDEF_USHORT
  52. #define TYPEDEF_ULONG
  53. #endif
  54. #ifdef __KERNEL__
  55. #include <linux/version.h>
  56. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
  57. #define TYPEDEF_BOOL
  58. #endif
  59. #if (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18))
  60. #include <linux/compiler.h>
  61. #ifdef noinline_for_stack
  62. #define TYPEDEF_BOOL
  63. #endif
  64. #endif
  65. #endif
  66. #endif
  67. #if defined(__GNUC__) && defined(__STRICT_ANSI__)
  68. #define TYPEDEF_INT64
  69. #define TYPEDEF_UINT64
  70. #endif
  71. #if defined(__ICL)
  72. #define TYPEDEF_INT64
  73. #if defined(__STDC__)
  74. #define TYPEDEF_UINT64
  75. #endif
  76. #endif
  77. #if !defined(__DJGPP__)
  78. #if defined(__KERNEL__)
  79. #if !defined(LINUX_HYBRID) || defined(LINUX_PORT)
  80. #include <linux/types.h>
  81. #endif
  82. #else
  83. #include <sys/types.h>
  84. #endif
  85. #endif
  86. #define USE_TYPEDEF_DEFAULTS
  87. #endif
  88. #ifdef USE_TYPEDEF_DEFAULTS
  89. #undef USE_TYPEDEF_DEFAULTS
  90. #ifndef TYPEDEF_BOOL
  91. typedef unsigned char bool;
  92. #endif
  93. #ifndef TYPEDEF_UCHAR
  94. typedef unsigned char uchar;
  95. #endif
  96. #ifndef TYPEDEF_USHORT
  97. typedef unsigned short ushort;
  98. #endif
  99. #ifndef TYPEDEF_UINT
  100. typedef unsigned int uint;
  101. #endif
  102. #ifndef TYPEDEF_ULONG
  103. typedef unsigned long ulong;
  104. #endif
  105. #ifndef TYPEDEF_UINT8
  106. typedef unsigned char uint8;
  107. #endif
  108. #ifndef TYPEDEF_UINT16
  109. typedef unsigned short uint16;
  110. #endif
  111. #ifndef TYPEDEF_UINT32
  112. typedef unsigned int uint32;
  113. #endif
  114. #ifndef TYPEDEF_UINT64
  115. typedef unsigned long long uint64;
  116. #endif
  117. #ifndef TYPEDEF_UINTPTR
  118. typedef unsigned int uintptr;
  119. #endif
  120. #ifndef TYPEDEF_INT8
  121. typedef signed char int8;
  122. #endif
  123. #ifndef TYPEDEF_INT16
  124. typedef signed short int16;
  125. #endif
  126. #ifndef TYPEDEF_INT32
  127. typedef signed int int32;
  128. #endif
  129. #ifndef TYPEDEF_INT64
  130. typedef signed long long int64;
  131. #endif
  132. #ifndef TYPEDEF_FLOAT32
  133. typedef float float32;
  134. #endif
  135. #ifndef TYPEDEF_FLOAT64
  136. typedef double float64;
  137. #endif
  138. #ifndef TYPEDEF_FLOAT_T
  139. #if defined(FLOAT32)
  140. typedef float32 float_t;
  141. #else
  142. typedef float64 float_t;
  143. #endif
  144. #endif
  145. #ifndef FALSE
  146. #define FALSE 0
  147. #endif
  148. #ifndef TRUE
  149. #define TRUE 1
  150. #endif
  151. #ifndef NULL
  152. #define NULL 0
  153. #endif
  154. #ifndef OFF
  155. #define OFF 0
  156. #endif
  157. #ifndef ON
  158. #define ON 1
  159. #endif
  160. #define AUTO (-1)
  161. #ifndef PTRSZ
  162. #define PTRSZ sizeof(char*)
  163. #endif
  164. #if defined(__GNUC__)
  165. #define BWL_COMPILER_GNU
  166. #elif defined(__CC_ARM) && __CC_ARM
  167. #define BWL_COMPILER_ARMCC
  168. #else
  169. #error "Unknown compiler!"
  170. #endif
  171. #ifndef INLINE
  172. #if defined(BWL_COMPILER_MICROSOFT)
  173. #define INLINE __inline
  174. #elif defined(BWL_COMPILER_GNU)
  175. #define INLINE __inline__
  176. #elif defined(BWL_COMPILER_ARMCC)
  177. #define INLINE __inline
  178. #else
  179. #define INLINE
  180. #endif
  181. #endif
  182. #undef TYPEDEF_BOOL
  183. #undef TYPEDEF_UCHAR
  184. #undef TYPEDEF_USHORT
  185. #undef TYPEDEF_UINT
  186. #undef TYPEDEF_ULONG
  187. #undef TYPEDEF_UINT8
  188. #undef TYPEDEF_UINT16
  189. #undef TYPEDEF_UINT32
  190. #undef TYPEDEF_UINT64
  191. #undef TYPEDEF_UINTPTR
  192. #undef TYPEDEF_INT8
  193. #undef TYPEDEF_INT16
  194. #undef TYPEDEF_INT32
  195. #undef TYPEDEF_INT64
  196. #undef TYPEDEF_FLOAT32
  197. #undef TYPEDEF_FLOAT64
  198. #undef TYPEDEF_FLOAT_T
  199. #endif
  200. #define UNUSED_PARAMETER(x) (void)(x)
  201. #define DISCARD_QUAL(ptr, type) ((type *)(uintptr)(ptr))
  202. #include <bcmdefs.h>
  203. #endif