From 9a3d0a0ea2be3b6c01ec7d5cd1efedb317b88aa3 Mon Sep 17 00:00:00 2001 From: aozima Date: Mon, 29 Nov 2021 18:49:09 +0800 Subject: [PATCH 1/2] cputime support 64bit. --- components/drivers/cputime/cputime.c | 2 +- components/drivers/include/drivers/cputime.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/drivers/cputime/cputime.c b/components/drivers/cputime/cputime.c index 750733f366..490f5725c1 100644 --- a/components/drivers/cputime/cputime.c +++ b/components/drivers/cputime/cputime.c @@ -34,7 +34,7 @@ float clock_cpu_getres(void) * * @return the cpu tick */ -uint32_t clock_cpu_gettime(void) +uint64_t clock_cpu_gettime(void) { if (_cputime_ops) return _cputime_ops->cputime_gettime(); diff --git a/components/drivers/include/drivers/cputime.h b/components/drivers/include/drivers/cputime.h index 26a1e40f8e..ec98f3152e 100644 --- a/components/drivers/include/drivers/cputime.h +++ b/components/drivers/include/drivers/cputime.h @@ -16,11 +16,11 @@ struct rt_clock_cputime_ops { float (*cputime_getres) (void); - uint32_t (*cputime_gettime)(void); + uint64_t (*cputime_gettime)(void); }; float clock_cpu_getres(void); -uint32_t clock_cpu_gettime(void); +uint64_t clock_cpu_gettime(void); uint32_t clock_cpu_microsecond(uint32_t cpu_tick); uint32_t clock_cpu_millisecond(uint32_t cpu_tick); From c2fec1bf451cae018ae6535bb9a68d19ca8e6abb Mon Sep 17 00:00:00 2001 From: aozima Date: Mon, 29 Nov 2021 18:49:30 +0800 Subject: [PATCH 2/2] update cputime_cortexm.c support 64bit. --- components/drivers/cputime/cputime_cortexm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/drivers/cputime/cputime_cortexm.c b/components/drivers/cputime/cputime_cortexm.c index 071acfe9bb..48ccfdb126 100644 --- a/components/drivers/cputime/cputime_cortexm.c +++ b/components/drivers/cputime/cputime_cortexm.c @@ -24,7 +24,7 @@ static float cortexm_cputime_getres(void) return ret; } -static uint32_t cortexm_cputime_gettime(void) +static uint64_t cortexm_cputime_gettime(void) { return DWT->CYCCNT; }