ChibiOS/RT  5.1.0
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 license
25  * @{
26  */
27 
28 #ifndef CHLICENSE_H
29 #define CHLICENSE_H
30 
31 /*===========================================================================*/
32 /* Module constants. */
33 /*===========================================================================*/
34 
35 /**
36  * @name Allowed Features Levels
37  * @{
38  */
39 #define CH_FEATURES_BASIC 0
40 #define CH_FEATURES_INTERMEDIATE 1
41 #define CH_FEATURES_FULL 2
42 /** @} */
43 
44 /**
45  * @name Deployment Options
46  */
47 #define CH_DEPLOY_UNLIMITED -1
48 #define CH_DEPLOY_NONE 0
49 /** @} */
50 
51 /**
52  * @name Licensing Options
53  * @{
54  */
55 #define CH_LICENSE_GPL 0
56 #define CH_LICENSE_GPL_EXCEPTION 1
57 #define CH_LICENSE_COMMERCIAL_FREE 2
58 #define CH_LICENSE_COMMERCIAL_DEV_1000 3
59 #define CH_LICENSE_COMMERCIAL_DEV_5000 4
60 #define CH_LICENSE_COMMERCIAL_FULL 5
61 #define CH_LICENSE_COMMERCIAL_RUNTIME 6
62 #define CH_LICENSE_PARTNER 7
63 /** @} */
64 
65 #include "chcustomer.h"
66 #if CH_LICENSE == CH_LICENSE_PARTNER
67 #include "chpartner.h"
68 #endif
69 #if CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME
70 #include "chruntime.h"
71 #endif
72 
73 /*===========================================================================*/
74 /* Module pre-compile time settings. */
75 /*===========================================================================*/
76 
77 /*===========================================================================*/
78 /* Derived constants and error checks. */
79 /*===========================================================================*/
80 
81 #if (CH_LICENSE == CH_LICENSE_GPL) || defined(__DOXYGEN__)
82 /**
83  * @brief License identification string.
84  * @details This string identifies the license in a machine-readable
85  * format.
86  */
87 #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3)"
88 
89 /**
90  * @brief Customer identification string.
91  * @details This information is only available for registered commercial users.
92  */
93 #define CH_LICENSE_ID_STRING "N/A"
94 
95 /**
96  * @brief Customer code.
97  * @details This information is only available for registered commercial users.
98  */
99 #define CH_LICENSE_ID_CODE "N/A"
100 
101 /**
102  * @brief Code modifiability restrictions.
103  * @details This setting defines if the source code is user-modifiable or not.
104  */
105 #define CH_LICENSE_MODIFIABLE_CODE TRUE
106 
107 /**
108  * @brief Code functionality restrictions.
109  */
110 #define CH_LICENSE_FEATURES CH_FEATURES_FULL
111 
112 /**
113  * @brief Code deploy restrictions.
114  * @details This is the per-core deploy limit allowed under the current
115  * license scheme.
116  */
117 #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
118 
119 #elif CH_LICENSE == CH_LICENSE_GPL_EXCEPTION
120 #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3) + Exception"
121 #define CH_LICENSE_ID_STRING "N/A"
122 #define CH_LICENSE_ID_CODE "N/A"
123 #define CH_LICENSE_MODIFIABLE_CODE FALSE
124 #define CH_LICENSE_FEATURES CH_FEATURES_BASIC
125 #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
126 
127 #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FREE
128 #define CH_LICENSE_TYPE_STRING "Zero Cost Registered License for 500 Cores"
129 #define CH_LICENSE_ID_STRING "N/A"
130 #define CH_LICENSE_ID_CODE "2017-0000"
131 #define CH_LICENSE_MODIFIABLE_CODE FALSE
132 #define CH_LICENSE_FEATURES CH_FEATURES_INTERMEDIATE
133 #define CH_LICENSE_MAX_DEPLOY 500
134 
135 #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_1000
136 #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 1000 Cores"
137 #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
138 #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
139 #define CH_LICENSE_MODIFIABLE_CODE TRUE
140 #define CH_LICENSE_FEATURES CH_FEATURES_FULL
141 #define CH_LICENSE_DEPLOY_LIMIT 1000
142 
143 #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_5000
144 #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 5000 Cores"
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 TRUE
148 #define CH_LICENSE_FEATURES CH_FEATURES_FULL
149 #define CH_LICENSE_DEPLOY_LIMIT 5000
150 
151 #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FULL
152 #define CH_LICENSE_TYPE_STRING "Full Commercial License for Unlimited Deployment"
153 #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
154 #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
155 #define CH_LICENSE_MODIFIABLE_CODE TRUE
156 #define CH_LICENSE_FEATURES CH_FEATURES_FULL
157 #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
158 
159 #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME
160 #define CH_LICENSE_TYPE_STRING "Runtime Commercial License"
161 #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
162 #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
163 #define CH_LICENSE_MODIFIABLE_CODE TRUE
164 #define CH_LICENSE_FEATURES CH_FEATURES_FULL
165 #define CH_LICENSE_MAX_DEPLOY CH_RUNTIME_MAX_DEPLOY
166 
167 #elif CH_LICENSE == CH_LICENSE_PARTNER
168 #define CH_LICENSE_TYPE_STRING "Partners Special Commercial License"
169 #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
170 #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
171 #define CH_LICENSE_MODIFIABLE_CODE CH_PARTNER_MODIFIABLE_CODE
172 #define CH_LICENSE_FEATURES CH_PARTNER_FEATURES
173 #define CH_LICENSE_MAX_DEPLOY CH_PARTNER_MAX_DEPLOY
174 
175 #else
176 #error "invalid licensing option"
177 #endif
178 
179 /*===========================================================================*/
180 /* Module data structures and types. */
181 /*===========================================================================*/
182 
183 /*===========================================================================*/
184 /* Module macros. */
185 /*===========================================================================*/
186 
187 /*===========================================================================*/
188 /* External declarations. */
189 /*===========================================================================*/
190 
191 /*===========================================================================*/
192 /* Module inline functions. */
193 /*===========================================================================*/
194 
195 #endif /* CHLICENSE_H */
196 
197 /** @} */
Customer-related info.