AW: AW: AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning

2022-04-27 Thread Gabriel.Moyano
> On 08/04/2022 08:28, gabriel.moy...@dlr.de wrote:
>  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 
> > Yes, that's why added the #define _KERNEL in kern_ntptime.c.
> > What it is your suggestion here?
> 
> We have currently no API which needs a _KERNEL define. Maybe we should 
> postpone the decision and keep the need for _KERNEL
> define at this point in time.
> 
Is it possible to comment them out with /* */? Because adding the #define 
_KERNEL and #include  could generate some issues while compiling 
and this depends on the position where the header was included
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: AW: AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning

2022-04-07 Thread Sebastian Huber

On 08/04/2022 08:28, gabriel.moy...@dlr.de wrote:

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 

Yes, that's why added the #define _KERNEL in kern_ntptime.c.
What it is your suggestion here?


We have currently no API which needs a _KERNEL define. Maybe we should 
postpone the decision and keep the need for _KERNEL define at this point 
in time.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@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/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

AW: AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning

2022-04-07 Thread Gabriel.Moyano
> >> 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 

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 
>  and name the function
> _Timecouter_Process_pulse_per_second_event().
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning

2022-04-07 Thread Sebastian Huber

On 07/04/2022 16:05, gabriel.moy...@dlr.de wrote:

On 07/04/2022 14:51, gabriel.moy...@dlr.de wrote:

On 07/04/2022 11:56, gabriel.moy...@dlr.de wrote:

On 07/04/2022 10:36, Gabriel Moyano wrote:

---
 cpukit/score/src/kern_ntptime.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpukit/score/src/kern_ntptime.c
b/cpukit/score/src/kern_ntptime.c index d4a233f67e..d6ea739f5b
100644
--- a/cpukit/score/src/kern_ntptime.c
+++ b/cpukit/score/src/kern_ntptime.c
@@ -58,6 +58,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef __rtems__
+#define_KERNEL
+#endif /* __rtems__ */
 #include 
 #ifndef __rtems__
 #include 

Who is supposed to use the _KERNEL  API?


hardpps()


The pps_*() API should be accessible for RTEMS drivers without having to define 
_KERNEL.


The API functions start with time_pps_*().


This is the user space API. It uses a file descriptor.

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 

There should be a new chapter in

https://docs.rtems.org/branches/master/bsp-howto/index.html

for the PPS drivers.





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 
 and name the function 
_Timecouter_Process_pulse_per_second_event().


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@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/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

AW: AW: AW: [PATCH 11/12] kern_ntptime: Add define in order to remove warning

2022-04-07 Thread Gabriel.Moyano
> On 07/04/2022 14:51, gabriel.moy...@dlr.de wrote:
> >> On 07/04/2022 11:56, gabriel.moy...@dlr.de wrote:
>  On 07/04/2022 10:36, Gabriel Moyano wrote:
> > ---
> > cpukit/score/src/kern_ntptime.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/cpukit/score/src/kern_ntptime.c
> > b/cpukit/score/src/kern_ntptime.c index d4a233f67e..d6ea739f5b
> > 100644
> > --- a/cpukit/score/src/kern_ntptime.c
> > +++ b/cpukit/score/src/kern_ntptime.c
> > @@ -58,6 +58,9 @@ __FBSDID("$FreeBSD$");
> > #include 
> > #include 
> > #include 
> > +#ifdef __rtems__
> > +#define_KERNEL
> > +#endif /* __rtems__ */
> > #include 
> > #ifndef __rtems__
> > #include 
>  Who is supposed to use the _KERNEL  API?
> 
> >>> hardpps()
> >>
> >> The pps_*() API should be accessible for RTEMS drivers without having to 
> >> define _KERNEL.
> >
> > The API functions start with time_pps_*().
> 
> This is the user space API. It uses a file descriptor.
> 
> 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__.

> >
> > 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())?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel