diff --git a/libcpu/arm/cortex-m3/context_gcc.S b/libcpu/arm/cortex-m3/context_gcc.S index a0914749042be26667df1134d8ae286f6879fe43..6c981bdfb36d461ff30e15081d31c1a6d1c4b8be 100644 --- a/libcpu/arm/cortex-m3/context_gcc.S +++ b/libcpu/arm/cortex-m3/context_gcc.S @@ -1,28 +1,20 @@ -/***************************************************************************//** - * @file context_gcc.S - * @brief Context switch functions - * COPYRIGHT (C) 2011, RT-Thread Development Team - * @author Bernard, onelife - * @version 0.4 beta - ******************************************************************************* - * @section License - * The license and distribution terms for this file may be found in the file - * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE - ******************************************************************************* - * @section Change Logs - * Date Author Notes - * 2009-10-11 Bernard first version - * 2010-12-29 onelife Modify for EFM32 - * 2011-06-17 onelife Merge all of the assembly source code into - * context_gcc.S - * 2011-07-12 onelife Add interrupt context check function - ******************************************************************************/ +/* + * File : context_gcc.S + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2009 - 2011, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: + * Date Author Notes + * 2009-10-11 Bernard First version + * 2010-12-29 onelife Modify for EFM32 + * 2011-06-17 onelife Merge all of the assembly source code into context_gcc.S + * 2011-07-12 onelife Add interrupt context check function + */ -/***************************************************************************//** -* @addtogroup cortex-m3 -* @{ - ******************************************************************************/ - .cpu cortex-m3 .fpu softvfp .syntax unified @@ -35,7 +27,6 @@ .equ SHPR3, 0xE000ED20 /* system priority register (3) */ .equ PENDSV_PRI_LOWEST, 0x00FF0000 /* PendSV priority value (lowest) */ - /* * rt_base_t rt_hw_interrupt_disable(); */ @@ -193,7 +184,3 @@ HardFault_Handler: rt_hw_interrupt_check: MRS R0, IPSR BX LR - -/***************************************************************************//** - * @} - ******************************************************************************/ diff --git a/libcpu/arm/cortex-m3/cpuport.c b/libcpu/arm/cortex-m3/cpuport.c index 8a48b85b78fdfb73a750679ae38f1bc20cbddc14..055afda43c2c11c84c8a9d1add1af7c042694800 100644 --- a/libcpu/arm/cortex-m3/cpuport.c +++ b/libcpu/arm/cortex-m3/cpuport.c @@ -1,31 +1,23 @@ -/******************************************************************//** - * @file cpuport.c - * @brief This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2011, RT-Thread Development Team - * @author Bernard, onelife - * @version 0.4 beta - ********************************************************************** - * @section License - * The license and distribution terms for this file may be found in the file LICENSE in this - * distribution or at http://www.rt-thread.org/license/LICENSE - ********************************************************************** - * @section Change Logs +/* + * File : cpuport.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2011, RT-Thread Development Team + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rt-thread.org/license/LICENSE + * + * Change Logs: * Date Author Notes * 2009-01-05 Bernard first version * 2011-02-14 onelife Modify for EFM32 * 2011-06-17 onelife Merge all of the C source code into cpuport.c - *********************************************************************/ - -/******************************************************************//** -* @addtogroup cortex-m3 -* @{ -*********************************************************************/ + */ -/* Includes -------------------------------------------------------------------*/ #include -/* Private typedef -------------------------------------------------------------*/ -struct stack_contex +/* stack context */ +struct stack_context { rt_uint32_t r0; rt_uint32_t r1; @@ -37,15 +29,13 @@ struct stack_contex rt_uint32_t psr; }; -/* Private define --------------------------------------------------------------*/ -/* Private macro --------------------------------------------------------------*/ -/* Private variables ------------------------------------------------------------*/ -/* exception and interrupt handler table */ +/* flag in interrupt handling */ rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; -/* Private function prototypes ---------------------------------------------------*/ -/* Private functions ------------------------------------------------------------*/ +/** + * initializes stack of thread + */ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, rt_uint8_t *stack_addr, void *texit) { @@ -76,7 +66,10 @@ rt_uint8_t *rt_hw_stack_init(void *tentry, void *parameter, extern void list_thread(void); extern rt_thread_t rt_current_thread; -void rt_hw_hard_fault_exception(struct stack_contex* contex) +/** + * fault exception handling + */ +void rt_hw_hard_fault_exception(struct stack_context* contex) { rt_kprintf("psr: 0x%08x\n", contex->psr); rt_kprintf(" pc: 0x%08x\n", contex->pc); @@ -94,13 +87,12 @@ void rt_hw_hard_fault_exception(struct stack_contex* contex) while (1); } +/** + * shutdown CPU + */ void rt_hw_cpu_shutdown() { rt_kprintf("shutdown...\n"); RT_ASSERT(0); } - -/******************************************************************//** - * @} -*********************************************************************/