aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-11 17:51:37 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-08-11 17:51:37 +0000
commitb9933c2089f5f0cd93738ae9081c45fcf3df54b7 (patch)
treec98941094d7d03cb42ffc46d258bccc0ffba4ca0 /os/ports
parent50a41618beccf297631423b10aba8daa3be1e901 (diff)
downloadChibiOS-b9933c2089f5f0cd93738ae9081c45fcf3df54b7.tar.gz
ChibiOS-b9933c2089f5f0cd93738ae9081c45fcf3df54b7.tar.bz2
ChibiOS-b9933c2089f5f0cd93738ae9081c45fcf3df54b7.zip
Implemented system state checker debug option, remove the option CH_USE_NESTED_LOCKS. Documentation improvements and fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3221 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports')
-rw-r--r--os/ports/GCC/ARMCMx/STM32F1xx/vectors.c12
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v6m.c6
-rw-r--r--os/ports/GCC/ARMCMx/chcore_v7m.c6
-rw-r--r--os/ports/GCC/ARMCMx/crt0.c20
-rw-r--r--os/ports/GCC/ARMCMx/port.dox31
-rw-r--r--os/ports/GCC/PPC/SPC56x/ivor.s2
6 files changed, 52 insertions, 25 deletions
diff --git a/os/ports/GCC/ARMCMx/STM32F1xx/vectors.c b/os/ports/GCC/ARMCMx/STM32F1xx/vectors.c
index d47eeb72e..43faa0ed0 100644
--- a/os/ports/GCC/ARMCMx/STM32F1xx/vectors.c
+++ b/os/ports/GCC/ARMCMx/STM32F1xx/vectors.c
@@ -25,6 +25,18 @@
* @defgroup ARMCMx_STM32F1xx_VECTORS STM32F1xx Interrupt Vectors
* @ingroup ARMCMx_SPECIFIC
* @details Interrupt vectors for the STM32F1xx family.
+ * One of the following macros must be defined on the
+ * compiler command line or in a file named <tt>board.h</tt>:
+ * - @p STM32F10X_LD
+ * - @p STM32F10X_LD_VL
+ * - @p STM32F10X_MD
+ * - @p STM32F10X_MD_VL
+ * - @p STM32F10X_HD
+ * - @p STM32F10X_XL
+ * - @p STM32F10X_CL
+ * .
+ * This is required in order to include a vectors table with
+ * the correct length for the specified STM32 model.
* @{
*/
diff --git a/os/ports/GCC/ARMCMx/chcore_v6m.c b/os/ports/GCC/ARMCMx/chcore_v6m.c
index 2183a9ded..4ee3dca1a 100644
--- a/os/ports/GCC/ARMCMx/chcore_v6m.c
+++ b/os/ports/GCC/ARMCMx/chcore_v6m.c
@@ -90,8 +90,12 @@ __attribute__((naked))
#endif
void _port_switch_from_isr(void) {
+ /* The calls to the debug functions are required in order to simulate the
+ correct call protocol from this peculiar code zone.*/
+ dbg_check_lock();
if (chSchIsRescRequiredExI())
chSchDoRescheduleI();
+ dbg_check_unlock();
#if CORTEX_ALTERNATE_SWITCH
SCB_ICSR = ICSR_PENDSVSET;
port_unlock();
@@ -176,7 +180,7 @@ void _port_irq_epilogue(regarm_t lr) {
*/
void _port_thread_start(void) {
- port_unlock();
+ chSysUnlock();
asm volatile ("mov r0, r5 \n\t"
"blx r4 \n\t"
"bl chThdExit");
diff --git a/os/ports/GCC/ARMCMx/chcore_v7m.c b/os/ports/GCC/ARMCMx/chcore_v7m.c
index 39711ce79..5f9be6f4d 100644
--- a/os/ports/GCC/ARMCMx/chcore_v7m.c
+++ b/os/ports/GCC/ARMCMx/chcore_v7m.c
@@ -141,8 +141,12 @@ __attribute__((naked))
#endif
void _port_switch_from_isr(void) {
+ /* The calls to the debug functions are required in order to simulate the
+ correct call protocol from this peculiar code zone.*/
+ dbg_check_lock();
if (chSchIsRescRequiredExI())
chSchDoRescheduleI();
+ dbg_check_unlock();
#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
asm volatile ("svc #0");
#else /* CORTEX_SIMPLIFIED_PRIORITY */
@@ -183,7 +187,7 @@ void _port_switch(Thread *ntp, Thread *otp) {
*/
void _port_thread_start(void) {
- port_unlock();
+ chSysUnlock();
asm volatile ("mov r0, r5 \n\t"
"blx r4 \n\t"
"bl chThdExit");
diff --git a/os/ports/GCC/ARMCMx/crt0.c b/os/ports/GCC/ARMCMx/crt0.c
index 6e4524fa9..e2cb2b3de 100644
--- a/os/ports/GCC/ARMCMx/crt0.c
+++ b/os/ports/GCC/ARMCMx/crt0.c
@@ -33,6 +33,15 @@
typedef void (*funcp_t)(void);
typedef funcp_t * funcpp_t;
+#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
+
+/*===========================================================================*/
+/**
+ * @name Startup settings
+ * @{
+ */
+/*===========================================================================*/
+
/**
* @brief Control special register initialization value.
* @details The system is setup to run in privileged mode using the PSP
@@ -84,7 +93,13 @@ typedef funcp_t * funcpp_t;
#define CRT0_CALL_DESTRUCTORS TRUE
#endif
-#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Symbols from the scatter file
+ */
+/*===========================================================================*/
/**
* @brief Main stack lower boundary.
@@ -94,6 +109,7 @@ typedef funcp_t * funcpp_t;
extern uint32_t __main_stack_base__;
/**
+ *
* @brief Main stack initial position.
* @details This symbol must be exported by the linker script and represents
* the main stack initial position.
@@ -168,6 +184,8 @@ extern funcp_t __fini_array_start;
*/
extern funcp_t __fini_array_end;
+/** @} */
+
/**
* @brief Application @p main() function.
*/
diff --git a/os/ports/GCC/ARMCMx/port.dox b/os/ports/GCC/ARMCMx/port.dox
index 8f5efc9aa..13ab36d8a 100644
--- a/os/ports/GCC/ARMCMx/port.dox
+++ b/os/ports/GCC/ARMCMx/port.dox
@@ -126,19 +126,6 @@
* stack where all the interrupts and exceptions are processed.
* - The threads are started in thread-privileged mode.
* - Interrupt nesting and the other advanced core/NVIC features are supported.
- * - When using an STM32 one of the following macros must be defined on the
- * compiler command line or in a file named <tt>board.h</tt>:
- * - @p STM32F10X_LD
- * - @p STM32F10X_LD_VL
- * - @p STM32F10X_MD
- * - @p STM32F10X_MD_VL
- * - @p STM32F10X_HD
- * - @p STM32F10X_XL
- * - @p STM32F10X_CL
- * .
- * This is required in order to include a vectors table with the correct
- * length for the STM32 model, see the file
- * <tt>./os/ports/GCC/ARMCMx/STM32/vectors.c</tt>.
* - The Cortex-Mx port is perfectly generic, support for more devices can be
* easily added by adding a subdirectory under <tt>./os/ports/GCC/ARMCMx</tt>
* and giving it the name of the new device, then copy the files from another
@@ -211,25 +198,27 @@
* @section ARMCMx_STARTUP_1 Startup Process
* The startup process, as implemented, is the following:
* -# Interrupts are masked globally.
- * -# The two stacks are initialized by assigning them the sizes defined in the
- * linker script (usually named @p ch.ld). Stack areas are allocated from
- * the highest RAM location downward.
+ * -# The two stacks are initialized by assigning them the sizes defined in
+ * the linker script (also known as scatter file).
* -# The CPU state is switched to Privileged and the PSP stack is used.
* -# An early initialization routine @p __early_init() is invoked, if the
* symbol is not defined then an empty default routine is executed
* (weak symbol).
* -# DATA and BSS segments are initialized.
+ * -# Constructors are invoked.
* -# The @p main() function is invoked with no parameters.
- * -# Should the @p main() function return a branch is performed to the weak
- * symbol _main_exit_handler. The default code is an endless empty loop.
+ * -# Destructors are invoked.
+ * -# A branch is performed to the weak symbol @p _default_exit(). The
+ * default code is an endless empty loop.
* .
* @section ARMCMx_STARTUP_2 Expected linker symbols
* The startup code starts at the symbol @p ResetHandler and expects the
* following symbols to be defined in the linker script:
* - @p __ram_end__ End of RAM.
- * - @p __main_stack_size__ Exception stack size.
- * - @p __process_stack_size__ Process stack size. This is the stack area used
- * by the @p main() function.
+ * - @p __main_stack_base__ Main stack lower boundary.
+ * - @p __main_stack_end__ Main stack initial position.
+ * - @p __process_stack_base__ Process stack lower boundary.
+ * - @p __process_stack_end__ Process stack initial position.
* - @p _textdata Address of the data segment source read only data.
* - @p _data Start of the data segment.
* - @p _edata End of the data segment end location.
diff --git a/os/ports/GCC/PPC/SPC56x/ivor.s b/os/ports/GCC/PPC/SPC56x/ivor.s
index 7f470d26a..660fab5ed 100644
--- a/os/ports/GCC/PPC/SPC56x/ivor.s
+++ b/os/ports/GCC/PPC/SPC56x/ivor.s
@@ -71,7 +71,7 @@ IVOR10:
lis %r3, 0x0800 /* DIS bit mask. */
mtspr 336, %r3 /* TSR register. */
- /* System tick handler invokation.*/
+ /* System tick handler invocation.*/
bl chSysTimerHandlerI
bl chSchIsRescRequiredExI
cmpli cr0, %r3, 0