arch: arc: update the ARC port

* remove unused codes and definition

Signed-off-by: Jingru <jingru@synopsys.com>
This commit is contained in:
Jingru
2020-05-06 15:43:26 +08:00
parent 86375271fc
commit 204d269794
9 changed files with 10 additions and 109 deletions

13
.vscode/settings.json vendored
View File

@@ -1,13 +0,0 @@
{
"files.associations": {
"arc_exception.h": "c",
"arc_timer.h": "c",
"board.h": "c",
"console_io.h": "c",
"xprintf.h": "c",
"array": "c",
"string_view": "c",
"initializer_list": "c",
"utility": "c"
}
}

View File

@@ -15,31 +15,6 @@
* within TencentOS.
*---------------------------------------------------------------------------*/
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _PORT_H_
#define _PORT_H_

View File

@@ -15,31 +15,6 @@
* within TencentOS.
*---------------------------------------------------------------------------*/
/*
* The MIT License (MIT)
*
* Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "tos_k.h"
#include "arc/arc_timer.h"
#include "board.h"
@@ -50,14 +25,14 @@ __PORT__ void port_cpu_reset(void)
exc_entry_reset();
}
__PORT__ void port_systick_config(uint32_t cycle_per_tick) // Configure SysTick to generate an interrupt every cycle_per_tick
__PORT__ void port_systick_config(uint32_t cycle_per_tick)
{
arc_timer_int_clear(0); // nsim #define BOARD_SYS_TIMER_ID TIMER_0
board_timer_update(cycle_per_tick); // board.c
arc_timer_int_clear(0);
board_timer_update(cycle_per_tick);
}
__PORT__ void port_systick_priority_set(uint32_t prio) // Sets the int priority
__PORT__ void port_systick_priority_set(uint32_t prio)
{
int_pri_set(BOARD_OS_TIMER_INTNO, prio); // get system tick from timer 0 arc_timer.h
int_pri_set(BOARD_OS_TIMER_INTNO, prio);
}
@@ -76,7 +51,7 @@ __PORT__ k_time_t port_systick_max_delay_millisecond(void)
__PORT__ void port_systick_resume(void)
{
arc_aux_write(AUX_TIMER0_CTRL, TIMER_CTRL_IE); // enables the generation of an interrupt after the timer has reached its limit
arc_aux_write(AUX_TIMER0_CNT, 0); //Writing to this register sets 0 for the timer, and restarts the timer
arc_aux_write(AUX_TIMER0_CNT, 0); // writing to this register sets 0 for the timer, and restarts the timer
}
__PORT__ void port_systick_suspend(void)
@@ -126,22 +101,3 @@ __PORT__ void port_standby_mode_enter(void)
}
#endif
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
__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)
{
k_fault_log_writer("\n\n====================== Fault Diagnosis Handler =====================\n");
}
#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

View File

@@ -24,7 +24,4 @@
#define TOS_CFG_CPU_HRTIMER_EN 0u
#define TOS_CFG_CPU_LEAD_ZEROS_ASM_PRESENT 0u
#define TOS_CFG_CPU_ARM_FPU_EN 0u
#endif /* _PORT_CONFIG_H_ */

View File

@@ -316,4 +316,4 @@ port_cpu_clz:
ffs r1, r0
add r0, r1, 1
cpu_clz_return:
j [blink]
j [blink]

View File

@@ -20,17 +20,7 @@
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
typedef int (*k_fault_log_writer_t)(const char *format, ...);
#define K_FAULT_STACK_DUMP_DEPTH 10u
#define K_FAULT_CALL_STACK_BACKTRACE_DEPTH 5u
__API__ void tos_fault_log_writer_set(k_fault_log_writer_t log_writer);
__KERNEL__ int fault_default_log_writer(const char *format, ...);
__KERNEL__ void fault_backtrace(cpu_addr_t lr, fault_exc_frame_t *frame);
#error "unsupport now"
#endif

View File

@@ -260,7 +260,3 @@ __KNL__ k_err_t cpu_task_stack_draught_depth(k_stack_t *stk_base, size_t stk_siz
}
#endif
#if TOS_CFG_FAULT_BACKTRACE_EN > 0u
#endif /* TOS_CFG_FAULT_BACKTRACE_EN */

View File

@@ -53,4 +53,4 @@ int main(void)
osThreadCreate(osThread(application_entry), NULL);
/* start kernel */
osKernelStart();
}
}

View File

@@ -261,7 +261,7 @@ clean:
-rm -fR $(BUILD_DIR)
nsim_debug : $(BUILD_DIR)/$(TARGET).elf
mdb -nooptions -nogoifmain -toggle=include_local_symbols=1 -nsim -off=binary_stdin -off=binary_stdout -on=load_at_paddr -on=reset_upon_restart -off=flush_pipe -off=cr_for_more -OKN @$(MDB_ARG_FILE) $<
mdb -nooptions -nogoifmain -toggle=include_local_symbols=1 -nsim -off=binary_stdin -off=binary_stdout -on=load_at_paddr -on=reset_upon_restart -off=flush_pipe -off=cr_for_more -OKN @$(MDB_ARG_FILE) $<
#######################################
# dependencies
#######################################