From 602739b35d874de509fbe4bb0b5b9b0b754237d9 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Mon, 27 Dec 2021 22:20:20 -0800 Subject: Inlined functions --- src/util/time.c | 14 -------------- src/util/time.h | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 16 deletions(-) (limited to 'src/util') diff --git a/src/util/time.c b/src/util/time.c index f6d8f04..c09567f 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -12,20 +12,6 @@ unsigned long read_core0timer_pending(void) return tmp; } -void enable_cntv(void) -{ - unsigned long cntv_ctl; - cntv_ctl = 1; - asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL -} - -void disable_cntv(void) -{ - unsigned long cntv_ctl; - cntv_ctl = 0; - asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL -} - unsigned long long read_cntvct(void) { unsigned long long val; diff --git a/src/util/time.h b/src/util/time.h index aa74896..13875e2 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -3,12 +3,23 @@ void routing_core0cntv_to_core0irq(void); unsigned long read_core0timer_pending(void); -void enable_cntv(void); -void disable_cntv(void); unsigned long long read_cntvct(void); unsigned long long read_cntvoff(void); unsigned long read_cntv_tval(void); void write_cntv_tval(unsigned long val); unsigned long read_cntfrq(void); +static inline void enablecntv(void) { + unsigned long cntv_ctl; + cntv_ctl = 1; + asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL +} + +static inline void disablecntv(void) +{ + unsigned long cntv_ctl; + cntv_ctl = 0; + asm volatile ("mcr p15, 0, %0, c14, c3, 1" :: "r"(cntv_ctl) ); // write CNTV_CTL +} + #endif -- cgit v1.2.1