[PATCH v2 1/1] bsps/riscv: Add per cpu clock interrupt

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Tue Mar 23 08:14:18 UTC 2021



> -----Original Message-----
> From: Sebastian Huber <sebastian.huber at embedded-brains.de>
> Sent: Monday, March 22, 2021 5:28 PM
> To: Sommer, Jan <Jan.Sommer at dlr.de>; devel at rtems.org
> Subject: Re: [PATCH v2 1/1] bsps/riscv: Add per cpu clock interrupt
> 
> 
> On 22/03/2021 16:56, Jan Sommer wrote:
> > diff --git a/bsps/riscv/riscv/clock/clockdrv.c
> > b/bsps/riscv/riscv/clock/clockdrv.c
> > index d085b6bd95..e8a39c8591 100644
> > --- a/bsps/riscv/riscv/clock/clockdrv.c
> > +++ b/bsps/riscv/riscv/clock/clockdrv.c
> > @@ -41,6 +41,7 @@
> >   #include <rtems/timecounter.h>
> >   #include <rtems/score/cpuimpl.h>
> >   #include <rtems/score/riscv-utility.h>
> > +#include <rtems/score/smpimpl.h>
> >
> >   #include <libfdt.h>
> >
> > @@ -92,13 +93,18 @@ static void riscv_clock_at_tick(riscv_timecounter
> *tc)
> >   {
> >     volatile RISCV_CLINT_regs *clint;
> >     uint64_t value;
> > +  uint32_t cpu = 0;
> > +
> > +#if defined(RTEMS_SMP)
> > +  cpu = _CPU_SMP_Get_current_processor(); #endif
> You can use rtems_scheduler_get_processor() to get rid of this include of an
> implementation header and the #if.
> 

Great. I was looking for that, but thought the function should be used by higher level applications because of the scheduler in the name.
Should have looked closer to see that it will end up _CPU_SMP_Get_current_processor in the end anyways.

Thanks, 

    Jan

> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
> 
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list