From mboxrd@z Thu Jan 1 00:00:00 1970 References: <20210122021240.18768-1-hongzhan.chen@intel.com> <20210122021240.18768-2-hongzhan.chen@intel.com> From: Philippe Gerum Subject: Re: [PATCH V2 2/5] cobalt/tick: dovetail: implement pipeline_timer_name In-reply-to: <20210122021240.18768-2-hongzhan.chen@intel.com> Date: Sun, 24 Jan 2021 18:05:37 +0100 Message-ID: <877do28dum.fsf@xenomai.org> MIME-Version: 1.0 Content-Type: text/plain List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: hongzha1 Cc: xenomai@xenomai.org hongzha1 via Xenomai writes: > Get the name of real device controlled by the proxy tick device. > > Signed-off-by: hongzha1 > > diff --git a/include/cobalt/kernel/dovetail/pipeline/clock.h b/include/cobalt/kernel/dovetail/pipeline/clock.h > index 7b6ce161c..6761ed70d 100644 > --- a/include/cobalt/kernel/dovetail/pipeline/clock.h > +++ b/include/cobalt/kernel/dovetail/pipeline/clock.h > @@ -19,16 +19,7 @@ static inline u64 pipeline_read_cycle_counter(void) > > void pipeline_set_timer_shot(unsigned long cycles); > > -static inline const char *pipeline_timer_name(void) > -{ > - /* > - * Return the name of the current clock event chip, which is > - * the real device controlled by the proxy tick device. > - */ > - TODO(); > - > - return "?"; > -} > +const char *pipeline_timer_name(void); > > static inline const char *pipeline_clock_name(void) > { > diff --git a/kernel/cobalt/dovetail/tick.c b/kernel/cobalt/dovetail/tick.c > index 75d908bd4..1b622defb 100644 > --- a/kernel/cobalt/dovetail/tick.c > +++ b/kernel/cobalt/dovetail/tick.c > @@ -16,6 +16,18 @@ extern struct xnintr nktimer; > > static DEFINE_PER_CPU(struct clock_proxy_device *, proxy_device); > > +const char *pipeline_timer_name(void) > +{ > + struct clock_proxy_device *dev = __this_cpu_read(proxy_device); > + struct clock_event_device *real_dev = dev->real_device; > + > + /* > + * Return the name of the current clock event chip, which is > + * the real device controlled by the proxy tick device. > + */ > + return real_dev->name; > +} > + > void pipeline_set_timer_shot(unsigned long cycles) > { > struct clock_proxy_device *dev = __this_cpu_read(proxy_device); Merged, thanks. -- Philippe.