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