diff --git a/arch/arc/arcem/port_c.c b/arch/arc/arcem/port_c.c index ab27396b..ab52dc9e 100644 --- a/arch/arc/arcem/port_c.c +++ b/arch/arc/arcem/port_c.c @@ -57,7 +57,7 @@ __PORT__ void port_systick_config(uint32_t cycle_per_tick) // Configure SysTick } __PORT__ void port_systick_priority_set(uint32_t prio) // Sets the int priority { - int_pri_set(INTNO_TIMER0, prio); // get system tick from timer 0 arc_timer.h + int_pri_set(BOARD_OS_TIMER_INTNO, prio); // get system tick from timer 0 arc_timer.h } @@ -103,7 +103,6 @@ __PORT__ void port_systick_reload(uint32_t cycle_per_tick) __PORT__ void port_systick_pending_reset(void) { - // SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk; arc_aux_write(AUX_TIMER0_CTRL, TIMER_CTRL_IP); // interrupt pending } @@ -132,14 +131,11 @@ __PORT__ void port_standby_mode_enter(void) __STATIC__ void port_fault_do_diagnosis(port_fault_regs_t *regs) // 硬件错误诊断 { k_fault_log_writer("\n\n====================== Fault Diagnosis =====================\n"); - - } __PORT__ void port_fault_diagnosis(void) { k_fault_log_writer("\n\n====================== Fault Diagnosis .. =====================\n"); - } __PORT__ void __NAKED__ HardFault_Handler(void) diff --git a/arch/arc/arcem/port_config.h b/arch/arc/arcem/port_config.h index 6a15bfd4..845c2fc8 100644 --- a/arch/arc/arcem/port_config.h +++ b/arch/arc/arcem/port_config.h @@ -16,7 +16,7 @@ *---------------------------------------------------------------------------*/ #ifndef _PORT_CONFIG_H_ -#define _PORT_CONFIG_H_ +#define _PORT_CONFIG_H_ #define TOS_CFG_CPU_ADDR_SIZE CPU_WORD_SIZE_32 #define TOS_CFG_CPU_DATA_SIZE CPU_WORD_SIZE_32 diff --git a/arch/arc/arcem/port_s.s b/arch/arc/arcem/port_s.s index e6b284aa..23fd5c13 100644 --- a/arch/arc/arcem/port_s.s +++ b/arch/arc/arcem/port_s.s @@ -11,6 +11,7 @@ .global k_curr_task .global k_next_task +.global g_exc_nest_count .global g_context_switch_reqflg .global tos_knl_irq_enter @@ -145,9 +146,9 @@ exc_entry_cpu: mov blink, sp mov r3, sp /* as exception handler's para(p_excinfo) */ - ld r0, [k_irq_nest_cnt] + ld r0, [g_exc_nest_count] add r1, r0, 1 - st r1, [k_irq_nest_cnt] + st r1, [g_exc_nest_count] brne r0, 0, exc_handler_1 /* change to exception stack if interrupt happened in task context */ mov sp, _e_stack @@ -169,7 +170,7 @@ exc_handler_1: /* interrupts are not allowed */ ret_exc: POP sp - mov r1, k_irq_nest_cnt + mov r1, g_exc_nest_count ld r0, [r1] sub r0, r0, 1 st r0, [r1] @@ -236,9 +237,9 @@ exc_entry_int: mov blink, sp clri /* disable interrupt */ - ld r3, [k_irq_nest_cnt] + ld r3, [g_exc_nest_count] add r2, r3, 1 - st r2, [k_irq_nest_cnt] + st r2, [g_exc_nest_count] seti /* enable higher priority interrupt */ brne r3, 0, irq_handler_1 @@ -282,7 +283,7 @@ ret_int: clri /* disable interrupt */ POP r3 /* irq priority */ POP sp - mov r1, k_irq_nest_cnt + mov r1, g_exc_nest_count ld r0, [r1] sub r0, r0, 1 st r0, [r1] diff --git a/arch/arc/common/tos_cpu.c b/arch/arc/common/tos_cpu.c index 7b91d17f..11eb0838 100644 --- a/arch/arc/common/tos_cpu.c +++ b/arch/arc/common/tos_cpu.c @@ -18,7 +18,7 @@ #include #include "embARC.h" -void tos_cup_tick_handler(void) +void tos_cpu_tick_handler(void) { arc_timer_int_clear(BOARD_OS_TIMER_ID); tos_tick_handler(); @@ -115,7 +115,7 @@ __KNL__ void cpu_systick_init(k_cycle_t cycle_per_tick) arc_timer_stop(BOARD_OS_TIMER_ID); arc_timer_start(BOARD_OS_TIMER_ID, TIMER_CTRL_IE | TIMER_CTRL_NH, cycle_per_tick); - int_handler_install(BOARD_OS_TIMER_INTNO, (INT_HANDLER_T)tos_cup_tick_handler); + int_handler_install(BOARD_OS_TIMER_INTNO, (INT_HANDLER_T)tos_cpu_tick_handler); int_pri_set(BOARD_OS_TIMER_INTNO, INT_PRI_MIN + 1); int_enable(BOARD_OS_TIMER_INTNO); } @@ -200,7 +200,7 @@ __KNL__ void cpu_standby_mode_enter(void) #endif /* TOS_CFG_PWR_MGR_EN */ uint32_t g_context_switch_reqflg; - +uint32_t g_exc_nest_count; extern void start_r(void); #if ARC_FEATURE_STACK_CHECK diff --git a/board/ARC_NSIM_EM/hello_world/.project b/board/ARC_NSIM_EM/hello_world/.project deleted file mode 100644 index 4ab3d89a..00000000 --- a/board/ARC_NSIM_EM/hello_world/.project +++ /dev/null @@ -1,84 +0,0 @@ - - - blinky - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - Makefile - 1 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/board/ARC_NSIM_EM/GCC/hello_world/Makefile - - - tencentos - 2 - virtual:/virtual - - - tencentos/arch - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/arch - - - tencentos/board - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/board - - - tencentos/components - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/components - - - tencentos/devices - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/devices - - - tencentos/kernel - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/kernel - - - tencentos/net - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/net - - - tencentos/osal - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/osal - - - tencentos/platform - 2 - C:/Users/jingru/Documents/git/embarc/TencentOS-tiny/platform - - - - - TencentOS_ROOT - file:/C:/Users/jingru/Documents/git/tencentos/TencentOS-tiny - - - diff --git a/board/ARC_NSIM_EM/hello_world/Makefile b/board/ARC_NSIM_EM/hello_world/Makefile index f66ee1f0..1fc9980e 100644 --- a/board/ARC_NSIM_EM/hello_world/Makefile +++ b/board/ARC_NSIM_EM/hello_world/Makefile @@ -235,13 +235,7 @@ vpath %.S $(sort $(dir $(ASM_SOURCES_S))) # EMBARC_PREBUILT_LIBRARY = -Hldopt=-Bgrouplib EMBARC_PREBUILT_LIBRARY = $(EMBARC_OUT_DIR)/libembarc.a -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/board/board.o -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/arc/startup/arc_startup.o -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/arc/startup/arc_cxx_support.o -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/libboard_nsim.a -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/libcpuarc.a -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/libembarc_libc.a -# EMBARC_PREBUILT_LIBRARY += $(EMBARC_OUT_DIR)/libembarc_console.a + build_embarc_lib: | $(BUILD_DIR) make -f $(EMBARC_BSP_ROOT)/options/options.mk V=1 embarc_lib diff --git a/board/ARC_NSIM_EM/hello_world/mw.log b/board/ARC_NSIM_EM/hello_world/mw.log deleted file mode 100644 index 6a3d4eaf..00000000 Binary files a/board/ARC_NSIM_EM/hello_world/mw.log and /dev/null differ