diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-06-13 09:44:32 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-06-14 14:20:30 +0200 |
commit | 50fc8f65a6a7a602720af82af58b453dc663f082 (patch) | |
tree | e0a50bee793de37d516ad016633c478999cc4e3e /cpukit/sapi/include/rtems/config.h | |
parent | v850 - byte swap instructions not available on all multilibs (diff) | |
download | rtems-50fc8f65a6a7a602720af82af58b453dc663f082.tar.bz2 |
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.
Diffstat (limited to 'cpukit/sapi/include/rtems/config.h')
-rw-r--r-- | cpukit/sapi/include/rtems/config.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 8bc5aea50c..58b350da76 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -146,6 +146,13 @@ typedef struct { */ uint32_t microseconds_per_tick; + /** This field specifies the number of nanoseconds which elapse + * between clock ticks. This value is derived from the + * microseconds_per_tick field and provided to avoid calculation at + * run-time. + */ + uint32_t nanoseconds_per_tick; + /** This field specifies the number of ticks in each task's timeslice. */ uint32_t ticks_per_timeslice; @@ -281,7 +288,13 @@ extern rtems_configuration_table Configuration; #define rtems_configuration_get_milliseconds_per_tick() \ (Configuration.microseconds_per_tick / 1000) #define rtems_configuration_get_nanoseconds_per_tick() \ - (Configuration.microseconds_per_tick * 1000) + (Configuration.nanoseconds_per_tick) +#define rtems_configuration_set_microseconds_per_tick( _us ) \ + do { \ + Configuration.microseconds_per_tick = (_us); \ + Configuration.nanoseconds_per_tick = \ + 1000 * Configuration.microseconds_per_tick; \ + } while (0) #define rtems_configuration_get_ticks_per_timeslice() \ (Configuration.ticks_per_timeslice) |