All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] y2038: introduce new time representations at the boundary
@ 2021-03-02 13:05 chensong
  2021-03-02 13:10 ` chensong
  2021-03-02 13:44 ` Philippe Gerum
  0 siblings, 2 replies; 8+ messages in thread
From: chensong @ 2021-03-02 13:05 UTC (permalink / raw
  To: florian.bezdeka, xenomai, rpm

Since timespec and timeval will be removed because of
y2038 problem, we need to introduce new time representations at
the kernel-user boundary and we also need to keep aligned with
upstream at the same time.

Therefore, we introduce:
1)__kernel_old_timeval
2)__kernel_old_timespec
from upstream, their tv_sec are defined as long and as a result their width
is able to adapt different arch automatically.

Signed-off-by: chensong <chensong@tj.kylinos.cn>
---
 include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
index 2c931c2..8931d82 100644
--- a/include/cobalt/uapi/kernel/types.h
+++ b/include/cobalt/uapi/kernel/types.h
@@ -20,6 +20,7 @@
 
 #include <linux/types.h>
 #include <cobalt/uapi/kernel/limits.h>
+#include <asm-generic/xenomai/wrappers.h>
 
 typedef __u64 xnticks_t;
 
@@ -78,6 +79,20 @@ struct __user_old_timeval {
 	long  tv_usec;
 };
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
+struct __kernel_old_timeval {
+	__kernel_long_t tv_sec;
+	__kernel_long_t tv_usec;
+};
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
+struct __kernel_old_timespec {
+	__kernel_old_time_t	tv_sec;		/* seconds */
+	long			tv_nsec;	/* nanoseconds */
+};
+#endif
+
 /* Lifted from include/uapi/linux/timex.h. */
 struct __user_old_timex {
 	unsigned int modes;	/* mode selector */
-- 
2.7.4





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-02 13:05 [PATCH] y2038: introduce new time representations at the boundary chensong
@ 2021-03-02 13:10 ` chensong
  2021-03-02 13:43   ` florian.bezdeka
  2021-03-02 13:44 ` Philippe Gerum
  1 sibling, 1 reply; 8+ messages in thread
From: chensong @ 2021-03-02 13:10 UTC (permalink / raw
  To: florian.bezdeka, xenomai, rpm

Florian $ Philippe,

As the discussion in the mails 2021-02-21, we are going to replace 
__user_old_timespec with __kernel_old_timespec to keep aligned with 
upstream.

This patch introduced their definitions, if you both agree, i will start 
replacing __user_old_timespec and __user_old_timeval afterward.

BR

Song

On 2021年03月02日 21:05, chensong wrote:
> Since timespec and timeval will be removed because of
> y2038 problem, we need to introduce new time representations at
> the kernel-user boundary and we also need to keep aligned with
> upstream at the same time.
>
> Therefore, we introduce:
> 1)__kernel_old_timeval
> 2)__kernel_old_timespec
> from upstream, their tv_sec are defined as long and as a result their width
> is able to adapt different arch automatically.
>
> Signed-off-by: chensong <chensong@tj.kylinos.cn>
> ---
>   include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
> index 2c931c2..8931d82 100644
> --- a/include/cobalt/uapi/kernel/types.h
> +++ b/include/cobalt/uapi/kernel/types.h
> @@ -20,6 +20,7 @@
>
>   #include <linux/types.h>
>   #include <cobalt/uapi/kernel/limits.h>
> +#include <asm-generic/xenomai/wrappers.h>
>
>   typedef __u64 xnticks_t;
>
> @@ -78,6 +79,20 @@ struct __user_old_timeval {
>   	long  tv_usec;
>   };
>
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
> +struct __kernel_old_timeval {
> +	__kernel_long_t tv_sec;
> +	__kernel_long_t tv_usec;
> +};
> +#endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
> +struct __kernel_old_timespec {
> +	__kernel_old_time_t	tv_sec;		/* seconds */
> +	long			tv_nsec;	/* nanoseconds */
> +};
> +#endif
> +
>   /* Lifted from include/uapi/linux/timex.h. */
>   struct __user_old_timex {
>   	unsigned int modes;	/* mode selector */
>




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-02 13:10 ` chensong
@ 2021-03-02 13:43   ` florian.bezdeka
  2021-03-04  5:58     ` chensong
  0 siblings, 1 reply; 8+ messages in thread
From: florian.bezdeka @ 2021-03-02 13:43 UTC (permalink / raw
  To: chensong@tj.kylinos.cn
  Cc: rpm@xenomai.org, xenomai@xenomai.org, jan.kiszka@siemens.com

On Tue, 2021-03-02 at 21:10 +0800, chensong wrote:
> Florian $ Philippe,
> 
> As the discussion in the mails 2021-02-21, we are going to replace 
> __user_old_timespec with __kernel_old_timespec to keep aligned with 
> upstream.

Please note the y2038 related patches from Philippe located in the
wip/dovetail branch of the Xenomai repository. That work has already
been done.

> 
> This patch introduced their definitions, if you both agree, i will start 
> replacing __user_old_timespec and __user_old_timeval afterward.
> 
> BR
> 
> Song
> 
> On 2021年03月02日 21:05, chensong wrote:
> > Since timespec and timeval will be removed because of
> > y2038 problem, we need to introduce new time representations at
> > the kernel-user boundary and we also need to keep aligned with
> > upstream at the same time.
> > 
> > Therefore, we introduce:
> > 1)__kernel_old_timeval
> > 2)__kernel_old_timespec
> > from upstream, their tv_sec are defined as long and as a result their width
> > is able to adapt different arch automatically.
> > 
> > Signed-off-by: chensong <chensong@tj.kylinos.cn>
> > ---
> >   include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
> >   1 file changed, 15 insertions(+)
> > 
> > diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
> > index 2c931c2..8931d82 100644
> > --- a/include/cobalt/uapi/kernel/types.h
> > +++ b/include/cobalt/uapi/kernel/types.h
> > @@ -20,6 +20,7 @@
> > 
> >   #include <linux/types.h>
> >   #include <cobalt/uapi/kernel/limits.h>
> > +#include <asm-generic/xenomai/wrappers.h>
> > 
> >   typedef __u64 xnticks_t;
> > 
> > @@ -78,6 +79,20 @@ struct __user_old_timeval {
> >   	long  tv_usec;
> >   };
> > 
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
> > +struct __kernel_old_timeval {
> > +	__kernel_long_t tv_sec;
> > +	__kernel_long_t tv_usec;
> > +};
> > +#endif
> > +
> > +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
> > +struct __kernel_old_timespec {
> > +	__kernel_old_time_t	tv_sec;		/* seconds */
> > +	long			tv_nsec;	/* nanoseconds */
> > +};
> > +#endif
> > +
> >   /* Lifted from include/uapi/linux/timex.h. */
> >   struct __user_old_timex {
> >   	unsigned int modes;	/* mode selector */
> > 
> 
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-02 13:05 [PATCH] y2038: introduce new time representations at the boundary chensong
  2021-03-02 13:10 ` chensong
@ 2021-03-02 13:44 ` Philippe Gerum
  2021-03-04  9:01   ` chensong
  1 sibling, 1 reply; 8+ messages in thread
From: Philippe Gerum @ 2021-03-02 13:44 UTC (permalink / raw
  To: chensong; +Cc: florian.bezdeka, xenomai, jan.kiszka


chensong <chensong@tj.kylinos.cn> writes:

> Since timespec and timeval will be removed because of
> y2038 problem, we need to introduce new time representations at
> the kernel-user boundary and we also need to keep aligned with
> upstream at the same time.
>
> Therefore, we introduce:
> 1)__kernel_old_timeval
> 2)__kernel_old_timespec
> from upstream, their tv_sec are defined as long and as a result their width
> is able to adapt different arch automatically.
>
> Signed-off-by: chensong <chensong@tj.kylinos.cn>
> ---
>  include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
> index 2c931c2..8931d82 100644
> --- a/include/cobalt/uapi/kernel/types.h
> +++ b/include/cobalt/uapi/kernel/types.h
> @@ -20,6 +20,7 @@
>  
>  #include <linux/types.h>
>  #include <cobalt/uapi/kernel/limits.h>
> +#include <asm-generic/xenomai/wrappers.h>
>  
>  typedef __u64 xnticks_t;
>  
> @@ -78,6 +79,20 @@ struct __user_old_timeval {
>  	long  tv_usec;
>  };
>  
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
> +struct __kernel_old_timeval {
> +	__kernel_long_t tv_sec;
> +	__kernel_long_t tv_usec;
> +};
> +#endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
> +struct __kernel_old_timespec {
> +	__kernel_old_time_t	tv_sec;		/* seconds */
> +	long			tv_nsec;	/* nanoseconds */
> +};
> +#endif
> +
>  /* Lifted from include/uapi/linux/timex.h. */
>  struct __user_old_timex {
>  	unsigned int modes;	/* mode selector */


This won't work, the uapi is meant to be parsed by userland too,
independently of the target kernel version. Therefore, testing
LINUX_VERSION_CODE does not make sense there. Hence the reason for
defining __user_old_timespec, which does not conflict with any
pre-existing type in either kernel or userland namespaces.

What you might do instead is defining __kernel_old_timespec to mirror
the same kernel type only if __KERNEL__ is not set, but I would not
recommend checking for __KERNEL__ in this context anyway, since that
defeats the purpose of having separate uapi files.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-02 13:43   ` florian.bezdeka
@ 2021-03-04  5:58     ` chensong
  2021-03-04  9:00       ` florian.bezdeka
  0 siblings, 1 reply; 8+ messages in thread
From: chensong @ 2021-03-04  5:58 UTC (permalink / raw
  To: florian.bezdeka@siemens.com, chensong@tj.kylinos.cn; +Cc: xenomai@xenomai.org



On 2021年03月02日 21:43, florian.bezdeka--- via Xenomai wrote:
> On Tue, 2021-03-02 at 21:10 +0800, chensong wrote:
>> Florian $ Philippe,
>>
>> As the discussion in the mails 2021-02-21, we are going to replace
>> __user_old_timespec with __kernel_old_timespec to keep aligned with
>> upstream.
>
> Please note the y2038 related patches from Philippe located in the
> wip/dovetail branch of the Xenomai repository. That work has already
> been done.
>

Thanks, i was working on the xenomai-rpm, now i move to [1] branch 
wip/dovetail, is it correct?

[1]https://source.denx.de/Xenomai/xenomai.git
>>
>> This patch introduced their definitions, if you both agree, i will start
>> replacing __user_old_timespec and __user_old_timeval afterward.
>>
>> BR
>>
>> Song
>>
>> On 2021年03月02日 21:05, chensong wrote:
>>> Since timespec and timeval will be removed because of
>>> y2038 problem, we need to introduce new time representations at
>>> the kernel-user boundary and we also need to keep aligned with
>>> upstream at the same time.
>>>
>>> Therefore, we introduce:
>>> 1)__kernel_old_timeval
>>> 2)__kernel_old_timespec
>>> from upstream, their tv_sec are defined as long and as a result their width
>>> is able to adapt different arch automatically.
>>>
>>> Signed-off-by: chensong <chensong@tj.kylinos.cn>
>>> ---
>>>    include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
>>>    1 file changed, 15 insertions(+)
>>>
>>> diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
>>> index 2c931c2..8931d82 100644
>>> --- a/include/cobalt/uapi/kernel/types.h
>>> +++ b/include/cobalt/uapi/kernel/types.h
>>> @@ -20,6 +20,7 @@
>>>
>>>    #include <linux/types.h>
>>>    #include <cobalt/uapi/kernel/limits.h>
>>> +#include <asm-generic/xenomai/wrappers.h>
>>>
>>>    typedef __u64 xnticks_t;
>>>
>>> @@ -78,6 +79,20 @@ struct __user_old_timeval {
>>>    	long  tv_usec;
>>>    };
>>>
>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
>>> +struct __kernel_old_timeval {
>>> +	__kernel_long_t tv_sec;
>>> +	__kernel_long_t tv_usec;
>>> +};
>>> +#endif
>>> +
>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
>>> +struct __kernel_old_timespec {
>>> +	__kernel_old_time_t	tv_sec;		/* seconds */
>>> +	long			tv_nsec;	/* nanoseconds */
>>> +};
>>> +#endif
>>> +
>>>    /* Lifted from include/uapi/linux/timex.h. */
>>>    struct __user_old_timex {
>>>    	unsigned int modes;	/* mode selector */
>>>
>>
>>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-04  5:58     ` chensong
@ 2021-03-04  9:00       ` florian.bezdeka
  2021-03-04  9:24         ` chensong
  0 siblings, 1 reply; 8+ messages in thread
From: florian.bezdeka @ 2021-03-04  9:00 UTC (permalink / raw
  To: rpm@xenomai.org, jan.kiszka@siemens.com, chensong@kylinos.cn,
	chensong@tj.kylinos.cn
  Cc: xenomai@xenomai.org

On Thu, 2021-03-04 at 13:58 +0800, chensong wrote:
> 
> On 2021年03月02日 21:43, florian.bezdeka--- via Xenomai wrote:
> > On Tue, 2021-03-02 at 21:10 +0800, chensong wrote:
> > > Florian $ Philippe,
> > > 
> > > As the discussion in the mails 2021-02-21, we are going to replace
> > > __user_old_timespec with __kernel_old_timespec to keep aligned with
> > > upstream.
> > 
> > Please note the y2038 related patches from Philippe located in the
> > wip/dovetail branch of the Xenomai repository. That work has already
> > been done.
> > 
> 
> Thanks, i was working on the xenomai-rpm, now i move to [1] branch 
> wip/dovetail, is it correct?

After a short sync with Jan and the fact that the y2038 related patches
from Philippe are already part of this branch and we need them (even if
currently breaking 32 bit kernels): yes

In addition: I have a wip/y2038 branch on my public gitlab tree ([2]), 
already based on wip/dovetail that I can easily run through the CI of
the xenomai-images project for compile-testing all the different kernel
combinations. Even testing could be enabled in the future.

As patches should always make it to the list, here comes my proposal: 

Feel free to send your patches using a [y2038] (or similar) tag, the
list can review them and I would take care of applying it to [2]. All
others interested in this topic (ongoing integration) could pick them
as well. Philippe already mentioned that he is interested in
integrating them as well.

If all the things in [2] are looking good after some time we can resend
them and ask Jan to apply them (after anther round of review).

> 
> [1] https://source.denx.de/Xenomai/xenomai

  [2] https://gitlab.com/fbezdeka/xenomai/
 
> > > This patch introduced their definitions, if you both agree, i will start
> > > replacing __user_old_timespec and __user_old_timeval afterward.
> > > 
> > > BR
> > > 
> > > Song
> > > 
> > > On 2021年03月02日 21:05, chensong wrote:
> > > > Since timespec and timeval will be removed because of
> > > > y2038 problem, we need to introduce new time representations at
> > > > the kernel-user boundary and we also need to keep aligned with
> > > > upstream at the same time.
> > > > 
> > > > Therefore, we introduce:
> > > > 1)__kernel_old_timeval
> > > > 2)__kernel_old_timespec
> > > > from upstream, their tv_sec are defined as long and as a result their width
> > > > is able to adapt different arch automatically.
> > > > 
> > > > Signed-off-by: chensong <chensong@tj.kylinos.cn>
> > > > ---
> > > >    include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
> > > >    1 file changed, 15 insertions(+)
> > > > 
> > > > diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
> > > > index 2c931c2..8931d82 100644
> > > > --- a/include/cobalt/uapi/kernel/types.h
> > > > +++ b/include/cobalt/uapi/kernel/types.h
> > > > @@ -20,6 +20,7 @@
> > > > 
> > > >    #include <linux/types.h>
> > > >    #include <cobalt/uapi/kernel/limits.h>
> > > > +#include <asm-generic/xenomai/wrappers.h>
> > > > 
> > > >    typedef __u64 xnticks_t;
> > > > 
> > > > @@ -78,6 +79,20 @@ struct __user_old_timeval {
> > > >    	long  tv_usec;
> > > >    };
> > > > 
> > > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
> > > > +struct __kernel_old_timeval {
> > > > +	__kernel_long_t tv_sec;
> > > > +	__kernel_long_t tv_usec;
> > > > +};
> > > > +#endif
> > > > +
> > > > +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
> > > > +struct __kernel_old_timespec {
> > > > +	__kernel_old_time_t	tv_sec;		/* seconds */
> > > > +	long			tv_nsec;	/* nanoseconds */
> > > > +};
> > > > +#endif
> > > > +
> > > >    /* Lifted from include/uapi/linux/timex.h. */
> > > >    struct __user_old_timex {
> > > >    	unsigned int modes;	/* mode selector */
> > > > 
> > > 
> > > 
> > 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-02 13:44 ` Philippe Gerum
@ 2021-03-04  9:01   ` chensong
  0 siblings, 0 replies; 8+ messages in thread
From: chensong @ 2021-03-04  9:01 UTC (permalink / raw
  To: Philippe Gerum, chensong; +Cc: xenomai



On 2021年03月02日 21:44, Philippe Gerum via Xenomai wrote:
>
> chensong <chensong@tj.kylinos.cn> writes:
>
>> Since timespec and timeval will be removed because of
>> y2038 problem, we need to introduce new time representations at
>> the kernel-user boundary and we also need to keep aligned with
>> upstream at the same time.
>>
>> Therefore, we introduce:
>> 1)__kernel_old_timeval
>> 2)__kernel_old_timespec
>> from upstream, their tv_sec are defined as long and as a result their width
>> is able to adapt different arch automatically.
>>
>> Signed-off-by: chensong <chensong@tj.kylinos.cn>
>> ---
>>   include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
>> index 2c931c2..8931d82 100644
>> --- a/include/cobalt/uapi/kernel/types.h
>> +++ b/include/cobalt/uapi/kernel/types.h
>> @@ -20,6 +20,7 @@
>>
>>   #include <linux/types.h>
>>   #include <cobalt/uapi/kernel/limits.h>
>> +#include <asm-generic/xenomai/wrappers.h>
>>
>>   typedef __u64 xnticks_t;
>>
>> @@ -78,6 +79,20 @@ struct __user_old_timeval {
>>   	long  tv_usec;
>>   };
>>
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
>> +struct __kernel_old_timeval {
>> +	__kernel_long_t tv_sec;
>> +	__kernel_long_t tv_usec;
>> +};
>> +#endif
>> +
>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
>> +struct __kernel_old_timespec {
>> +	__kernel_old_time_t	tv_sec;		/* seconds */
>> +	long			tv_nsec;	/* nanoseconds */
>> +};
>> +#endif
>> +
>>   /* Lifted from include/uapi/linux/timex.h. */
>>   struct __user_old_timex {
>>   	unsigned int modes;	/* mode selector */
>
>
> This won't work, the uapi is meant to be parsed by userland too,
> independently of the target kernel version. Therefore, testing
> LINUX_VERSION_CODE does not make sense there. Hence the reason for
> defining __user_old_timespec, which does not conflict with any
> pre-existing type in either kernel or userland namespaces.
>
> What you might do instead is defining __kernel_old_timespec to mirror
> the same kernel type only if __KERNEL__ is not set, but I would not
> recommend checking for __KERNEL__ in this context anyway, since that
> defeats the purpose of having separate uapi files.
>

ok, let's keep it this way.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] y2038: introduce new time representations at the boundary
  2021-03-04  9:00       ` florian.bezdeka
@ 2021-03-04  9:24         ` chensong
  0 siblings, 0 replies; 8+ messages in thread
From: chensong @ 2021-03-04  9:24 UTC (permalink / raw
  To: florian.bezdeka@siemens.com, rpm@xenomai.org,
	jan.kiszka@siemens.com, chensong@kylinos.cn
  Cc: xenomai@xenomai.org



On 2021年03月04日 17:00, florian.bezdeka@siemens.com wrote:
> On Thu, 2021-03-04 at 13:58 +0800, chensong wrote:
>>
>> On 2021年03月02日 21:43, florian.bezdeka--- via Xenomai wrote:
>>> On Tue, 2021-03-02 at 21:10 +0800, chensong wrote:
>>>> Florian $ Philippe,
>>>>
>>>> As the discussion in the mails 2021-02-21, we are going to replace
>>>> __user_old_timespec with __kernel_old_timespec to keep aligned with
>>>> upstream.
>>>
>>> Please note the y2038 related patches from Philippe located in the
>>> wip/dovetail branch of the Xenomai repository. That work has already
>>> been done.
>>>
>>
>> Thanks, i was working on the xenomai-rpm, now i move to [1] branch
>> wip/dovetail, is it correct?
>
> After a short sync with Jan and the fact that the y2038 related patches
> from Philippe are already part of this branch and we need them (even if
> currently breaking 32 bit kernels): yes
>
> In addition: I have a wip/y2038 branch on my public gitlab tree ([2]),
> already based on wip/dovetail that I can easily run through the CI of
> the xenomai-images project for compile-testing all the different kernel
> combinations. Even testing could be enabled in the future.
>
> As patches should always make it to the list, here comes my proposal:
>
> Feel free to send your patches using a [y2038] (or similar) tag, the
> list can review them and I would take care of applying it to [2]. All
> others interested in this topic (ongoing integration) could pick them
> as well. Philippe already mentioned that he is interested in
> integrating them as well.

ok, will do.

>
> If all the things in [2] are looking good after some time we can resend
> them and ask Jan to apply them (after anther round of review).
>
>>
>> [1] https://source.denx.de/Xenomai/xenomai
>
>    [2] https://gitlab.com/fbezdeka/xenomai/
>
>>>> This patch introduced their definitions, if you both agree, i will start
>>>> replacing __user_old_timespec and __user_old_timeval afterward.
>>>>
>>>> BR
>>>>
>>>> Song
>>>>
>>>> On 2021年03月02日 21:05, chensong wrote:
>>>>> Since timespec and timeval will be removed because of
>>>>> y2038 problem, we need to introduce new time representations at
>>>>> the kernel-user boundary and we also need to keep aligned with
>>>>> upstream at the same time.
>>>>>
>>>>> Therefore, we introduce:
>>>>> 1)__kernel_old_timeval
>>>>> 2)__kernel_old_timespec
>>>>> from upstream, their tv_sec are defined as long and as a result their width
>>>>> is able to adapt different arch automatically.
>>>>>
>>>>> Signed-off-by: chensong <chensong@tj.kylinos.cn>
>>>>> ---
>>>>>     include/cobalt/uapi/kernel/types.h | 15 +++++++++++++++
>>>>>     1 file changed, 15 insertions(+)
>>>>>
>>>>> diff --git a/include/cobalt/uapi/kernel/types.h b/include/cobalt/uapi/kernel/types.h
>>>>> index 2c931c2..8931d82 100644
>>>>> --- a/include/cobalt/uapi/kernel/types.h
>>>>> +++ b/include/cobalt/uapi/kernel/types.h
>>>>> @@ -20,6 +20,7 @@
>>>>>
>>>>>     #include <linux/types.h>
>>>>>     #include <cobalt/uapi/kernel/limits.h>
>>>>> +#include <asm-generic/xenomai/wrappers.h>
>>>>>
>>>>>     typedef __u64 xnticks_t;
>>>>>
>>>>> @@ -78,6 +79,20 @@ struct __user_old_timeval {
>>>>>     	long  tv_usec;
>>>>>     };
>>>>>
>>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,17,0)
>>>>> +struct __kernel_old_timeval {
>>>>> +	__kernel_long_t tv_sec;
>>>>> +	__kernel_long_t tv_usec;
>>>>> +};
>>>>> +#endif
>>>>> +
>>>>> +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,5,0)
>>>>> +struct __kernel_old_timespec {
>>>>> +	__kernel_old_time_t	tv_sec;		/* seconds */
>>>>> +	long			tv_nsec;	/* nanoseconds */
>>>>> +};
>>>>> +#endif
>>>>> +
>>>>>     /* Lifted from include/uapi/linux/timex.h. */
>>>>>     struct __user_old_timex {
>>>>>     	unsigned int modes;	/* mode selector */
>>>>>
>>>>
>>>>
>>>
>




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-04  9:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-02 13:05 [PATCH] y2038: introduce new time representations at the boundary chensong
2021-03-02 13:10 ` chensong
2021-03-02 13:43   ` florian.bezdeka
2021-03-04  5:58     ` chensong
2021-03-04  9:00       ` florian.bezdeka
2021-03-04  9:24         ` chensong
2021-03-02 13:44 ` Philippe Gerum
2021-03-04  9:01   ` chensong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.