Changeset 50fc8f6 in rtems


Ignore:
Timestamp:
Jun 13, 2012, 7:44:32 AM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
3246b0f8
Parents:
1364eb99
git-author:
Sebastian Huber <sebastian.huber@…> (06/13/12 07:44:32)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/12 12:20:30)
Message:

sapi: Add nanoseconds_per_tick to configuration

Add nanoseconds_per_tick to rtems_configuration_table. This value will
be derived from the microseconds_per_tick value. This avoids some
calculations at run-time.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/nds/startup/bspstart.c

    r1364eb99 r50fc8f6  
    4444
    4545  /* configure clock period */
    46   Configuration.microseconds_per_tick = 10000;  /* us */
     46  rtems_configuration_set_microseconds_per_tick (10000);
    4747
    4848  defaultExceptionHandler ();
  • cpukit/sapi/include/confdefs.h

    r1364eb99 r50fc8f6  
    23242324    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
    23252325    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
     2326    1000 * CONFIGURE_MICROSECONDS_PER_TICK,   /* nanoseconds per clock tick */
    23262327    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
    23272328    CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
  • cpukit/sapi/include/rtems/config.h

    r1364eb99 r50fc8f6  
    147147  uint32_t                       microseconds_per_tick;
    148148
     149  /** This field specifies the number of nanoseconds which elapse
     150   *  between clock ticks.  This value is derived from the
     151   *  microseconds_per_tick field and provided to avoid calculation at
     152   *  run-time.
     153   */
     154  uint32_t                       nanoseconds_per_tick;
     155
    149156  /** This field specifies the number of ticks in each task's timeslice.
    150157   */
     
    282289        (Configuration.microseconds_per_tick / 1000)
    283290#define rtems_configuration_get_nanoseconds_per_tick() \
    284       (Configuration.microseconds_per_tick * 1000)
     291        (Configuration.nanoseconds_per_tick)
     292#define rtems_configuration_set_microseconds_per_tick( _us ) \
     293        do { \
     294          Configuration.microseconds_per_tick = (_us); \
     295          Configuration.nanoseconds_per_tick = \
     296            1000 * Configuration.microseconds_per_tick; \
     297        } while (0)
    285298
    286299#define rtems_configuration_get_ticks_per_timeslice() \
Note: See TracChangeset for help on using the changeset viewer.