New licensing headers.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9286 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2016-04-16 10:14:41 +00:00
parent 0aabb7e5ad
commit 6abec945c2
7 changed files with 120 additions and 74 deletions

View File

@ -9,6 +9,9 @@ OPT = $(USE_OPT)
COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
# Enforced search paths
INCDIR := $(CHIBIOS)/os/license $(INCDIR)
# Garbage collection
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common

View File

@ -9,6 +9,9 @@ OPT := $(USE_OPT)
COPT := $(USE_COPT)
CPPOPT := $(USE_CPPOPT)
# Enforced search paths
INCDIR := $(CHIBIOS)/os/license $(INCDIR)
# Garbage collection
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common

View File

@ -9,6 +9,9 @@ OPT = $(USE_OPT)
COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
# Enforced search paths
INCDIR := $(CHIBIOS)/os/license $(INCDIR)
# Garbage collection
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common

View File

@ -9,6 +9,9 @@ OPT = $(USE_OPT)
COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
# Enforced search paths
INCDIR := $(CHIBIOS)/os/license $(INCDIR)
# Garbage collection
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common

99
os/license/chcustomer.h Normal file
View File

@ -0,0 +1,99 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio.
This file is part of ChibiOS.
ChibiOS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file chcustomer.h
* @brief Customer-related info.
*
* @addtogroup customer
* @{
*/
#ifndef CHCUSTOMER_H
#define CHCUSTOMER_H
/*===========================================================================*/
/* Module constants. */
/*===========================================================================*/
/**
* @brief Customer readable identifier.
*/
#define CH_CUSTOMER_ID_STRING "Santa, North Pole"
/**
* @brief Customer code.
*/
#define CH_CUSTOMER_ID_CODE "xxxx-yyyy"
/**
* @brief Current license.
* @note This setting is reserved to the copyright owner.
* @note Changing this setting invalidates the license.
* @note The license statement in the source headers is valid, applicable
* and binding regardless this setting.
*/
#define CH_LICENSE CH_LICENSE_GPL
/**
* @name Licensed Products
* @{
*/
#define CH_CUSTOMER_LICENSED_RT TRUE
#define CH_CUSTOMER_LICENSED_NIL TRUE
#define CH_CUSTOMER_LICENSED_HAL TRUE
#define CH_CUSTOMER_LICENSED_EX TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM0 TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM3 TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM4 TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM7 TRUE
#define CH_CUSTOMER_LICENSED_PORT_ARM79 TRUE
#define CH_CUSTOMER_LICENSED_PORT_E200Z0 TRUE
#define CH_CUSTOMER_LICENSED_PORT_E200Z2 TRUE
#define CH_CUSTOMER_LICENSED_PORT_E200Z3 TRUE
#define CH_CUSTOMER_LICENSED_PORT_E200Z4 TRUE
/** @} */
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Module macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
/*===========================================================================*/
/* Module inline functions. */
/*===========================================================================*/
#endif /* CHCUSTOMER_H */
/** @} */

View File

@ -60,19 +60,15 @@
#define CH_LICENSE_PARTNER 5
/** @} */
#include "chcustomer.h"
#if CH_LICENSE == CH_LICENSE_PARTNER
#include "chpartner.h"
#endif
/*===========================================================================*/
/* Module pre-compile time settings. */
/*===========================================================================*/
/**
* @brief Current license.
* @note This setting is reserved to the copyright owner.
* @note Changing this setting invalidates the license.
* @note The license statement in the source headers is valid, applicable
* and binding regardless this setting.
*/
#define CH_LICENSE CH_LICENSE_GPL
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@ -105,26 +101,6 @@
/**
* @brief Code functionality restrictions.
* @details This setting defines which features are available under the
* current licensing scheme. The possible settings are:
* - @p CH_FEATURES_FULL if all features are available.
* - @p CH_FEATURES_INTERMEDIATE means that the following
* functionalities are disabled:
* - High Resolution mode.
* - Time Measurement.
* - Statistics.
* .
* - @p CH_FEATURES_BASIC means that the following functionalities
* are disabled:
* - High Resolution mode.
* - Time Measurement.
* - Statistics.
* - Tickless mode.
* - Recursive Mutexes.
* - Condition Variables.
* - Dynamic threading.
* .
* .
*/
#define CH_LICENSE_FEATURES CH_FEATURES_FULL
@ -152,7 +128,6 @@
#define CH_LICENSE_MAX_DEPLOY 500
#elif CH_LICENSE == CH_LICENSE_COMMERCIAL_DEVELOPER
#include "chcustomer.h"
#define CH_LICENSE_TYPE_STRING "Developer-Only Commercial License"
#define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
#define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
@ -161,7 +136,6 @@
#define CH_LICENSE_DEPLOY_LIMIT 5000
#elif CH_LICENSE == CH_LICENSE_COMMERCIAL_FULL
#include "chcustomer.h"
#define CH_LICENSE_TYPE_STRING "Full Commercial License"
#define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
#define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
@ -170,57 +144,17 @@
#define CH_LICENSE_MAX_DEPLOY CH_DEPLOY_UNLIMITED
#elif CH_LICENSE == CH_LICENSE_PARTNER
#include "chpartner.h"
#define CH_LICENSE_TYPE_STRING "Partners Special Commercial License"
#define CH_LICENSE_ID_STRING CH_PARTNER_ID_STRING
#define CH_LICENSE_ID_CODE CH_PARTNER_ID_CODE
#define CH_LICENSE_ID_STRING CH_CUSTOMER_ID_STRING
#define CH_LICENSE_ID_CODE CH_CUSTOMER_ID_CODE
#define CH_LICENSE_MODIFIABLE_CODE CH_PARTNER_MODIFIABLE_CODE
#define CH_LICENSE_FEATURES CH_PARTNER_FEATURES_FULL
#define CH_LICENSE_FEATURES CH_PARTNER_FEATURES
#define CH_LICENSE_MAX_DEPLOY CH_PARTNER_MAX_DEPLOY
#else
#error "invalid licensing option"
#endif
/* Checks on the enabled features.*/
#if CH_LICENSE_FEATURES == CH_FEATURES_FULL
/* No restrictions in full mode.*/
#elif (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) || \
(CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
/* Restrictions in basic and intermediate modes.*/
#if CH_CFG_ST_TIMEDELTA > 2
#error "CH_CFG_ST_TIMEDELTA > 2, High Resolution Time functionality restricted"
#endif
#if CH_DBG_STATISTICS == TRUE
#error "CH_DBG_STATISTICS == TRUE, Statistics functionality restricted"
#endif
#if CH_LICENSE_FEATURES == CH_FEATURES_BASIC
/* Restrictions in basic mode.*/
#if CH_CFG_ST_TIMEDELTA > 0
#error "CH_CFG_ST_TIMEDELTA > 0, Tick-Less functionality restricted"
#endif
#if CH_CFG_USE_TM == TRUE
#error "CH_CFG_USE_TM == TRUE, Time Measurement functionality restricted"
#endif
#if CH_CFG_USE_MUTEXES == TRUE
#error "CH_CFG_USE_MUTEXES == TRUE, Recursive Mutexes functionality restricted"
#endif
#if CH_CFG_USE_CONDVARS == TRUE
#error "CH_CFG_USE_CONDVARS == TRUE, Condition Variables functionality restricted"
#endif
#endif /* CH_LICENSE_FEATURES == CH_FEATURES_BASIC */
#else
#error "invalid feature settings"
#endif
/*===========================================================================*/
/* Module data structures and types. */
/*===========================================================================*/

View File

@ -75,6 +75,7 @@
#endif
#include "chlicense.h"
#include "chchecks.h"
#include "chsystypes.h"
#include "chalign.h"
#include "chcore.h"