From 25c2c3da7c2b0d03677a4d844d473ae80765305e Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Sun, 12 Jun 2022 19:43:30 -0400 Subject: [PATCH] pre-support rt-thread software package --- SConscript | 18 ++++++++++++++++++ .../perf_os_patch_freertos.c | 0 .../perf_os_patch_rtx5.c | 0 .../perf_os_patch_threadx.c | 0 .../rt-thread/perf_os_patch_rt_thread.c | 0 systick_wrapper_gcc.s | 4 ++-- 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 SConscript rename perf_os_patch_freertos.c => os/perf_os_patch_freertos.c (100%) rename perf_os_patch_rtx5.c => os/perf_os_patch_rtx5.c (100%) rename perf_os_patch_threadx.c => os/perf_os_patch_threadx.c (100%) rename perf_os_patch_rt_thread.c => os/rt-thread/perf_os_patch_rt_thread.c (100%) diff --git a/SConscript b/SConscript new file mode 100644 index 0000000..26bd410 --- /dev/null +++ b/SConscript @@ -0,0 +1,18 @@ +Import('rtconfig') +from building import * + +src = ['perf_counter.c', 'os/rt-thread/perf_os_patch_rt_thread.c'] + +if rtconfig.PLATFORM in ['armcc', 'armclang']: # Keil-MDK + src += ['systick_wrapper_ual.s'] + +if rtconfig.PLATFORM == 'gcc': + src += ['systick_wrapper_gcc.s'] + +cwd = GetCurrentDir() +path = [cwd] +group = [] + +group = DefineGroup('perf_counter', src, depend = ['PKG_USING_PERFCOUNTER'], CPPPATH = path) + +Return('group') diff --git a/perf_os_patch_freertos.c b/os/perf_os_patch_freertos.c similarity index 100% rename from perf_os_patch_freertos.c rename to os/perf_os_patch_freertos.c diff --git a/perf_os_patch_rtx5.c b/os/perf_os_patch_rtx5.c similarity index 100% rename from perf_os_patch_rtx5.c rename to os/perf_os_patch_rtx5.c diff --git a/perf_os_patch_threadx.c b/os/perf_os_patch_threadx.c similarity index 100% rename from perf_os_patch_threadx.c rename to os/perf_os_patch_threadx.c diff --git a/perf_os_patch_rt_thread.c b/os/rt-thread/perf_os_patch_rt_thread.c similarity index 100% rename from perf_os_patch_rt_thread.c rename to os/rt-thread/perf_os_patch_rt_thread.c diff --git a/systick_wrapper_gcc.s b/systick_wrapper_gcc.s index 070c79f..5455598 100644 --- a/systick_wrapper_gcc.s +++ b/systick_wrapper_gcc.s @@ -28,10 +28,10 @@ __wrap_SysTick_Handler: push {r4, r5} - push {r4, lr} + push {r4, lr} ldr R0, =user_code_insert_to_systick_handler blx R0 - pop {r4, r5} + pop {r4, r5} mov lr, r5 pop {r4, r5} ldr R0, =__real_SysTick_Handler