Re: [Xenomai-core] [PATCH 4/7] nucleus: Add CLOCK_HOST_REALTIME bits to nkvdso

2010-07-03 Thread Wolfgang Mauerer
Gilles Chanteperdrix wrote:
> Wolfgang Mauerer wrote:
>> Gilles Chanteperdrix wrote:
>>> Wolfgang Mauerer wrote:
 Augment the shared vdso page with all data required to
 implement a clock CLOCK_HOST_REALTIME that provides time
 information synchronised with the NTP-corrected time
 in the Linux kernel.

 The definition of the hostrt data is placed in a separate
 head file so that we can use it irregardless of pervasive
 rt support is compiled in or not.
>>> Ok. Would not it be more simple to define the nkvdso even without
>>> pervasive support?
>> Thought about that, but having a shared kernel/userland object
>> without pervasive RT support seemed a bit unnatural to me.
> 
> The idea would be to have a static nkvdso in the non-pervasive case, we
> do not need the mapping stuff. But at least, if we do this once and for
> all for nkvdso, we will not have to repeat the code which handles the
> non-pervasive case for all the data in nkvdso which need to exist in
> that case.

okay, let's do it like this. Might also save a couple of ifdefs.

Regards, Wolfgang

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH 4/7] nucleus: Add CLOCK_HOST_REALTIME bits to nkvdso

2010-07-03 Thread Gilles Chanteperdrix
Wolfgang Mauerer wrote:
> Gilles Chanteperdrix wrote:
>> Wolfgang Mauerer wrote:
>>> Augment the shared vdso page with all data required to
>>> implement a clock CLOCK_HOST_REALTIME that provides time
>>> information synchronised with the NTP-corrected time
>>> in the Linux kernel.
>>>
>>> The definition of the hostrt data is placed in a separate
>>> head file so that we can use it irregardless of pervasive
>>> rt support is compiled in or not.
>> Ok. Would not it be more simple to define the nkvdso even without
>> pervasive support?
> 
> Thought about that, but having a shared kernel/userland object
> without pervasive RT support seemed a bit unnatural to me.

The idea would be to have a static nkvdso in the non-pervasive case, we
do not need the mapping stuff. But at least, if we do this once and for
all for nkvdso, we will not have to repeat the code which handles the
non-pervasive case for all the data in nkvdso which need to exist in
that case.

-- 
Gilles.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH 4/7] nucleus: Add CLOCK_HOST_REALTIME bits to nkvdso

2010-07-03 Thread Wolfgang Mauerer
Gilles Chanteperdrix wrote:
> Wolfgang Mauerer wrote:
>> Augment the shared vdso page with all data required to
>> implement a clock CLOCK_HOST_REALTIME that provides time
>> information synchronised with the NTP-corrected time
>> in the Linux kernel.
>>
>> The definition of the hostrt data is placed in a separate
>> head file so that we can use it irregardless of pervasive
>> rt support is compiled in or not.
> 
> Ok. Would not it be more simple to define the nkvdso even without
> pervasive support?

Thought about that, but having a shared kernel/userland object
without pervasive RT support seemed a bit unnatural to me.
> 
>> +#if defined(CONFIG_XENO_OPT_HOSTRT) && !defined(CONFIG_XENO_OPT_PERVASIVE)
>> +nkhostrt_data = xnarch_alloc_host_mem(sizeof(struct 
>> xnarch_hostrt_data));
> 
> should be sizeof(*nkhostrt_data)
> 
> But why a dynamic allocation at all?

not really required, can also make it static if you prefer.

Best regards, Wolfgang

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH 4/7] nucleus: Add CLOCK_HOST_REALTIME bits to nkvdso

2010-07-03 Thread Gilles Chanteperdrix
Wolfgang Mauerer wrote:
> Augment the shared vdso page with all data required to
> implement a clock CLOCK_HOST_REALTIME that provides time
> information synchronised with the NTP-corrected time
> in the Linux kernel.
> 
> The definition of the hostrt data is placed in a separate
> head file so that we can use it irregardless of pervasive
> rt support is compiled in or not.

Ok. Would not it be more simple to define the nkvdso even without
pervasive support?

> +#if defined(CONFIG_XENO_OPT_HOSTRT) && !defined(CONFIG_XENO_OPT_PERVASIVE)
> + nkhostrt_data = xnarch_alloc_host_mem(sizeof(struct 
> xnarch_hostrt_data));

should be sizeof(*nkhostrt_data)

But why a dynamic allocation at all?


-- 
Gilles.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core