RKI Build Error - rtems_clock_get not available on 4.12

Pavel Pisa ppisa4lists at pikron.com
Thu Apr 21 10:14:18 UTC 2016


Hello Habeeb,

rtems_clock_get() has been obsoleted long time ago
and has been removed in

    e65c45c4b6cf6dfb485bef48385e39969de8b361
    Obsolete rtems_clock_get() directive.

    This service was marked as deprecated long prior to the 4.11 release
    series and is now being removed.
    
    closes #2676.
    

You should rewrite code as

   rtems_interval ticks;
-  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,&ticks);
+  ticks = rtems_clock_get_ticks_since_boot();


If you need to be compatible even with very old RTEMS versions, probably
pre-4.9, you can use

   rtems_interval ticks;
  #ifndef RTEMS_CLOCK_GET_TICKS_SINCE_BOOT
   ticks = rtems_clock_get_ticks_since_boot();
  #else /*RTEMS_CLOCK_GET_TICKS_SINCE_BOOT*/
   rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,&ticks);
  #endif /*RTEMS_CLOCK_GET_TICKS_SINCE_BOOT*/
 
Best wishes,

               Pavel


On Thursday 21 of April 2016 02:50:55 Olufowobi, Habeeb wrote:
> Hi,
>
> I am trying to build RKI for Raspberrypi but I have been getting this error
> message:
>
>
> arm-rtems4.12-gcc
> -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi/task_cmd.lis -march=armv7-a
> -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__   --pipe
> -B/home/dipupo/development/rtems/kernel/builds/b-rpi/arm-rtems4.12/raspberr
>ypi/lib -specs bsp_specs -qrtems -Wall  -I. -Iinclude/  -I. -g -O2  -c -o
> legacy-build/arm-rtems4.12-raspberrypi/task_cmd.o task_cmd.c
> task_cmd.c: In function 'get_ticks_per_second':
> task_cmd.c:23:10: warning: implicit declaration of function
> 'rtems_clock_get' [-Wimplicit-function-declaration]
>    (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND,
> &ticks_per_second );  return ticks_per_second;
>           ^~~~~~~~~~~~~~~
> task_cmd.c:23:27: error: 'RTEMS_CLOCK_GET_TICKS_PER_SECOND' undeclared
> (first use in this function)
>    (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND,
> &ticks_per_second );  return ticks_per_second;
>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> The line associated with this message in the task_cmd.c is
>
> {
>   rtems_interval ticks_per_second;
>   (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND,
> &ticks_per_second );  return ticks_per_second;
> }
>
>
> Any ideas on how I can fix this?
>
> Thanks.
>
> Best regards,
> Habeeb




More information about the devel mailing list