RES: RES: RES: Why not a directive rtems_clock_set(rtems_clock_time_value)?
Fabrício de Novaes Kucinskis
fabricio at dea.inpe.br
Thu Sep 20 18:10:29 UTC 2007
Hello,
I gave up trying to compile the clock_settime function without the rest of
POSIX. It was easier to use the gmtime_r function (same used in
clock_settime), and some epoch convertions to do what I need.
Thank you Joel for the help. I hope at least the information I sent in the
last e-mail can help when (and if) you decide to apply the patch in all
builds - if the problem wasn't a mistake of mine, of course!
Regards,
Fabrício.
-----Mensagem original-----
De: rtems-users-bounces+fabricio=dea.inpe.br at rtems.org
[mailto:rtems-users-bounces+fabricio=dea.inpe.br at rtems.org]Em nome de
Fabrício de Novaes Kucinskis
Enviada em: quinta-feira, 20 de setembro de 2007 11:10
Para: Joel Sherrill
Cc: RTEMS - Mailing List
Assunto: RES: RES: RES: Why not a directive
rtems_clock_set(rtems_clock_time_value)?
> The patch should have made a number of POSIX clock* functions built
whether or not posix itself was enabled.
> More than likely you forgot to bootstrap and didn't
have --enable-maintainer-mode set.
> I would bet that a reconfigure/rebuild after a bootstrap will do it.
Yes, you were right: I forgot to bootstrap. But I tried again, and still
nothing.
I'm using RTEMS 4.7.1 for ERC32/SIS BPSs, and did the following steps.
Please see if I'm doing something wrong.
1. I changed cpukit/posix/src/Makefile.am and applied the patch. The file
here is version 1.46 (04/17/2007), and the one referred in the diff file is
1.47 (28/08/2007), but, as far as I could verify, the patch would work with
version 1.46;
2. bootstrap the RTEMS source tree;
3. configure with the following options:
configure --target=sparc-rtems4.7 --enable-rtemsbsp=sis --prefix=/rtems-4.7
-builds/rtems-sis --disable-posix --disable-networking --disable-multiproces
sing --disable-itron --enable-maintainer-mode
4. when running make, I got the following warnings (not there before the
patch):
/rtems-4.7-src/c/src/../../cpukit/score/src/threadhandler.c: In function
'_Thread_Handler':
/rtems-4.7-src/c/src/../../cpukit/score/src/threadhandler.c:116: warning:
the address of '_init', will always evaluate as 'true'
/rtems-4.7-src/c/src/../../cpukit/libblock/src/show_bdbuf.c: In function
'rtems_bdbuf_show_fnc':
/rtems-4.7-src/c/src/../../cpukit/libblock/src/show_bdbuf.c:759: warning:
'pool_cnt' may be used uninitialized in this function
/rtems-4.7-src/c/src/../../cpukit/libblock/src/show_bdbuf.c:758: warning:
'pool_base' may be used uninitialized in this function
5. Called clock_settime() in my code, and compiled: I got an undefined
reference error.
I inserted an error in the clock_settime function (clocksettime.c file) and
repeated the steps described above, and got the exactly the same behavior.
It appears that clocksettime.c is not being compiled.
Thanks again,
Fabrício.
-----Mensagem original-----
De: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
Enviada em: quarta-feira, 19 de setembro de 2007 14:32
Para: Fabrício de Novaes Kucinskis
Cc: RTEMS - Mailing List
Assunto: Re: RES: RES: Why not a directive rtems_clock_set
(rtems_clock_time_value)?
Fabrício de Novaes Kucinskis wrote:
> Joel, thanks for the path, but I think there's something more.
>
> I applied the patch and rebuilt RTEMS, but the clock_settime function was
> not compiled.
>
> Do I have to enable posix (currently I use --disable-posix) in configure?
I
> undestood that this would not be necessary with this patch.
>
The patch should have made a number of POSIX clock* functions
built whether or not posix itself was enabled.
More than likely you forgot to bootstrap and didn't have
--enable-maintainer-mode set. I would bet that a reconfigure/rebuild
after a bootstrap will do it.
--joel
> Regards,
>
>
> Fabrício.
>
>
> -----Mensagem original-----
> De: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
> Enviada em: terça-feira, 18 de setembro de 2007 17:12
> Para: Fabrício de Novaes Kucinskis
> Cc: RTEMS - Mailing List
> Assunto: Re: RES: Why not a directive rtems_clock_set
> (rtems_clock_time_value)?
>
>
> Fabrício de Novaes Kucinskis wrote:
>
>>> History. Plus more people need to get the time in different formats
>>> than need to set it in different formats.
>>>
>>>
>>
>>> At this point in time, I have grown to dislike the enum overloaded
>>> style of clock_get.
>>>
>>>
>> I'd ask for an enum overloaded style of clock_set, but forget it... :)
>>
>> Ok, so if I need a clock set function using the rtems_clock_time_value, I
>> have to create one. Just to ease my work, let me ask: is there an
internal
>> "_Seconds_to_TOD" function or something alike?
>>
>>
> Try this patch to cpukit/posix/Makefile.am and it should build
> posix/src/clocksettime.c. That code is setup to do the conversion you
> want.
>
> Remember to bootstrap.
>
> Whether this patch should be in all builds is open to user discussion
> but POSIX defines the routine you want.
>
> --joel
>
>> Regards,
>>
>>
>> Fabrício.
>>
>>
>>
>>
>>
>> -----Mensagem original-----
>> De: Joel Sherrill [mailto:joel.sherrill at oarcorp.com]
>> Enviada em: terça-feira, 18 de setembro de 2007 12:08
>> Para: Fabrício de Novaes Kucinskis
>> Cc: RTEMS - Mailing List
>> Assunto: Re: Why not a directive rtems_clock_set
>> (rtems_clock_time_value)?
>>
>>
>> Fabrício de Novaes Kucinskis wrote:
>>
>>
>>> Hello all,
>>>
>>>
>>> I'm wondering here: if we have ways to get the RTEMS clock counter in
the
>>> "rtems_time_of_day", "rtems_clock_time_value" and "rtems_interval"
>>>
>>>
>> formats,
>>
>>
>>> why there is just one way to set it (with "rtems_time_of_day")?
>>>
>>>
>>>
>>>
>> History. Plus more people need to get the time in different formats
>> than need to set it in different formats.
>>
>> At this point in time, I have grown to dislike the enum overloaded
>> style of clock_get. It makes it harder to have strict typing and
>> that style of routine tends to reference more support code than
>> any particular user needs. Thus it leads to code getting pulled in
>> that you won't necessarily use. So I would lean to a new small
>> routine. It's all up to users though.
>>
>>
>>> Why don't we have a way to set the clock in "rtems_clock_time_value"? As
>>>
>>>
>> the
>>
>>
>>> counting is in ticks, I can't see any technical issue here that prevents
>>> this.
>>>
>>>
>>>
>> There is this from POSIX:
>>
>> int clock_settime(
>> clockid_t clock_id,
>> const struct timespec *tp
>> )
>>
>> Some of the code in posix/src is enabled all the time (e.g. sleep and
>> friends). Maybe it makes sense to enable this one also.
>>
>>
>>
>>
>>> Regards,
>>>
>>>
>>> Fabrício de Novaes Kucinskis - DEA / INPE
>>> -----------------------------------------------
>>> Onboard Data Handling Group - SUBORD
>>> Aerospace Electronics Division
>>> Brazilian National Institute for Space Research
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.com
>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>
>>>
>>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>
>>
>
>
>
_______________________________________________
rtems-users mailing list
rtems-users at rtems.com
http://rtems.rtems.org/mailman/listinfo/rtems-users
More information about the users
mailing list