AW: AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning
Gabriel.Moyano at dlr.de
Gabriel.Moyano at dlr.de
Fri Apr 8 06:28:30 UTC 2022
> >> PPS device drivers should use the kernel space API. Since we don't
> >> have a user and kernel space in RTEMS, the kerne space API should be available also if __rtems__ is defined.
> >
> > So, you mean to remove the #ifdef _KERNEL using #ifndef__rtems__.
>
> It is an
>
> #ifdef _KERNEL
> ...
> #else /* !_KERNEL */
> ...
> #endif /* KERNEL */
>
> In RTEMS we need both APIs, one for PPS drivers and the other for applications.
>
> If we don't want to change the header, then PPS drivers have to do something like this:
>
> #define _KERNEL
> #include <sys/timepps.h>
Yes, that's why added the #define _KERNEL in kern_ntptime.c.
What it is your suggestion here?
> There should be a new chapter in
>
> https://docs.rtems.org/branches/master/bsp-howto/index.html
>
> for the PPS drivers.
ok
> >
> >>>
> >>> hardpps() is declared if _KERNEL is defined. That's why I added it
> >>> before including timepps.h in kern_ntptime.c It was for removing a warning.
> >>>
> >>>> The hardpps() needs to be added to the _ namespace, for example _NTP_Pulse_per_second_event().
> >>>
> >>> Here I didn't follow you
> >>
> >> The FreeBSD kernel has its own symbol namespace which is separated
> >> from the application. In RTEMS, the kernel and application share a symbol namespace. Kernel functions should use the _
> namespace.
> >>
> > And here you mean to do something similar to what have to be done for tc_getfrequency() ( declare
> _Timecounter_Get_frequency())?
>
> Yes, maybe add the declaration and documentation to <rtems/score/timecounter.h> and name the function
> _Timecouter_Process_pulse_per_second_event().
>
More information about the devel
mailing list