summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/nds32/task.c15
-rw-r--r--core/riscv-rv32i/task.c15
2 files changed, 16 insertions, 14 deletions
diff --git a/core/nds32/task.c b/core/nds32/task.c
index e92e418fba..74b7501acc 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -52,10 +52,10 @@ static const char * const task_names[] = {
#ifdef CONFIG_TASK_PROFILING
static int task_will_switch;
-static uint64_t exc_sub_time;
+static uint32_t exc_sub_time;
static uint64_t task_start_time; /* Time task scheduling started */
-static uint64_t exc_start_time; /* Time of task->exception transition */
-static uint64_t exc_end_time; /* Time of exception->task transition */
+static uint32_t exc_start_time; /* Time of task->exception transition */
+static uint32_t exc_end_time; /* Time of exception->task transition */
static uint64_t exc_total_time; /* Total time in exceptions */
static uint32_t svc_calls; /* Number of service calls */
static uint32_t task_switches; /* Number of times active task changed */
@@ -330,7 +330,7 @@ static inline void __schedule(int desched, int resched, int swirq)
void update_exc_start_time(void)
{
#ifdef CONFIG_TASK_PROFILING
- exc_start_time = get_time().val;
+ exc_start_time = get_time().le.lo;
#endif
}
@@ -367,14 +367,14 @@ void __ram_code start_irq_handler(void)
void end_irq_handler(void)
{
#ifdef CONFIG_TASK_PROFILING
- uint64_t t, p;
+ uint32_t t, p;
/*
* save r0 and fp (fp for restore r0-r5, r15, fp, lp and sp
* while interrupt exit.
*/
asm volatile ("smw.adm $r0, [$sp], $r0, 8");
- t = get_time().val;
+ t = get_time().le.lo;
p = t - exc_start_time;
exc_total_time += p;
@@ -767,7 +767,8 @@ void task_pre_init(void)
int task_start(void)
{
#ifdef CONFIG_TASK_PROFILING
- task_start_time = exc_end_time = get_time().val;
+ task_start_time = get_time().val;
+ exc_end_time = get_time().le.lo;
#endif
return __task_start();
diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c
index 14f204f8a2..1182aaac82 100644
--- a/core/riscv-rv32i/task.c
+++ b/core/riscv-rv32i/task.c
@@ -46,10 +46,10 @@ static const char * const task_names[] = {
#ifdef CONFIG_TASK_PROFILING
static int task_will_switch;
-static uint64_t exc_sub_time;
+static uint32_t exc_sub_time;
static uint64_t task_start_time; /* Time task scheduling started */
-static uint64_t exc_start_time; /* Time of task->exception transition */
-static uint64_t exc_end_time; /* Time of exception->task transition */
+static uint32_t exc_start_time; /* Time of task->exception transition */
+static uint32_t exc_end_time; /* Time of exception->task transition */
static uint64_t exc_total_time; /* Total time in exceptions */
static uint32_t svc_calls; /* Number of service calls */
static uint32_t task_switches; /* Number of times active task changed */
@@ -307,7 +307,7 @@ static inline void __schedule(int desched, int resched, int swirq)
void __ram_code update_exc_start_time(void)
{
#ifdef CONFIG_TASK_PROFILING
- exc_start_time = get_time().val;
+ exc_start_time = get_time().le.lo;
#endif
}
@@ -364,9 +364,9 @@ error:
void __ram_code end_irq_handler(void)
{
#ifdef CONFIG_TASK_PROFILING
- uint64_t t, p;
+ uint32_t t, p;
- t = get_time().val;
+ t = get_time().le.lo;
p = t - exc_start_time;
exc_total_time += p;
@@ -722,7 +722,8 @@ void task_pre_init(void)
int task_start(void)
{
#ifdef CONFIG_TASK_PROFILING
- task_start_time = exc_end_time = get_time().val;
+ task_start_time = get_time().val;
+ exc_end_time = get_time().le.lo;
#endif
return __task_start();