PRIGROUP setting is now configurable.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4121 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2012-04-22 14:05:22 +00:00
parent f0152ab13b
commit 1b12b90963
8 changed files with 36 additions and 5 deletions

View File

@ -112,7 +112,7 @@ void _port_init(void) {
/* Initialization of the vector table and priority related settings.*/ /* Initialization of the vector table and priority related settings.*/
SCB_VTOR = CORTEX_VTOR_INIT; SCB_VTOR = CORTEX_VTOR_INIT;
SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(CORTEX_PRIGROUP_INIT);
/* Initialization of the system vectors used by the port.*/ /* Initialization of the system vectors used by the port.*/
nvicSetSystemHandlerPriority(HANDLER_SVCALL, nvicSetSystemHandlerPriority(HANDLER_SVCALL,

View File

@ -129,7 +129,16 @@
* @brief NVIC VTOR initialization expression. * @brief NVIC VTOR initialization expression.
*/ */
#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__) #if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__)
#define CORTEX_VTOR_INIT 0x00000000 #define CORTEX_VTOR_INIT 0x00000000
#endif
/**
* @brief NVIC PRIGROUP initialization expression.
* @details The default assigns all available priority bits as preemption
* priority with no sub-priority.
*/
#if !defined(CORTEX_PRIGROUP_INIT) || defined(__DOXYGEN__)
#define CORTEX_PRIGROUP_INIT (7 - CORTEX_PRIORITY_BITS)
#endif #endif
/*===========================================================================*/ /*===========================================================================*/

View File

@ -112,7 +112,7 @@ void _port_init(void) {
/* Initialization of the vector table and priority related settings.*/ /* Initialization of the vector table and priority related settings.*/
SCB_VTOR = CORTEX_VTOR_INIT; SCB_VTOR = CORTEX_VTOR_INIT;
SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(CORTEX_PRIGROUP_INIT);
#if CORTEX_USE_FPU #if CORTEX_USE_FPU
{ {

View File

@ -132,6 +132,15 @@
#define CORTEX_VTOR_INIT 0x00000000 #define CORTEX_VTOR_INIT 0x00000000
#endif #endif
/**
* @brief NVIC PRIGROUP initialization expression.
* @details The default assigns all available priority bits as preemption
* priority with no sub-priority.
*/
#if !defined(CORTEX_PRIGROUP_INIT) || defined(__DOXYGEN__)
#define CORTEX_PRIGROUP_INIT (7 - CORTEX_PRIORITY_BITS)
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Port derived parameters. */ /* Port derived parameters. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -114,7 +114,7 @@ void _port_init(void) {
/* Initialization of the vector table and priority related settings.*/ /* Initialization of the vector table and priority related settings.*/
SCB_VTOR = CORTEX_VTOR_INIT; SCB_VTOR = CORTEX_VTOR_INIT;
SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(0); SCB_AIRCR = AIRCR_VECTKEY | AIRCR_PRIGROUP(CORTEX_PRIGROUP_INIT);
#if CORTEX_USE_FPU #if CORTEX_USE_FPU
{ {

View File

@ -132,6 +132,15 @@
#define CORTEX_VTOR_INIT 0x00000000 #define CORTEX_VTOR_INIT 0x00000000
#endif #endif
/**
* @brief NVIC PRIGROUP initialization expression.
* @details The default assigns all available priority bits as preemption
* priority with no sub-priority.
*/
#if !defined(CORTEX_PRIGROUP_INIT) || defined(__DOXYGEN__)
#define CORTEX_PRIGROUP_INIT (7 - CORTEX_PRIORITY_BITS)
#endif
/*===========================================================================*/ /*===========================================================================*/
/* Port derived parameters. */ /* Port derived parameters. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -189,7 +189,7 @@ typedef struct {
#define AIRCR_VECTKEY 0x05FA0000U #define AIRCR_VECTKEY 0x05FA0000U
#define AIRCR_PRIGROUP_MASK (0x7U << 8) #define AIRCR_PRIGROUP_MASK (0x7U << 8)
#define AIRCR_PRIGROUP(n) ((n##U) << 8) #define AIRCR_PRIGROUP(n) ((n) << 8)
/** /**
* @brief Structure representing the FPU I/O space. * @brief Structure representing the FPU I/O space.

View File

@ -117,6 +117,10 @@
under ./os/various/fatfs_bindings and shared among all demos. The FatFS under ./os/various/fatfs_bindings and shared among all demos. The FatFS
file ffconf.h is now application-specific like all the other configuration file ffconf.h is now application-specific like all the other configuration
files. files.
- NEW: Added an new option CORTEX_PRIGROUP_INIT to the Cortex-Mx ports in
order to make priority organization configurable, the default is to
assign all the available priority bits to preemption priority with no
sub-priorities.
- NEW: Added support for pools of generic "mail" objects under ./os/various, - NEW: Added support for pools of generic "mail" objects under ./os/various,
mail objects are meant to be used together with mailboxes. mail objects are meant to be used together with mailboxes.
- NEW: Added a new function chPoolLoadArray() to the Memory Pools subsystem, - NEW: Added a new function chPoolLoadArray() to the Memory Pools subsystem,