diff options
Diffstat (limited to 'lib/chibios/os/license/chlicense.h')
-rw-r--r-- | lib/chibios/os/license/chlicense.h | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/lib/chibios/os/license/chlicense.h b/lib/chibios/os/license/chlicense.h new file mode 100644 index 000000000..f496a5fa8 --- /dev/null +++ b/lib/chibios/os/license/chlicense.h | |||
@@ -0,0 +1,200 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006,2007,2008,2009,2010,2011,2012,2013,2014, | ||
3 | 2015,2016,2017,2018,2019,2020,2021 Giovanni Di Sirio. | ||
4 | |||
5 | This file is part of ChibiOS. | ||
6 | |||
7 | ChibiOS is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation version 3 of the License. | ||
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 | */ | ||
50 | #define CH_DEPLOY_UNLIMITED -1 | ||
51 | #define CH_DEPLOY_NONE 0 | ||
52 | /** @} */ | ||
53 | |||
54 | /** | ||
55 | * @name Licensing Options | ||
56 | * @{ | ||
57 | */ | ||
58 | #define CH_LICENSE_GPL 0 | ||
59 | #define CH_LICENSE_GPL_EXCEPTION 1 | ||
60 | #define CH_LICENSE_COMMERCIAL_FREE 2 | ||
61 | #define CH_LICENSE_COMMERCIAL_DEV_1000 3 | ||
62 | #define CH_LICENSE_COMMERCIAL_DEV_5000 4 | ||
63 | #define CH_LICENSE_COMMERCIAL_FULL 5 | ||
64 | #define CH_LICENSE_COMMERCIAL_RUNTIME 6 | ||
65 | #define CH_LICENSE_PARTNER 7 | ||
66 | /** @} */ | ||
67 | |||
68 | #include "chcustomer.h" | ||
69 | #if CH_LICENSE == CH_LICENSE_PARTNER | ||
70 | #include "chpartner.h" | ||
71 | #endif | ||
72 | #if CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME | ||
73 | #include "chruntime.h" | ||
74 | #endif | ||
75 | |||
76 | /*===========================================================================*/ | ||
77 | /* Module pre-compile time settings. */ | ||
78 | /*===========================================================================*/ | ||
79 | |||
80 | /*===========================================================================*/ | ||
81 | /* Derived constants and error checks. */ | ||
82 | /*===========================================================================*/ | ||
83 | |||
84 | #if (CH_LICENSE == CH_LICENSE_GPL) || defined(__DOXYGEN__) | ||
85 | /** | ||
86 | * @brief License identification string. | ||
87 | * @details This string identifies the license in a machine-readable | ||
88 | * format. | ||
89 | */ | ||
90 | #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3)" | ||
91 | |||
92 | /** | ||
93 | * @brief Customer identification string. | ||
94 | * @details This information is only available for registered commercial users. | ||
95 | */ | ||
96 | #define CH_LICENSE_ID_STRING "N/A" | ||
97 | |||
98 | /** | ||
99 | * @brief Customer code. | ||
100 | * @details This information is only available for registered commercial users. | ||
101 | */ | ||
102 | #define CH_LICENSE_ID_CODE "N/A" | ||
103 | |||
104 | /** | ||
105 | * @brief Code modifiability restrictions. | ||
106 | * @details This setting defines if the source code is user-modifiable or not. | ||
107 | */ | ||
108 | #define CH_LICENSE_MODIFIABLE_CODE TRUE | ||
109 | |||
110 | /** | ||
111 | * @brief Code functionality restrictions. | ||
112 | */ | ||
113 | #define CH_LICENSE_FEATURES CH_FEATURES_FULL | ||
114 | |||
115 | /** | ||
116 | * @brief Code deploy restrictions. | ||
117 | * @details This is the per-core deploy limit allowed under the current | ||
118 | * license scheme. | ||
119 | */ | ||
120 | #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED | ||
121 | |||
122 | #elif CH_LICENSE == CH_LICENSE_GPL_EXCEPTION | ||
123 | #define CH_LICENSE_TYPE_STRING "GNU General Public License 3 (GPL3) + Exception" | ||
124 | #define CH_LICENSE_ID_STRING "N/A" | ||
125 | #define CH_LICENSE_ID_CODE "N/A" | ||
126 | #define CH_LICENSE_MODIFIABLE_CODE FALSE | ||
127 | #define CH_LICENSE_FEATURES CH_FEATURES_BASIC | ||
128 | #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED | ||
129 | |||
130 | #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FREE | ||
131 | #define CH_LICENSE_TYPE_STRING "Zero Cost Registered License for 500 Cores" | ||
132 | #define CH_LICENSE_ID_STRING "N/A" | ||
133 | #define CH_LICENSE_ID_CODE "2017-0000" | ||
134 | #define CH_LICENSE_MODIFIABLE_CODE FALSE | ||
135 | #define CH_LICENSE_FEATURES CH_FEATURES_INTERMEDIATE | ||
136 | #define CH_LICENSE_MAX_DEPLOY 500 | ||
137 | |||
138 | #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_1000 | ||
139 | #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 1000 Cores" | ||
140 | #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING | ||
141 | #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE | ||
142 | #define CH_LICENSE_MODIFIABLE_CODE TRUE | ||
143 | #define CH_LICENSE_FEATURES CH_FEATURES_FULL | ||
144 | #define CH_LICENSE_DEPLOY_LIMIT 1000 | ||
145 | |||
146 | #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEV_5000 | ||
147 | #define CH_LICENSE_TYPE_STRING "Developer Commercial License for 5000 Cores" | ||
148 | #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING | ||
149 | #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE | ||
150 | #define CH_LICENSE_MODIFIABLE_CODE TRUE | ||
151 | #define CH_LICENSE_FEATURES CH_FEATURES_FULL | ||
152 | #define CH_LICENSE_DEPLOY_LIMIT 5000 | ||
153 | |||
154 | #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FULL | ||
155 | #define CH_LICENSE_TYPE_STRING "Full Commercial License for Unlimited Deployment" | ||
156 | #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING | ||
157 | #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE | ||
158 | #define CH_LICENSE_MODIFIABLE_CODE TRUE | ||
159 | #define CH_LICENSE_FEATURES CH_FEATURES_FULL | ||
160 | #define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED | ||
161 | |||
162 | #elif CH_LICENSE == CH_LICENSE_COMMERCIAL_RUNTIME | ||
163 | #define CH_LICENSE_TYPE_STRING "Runtime Commercial License" | ||
164 | #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING | ||
165 | #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE | ||
166 | #define CH_LICENSE_MODIFIABLE_CODE TRUE | ||
167 | #define CH_LICENSE_FEATURES CH_FEATURES_FULL | ||
168 | #define CH_LICENSE_MAX_DEPLOY CH_RUNTIME_MAX_DEPLOY | ||
169 | |||
170 | #elif CH_LICENSE == CH_LICENSE_PARTNER | ||
171 | #define CH_LICENSE_TYPE_STRING "Partners Special Commercial License" | ||
172 | #define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING | ||
173 | #define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE | ||
174 | #define CH_LICENSE_MODIFIABLE_CODE CH_PARTNER_MODIFIABLE_CODE | ||
175 | #define CH_LICENSE_FEATURES CH_PARTNER_FEATURES | ||
176 | #define CH_LICENSE_MAX_DEPLOY CH_PARTNER_MAX_DEPLOY | ||
177 | |||
178 | #else | ||
179 | #error "invalid licensing option" | ||
180 | #endif | ||
181 | |||
182 | /*===========================================================================*/ | ||
183 | /* Module data structures and types. */ | ||
184 | /*===========================================================================*/ | ||
185 | |||
186 | /*===========================================================================*/ | ||
187 | /* Module macros. */ | ||
188 | /*===========================================================================*/ | ||
189 | |||
190 | /*===========================================================================*/ | ||
191 | /* External declarations. */ | ||
192 | /*===========================================================================*/ | ||
193 | |||
194 | /*===========================================================================*/ | ||
195 | /* Module inline functions. */ | ||
196 | /*===========================================================================*/ | ||
197 | |||
198 | #endif /* CHLICENSE_H */ | ||
199 | |||
200 | /** @} */ | ||