chlicense.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio.
  3. This file is part of ChibiOS.
  4. ChibiOS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. ChibiOS 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
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. /**
  16. * @file chlicense.h
  17. * @brief License Module macros and structures.
  18. *
  19. * @addtogroup chibios_license
  20. * @details This module contains all the definitions required for defining
  21. * a licensing scheme for customers or public releases.
  22. * @{
  23. */
  24. #ifndef CHLICENSE_H
  25. #define CHLICENSE_H
  26. /*===========================================================================*/
  27. /* Module constants. */
  28. /*===========================================================================*/
  29. /**
  30. * @name Allowed Features Levels
  31. * @{
  32. */
  33. #define CH_FEATURES_BASIC 0
  34. #define CH_FEATURES_INTERMEDIATE 1
  35. #define CH_FEATURES_FULL 2
  36. /** @} */
  37. /**
  38. * @name Deployment Options
  39. */
  40. #define CH_DEPLOY_UNLIMITED -1
  41. #define CH_DEPLOY_NONE 0
  42. /** @} */
  43. /**
  44. * @name Licensing Options
  45. * @{
  46. */
  47. #define CH_LICENSE_GPL 0
  48. #define CH_LICENSE_GPL_EXCEPTION 1
  49. #define CH_LICENSE_COMMERCIAL_FREE 2
  50. #define CH_LICENSE_COMMERCIAL_DEV_1000 3
  51. #define CH_LICENSE_COMMERCIAL_DEV_5000 4
  52. #define CH_LICENSE_COMMERCIAL_FULL 5
  53. #define CH_LICENSE_COMMERCIAL_RUNTIME 6
  54. #define CH_LICENSE_PARTNER 7
  55. /** @} */
  56. #include "chcustomer.h"
  57. #if CH_LICENSE == CH_LICENSE_PARTNER
  58. #include "chpartner.h"
  59. #endif
  60. #if CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME
  61. #include "chruntime.h"
  62. #endif
  63. /*===========================================================================*/
  64. /* Module pre-compile time settings. */
  65. /*===========================================================================*/
  66. /*===========================================================================*/
  67. /* Derived constants and error checks. */
  68. /*===========================================================================*/
  69. #if (CH_LICENSE == CH_LICENSE_GPL) || defined(__DOXYGEN__)
  70. /**
  71. * @brief License identification string.
  72. * @details This string identifies the license in a machine-readable
  73. * format.
  74. */
  75. #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3)"
  76. /**
  77. * @brief Customer identification string.
  78. * @details This information is only available for registered commercial users.
  79. */
  80. #define CH_LICENSE_ID_STRING "N/A"
  81. /**
  82. * @brief Customer code.
  83. * @details This information is only available for registered commercial users.
  84. */
  85. #define CH_LICENSE_ID_CODE "N/A"
  86. /**
  87. * @brief Code modifiability restrictions.
  88. * @details This setting defines if the source code is user-modifiable or not.
  89. */
  90. #define CH_LICENSE_MODIFIABLE_CODE TRUE
  91. /**
  92. * @brief Code functionality restrictions.
  93. */
  94. #define CH_LICENSE_FEATURES CH_FEATURES_FULL
  95. /**
  96. * @brief Code deploy restrictions.
  97. * @details This is the per-core deploy limit allowed under the current
  98. * license scheme.
  99. */
  100. #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
  101. #elif CH_LICENSE == CH_LICENSE_GPL_EXCEPTION
  102. #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3) + Exception"
  103. #define CH_LICENSE_ID_STRING "N/A"
  104. #define CH_LICENSE_ID_CODE "N/A"
  105. #define CH_LICENSE_MODIFIABLE_CODE FALSE
  106. #define CH_LICENSE_FEATURES CH_FEATURES_BASIC
  107. #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
  108. #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FREE
  109. #define CH_LICENSE_TYPE_STRING "Zero Cost Registered License for 500 Cores"
  110. #define CH_LICENSE_ID_STRING "N/A"
  111. #define CH_LICENSE_ID_CODE "2017-0000"
  112. #define CH_LICENSE_MODIFIABLE_CODE FALSE
  113. #define CH_LICENSE_FEATURES CH_FEATURES_INTERMEDIATE
  114. #define CH_LICENSE_MAX_DEPLOY 500
  115. #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_1000
  116. #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 1000 Cores"
  117. #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
  118. #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
  119. #define CH_LICENSE_MODIFIABLE_CODE TRUE
  120. #define CH_LICENSE_FEATURES CH_FEATURES_FULL
  121. #define CH_LICENSE_DEPLOY_LIMIT 1000
  122. #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_5000
  123. #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 5000 Cores"
  124. #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
  125. #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
  126. #define CH_LICENSE_MODIFIABLE_CODE TRUE
  127. #define CH_LICENSE_FEATURES CH_FEATURES_FULL
  128. #define CH_LICENSE_DEPLOY_LIMIT 5000
  129. #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FULL
  130. #define CH_LICENSE_TYPE_STRING "Full Commercial License for Unlimited Deployment"
  131. #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
  132. #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
  133. #define CH_LICENSE_MODIFIABLE_CODE TRUE
  134. #define CH_LICENSE_FEATURES CH_FEATURES_FULL
  135. #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
  136. #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME
  137. #define CH_LICENSE_TYPE_STRING "Runtime Commercial License"
  138. #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
  139. #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
  140. #define CH_LICENSE_MODIFIABLE_CODE TRUE
  141. #define CH_LICENSE_FEATURES CH_FEATURES_FULL
  142. #define CH_LICENSE_MAX_DEPLOY CH_RUNTIME_MAX_DEPLOY
  143. #elif CH_LICENSE == CH_LICENSE_PARTNER
  144. #define CH_LICENSE_TYPE_STRING "Partners Special Commercial License"
  145. #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
  146. #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
  147. #define CH_LICENSE_MODIFIABLE_CODE CH_PARTNER_MODIFIABLE_CODE
  148. #define CH_LICENSE_FEATURES CH_PARTNER_FEATURES
  149. #define CH_LICENSE_MAX_DEPLOY CH_PARTNER_MAX_DEPLOY
  150. #else
  151. #error "invalid licensing option"
  152. #endif
  153. /*===========================================================================*/
  154. /* Module data structures and types. */
  155. /*===========================================================================*/
  156. /*===========================================================================*/
  157. /* Module macros. */
  158. /*===========================================================================*/
  159. /*===========================================================================*/
  160. /* External declarations. */
  161. /*===========================================================================*/
  162. /*===========================================================================*/
  163. /* Module inline functions. */
  164. /*===========================================================================*/
  165. #endif /* CHLICENSE_H */
  166. /** @} */