Changeset 3a58bff in rtems-docs


Ignore:
Timestamp:
Nov 2, 2016, 7:13:31 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
9024cfb
Parents:
72a62ad
git-author:
Sebastian Huber <sebastian.huber@…> (11/02/16 07:13:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/03/16 09:59:01)
Message:

Update due to clock manager and driver changes

Location:
c-user
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • c-user/board_support_packages.rst

    r72a62ad r3a58bff  
    150150
    151151Most RTEMS applications will include a clock tick device driver which invokes
    152 the ``rtems_clock_tick`` directive at regular intervals.  The clock tick is
     152a clock tick directive at regular intervals.  The clock tick is
    153153necessary if the application is to utilize timeslicing, the clock manager, the
    154154timer manager, the rate monotonic manager, or the timeout option on blocking
     
    164164the microseconds_per_tick field in the RTEMS Configuration Table.  An alternate
    165165approach is to set the initial count for a fixed time period (such as one
    166 millisecond) and have the ISR invoke ``rtems_clock_tick`` on the configured
     166millisecond) and have the ISR invoke a clock tick directive on the configured
    167167``microseconds_per_tick`` boundaries.  Obviously, this can induce some error if
    168168the configured ``microseconds_per_tick`` is not evenly divisible by the chosen
  • c-user/clock_manager.rst

    r72a62ad r3a58bff  
    4545- rtems_clock_get_uptime_nanoseconds_ - Get nanoseconds since boot
    4646
    47 - rtems_clock_set_nanoseconds_extension_ - Install the nanoseconds since last tick handler
    48 
    49 - rtems_clock_tick_ - Announce a clock tick
    50 
    5147Background
    5248==========
     
    5753For the features provided by the clock manager to be utilized, periodic timer
    5854interrupts are required.  Therefore, a real-time clock or hardware timer is
    59 necessary to create the timer interrupts.  The ``rtems_clock_tick`` directive
     55necessary to create the timer interrupts.  The clock tick directive
    6056is normally called by the timer ISR to announce to RTEMS that a system clock
    6157tick has occurred.  Elapsed time is measured in ticks.  A tick is defined to be
     
    114110system of tasks, but timeslicing is enabled and disabled on a per task basis.
    115111
    116 The ``rtems_clock_tick`` directive implements timeslicing by decrementing the
     112The clock tick directives implement timeslicing by decrementing the
    117113running task's time-remaining counter when both timeslicing and preemption are
    118114enabled.  If the task's timeslice has expired, then that task will be preempted
     
    146142-----------------
    147143
    148 RTEMS provides the ``rtems_clock_tick`` directive which is called from the
    149 user's real-time clock ISR to inform RTEMS that a tick has elapsed.  The tick
    150 frequency value, defined in microseconds, is a configuration parameter found in
    151 the Configuration Table.  RTEMS divides one million microseconds (one second)
    152 by the number of microseconds per tick to determine the number of calls to the
    153 ``rtems_clock_tick`` directive per second.  The frequency of
    154 ``rtems_clock_tick`` calls determines the resolution (granularity) for all time
    155 dependent RTEMS actions.  For example, calling ``rtems_clock_tick`` ten times
    156 per second yields a higher resolution than calling ``rtems_clock_tick`` two
    157 times per second.  The ``rtems_clock_tick`` directive is responsible for
    158 maintaining both calendar time and the dynamic set of timers.
     144RTEMS provides the several clock tick directives which are called from the
     145user's real-time clock ISR to inform RTEMS that a tick has elapsed.  Depending
     146on the timer hardware capabilities the clock driver must choose the most
     147appropriate clock tick directive.  The tick frequency value, defined in
     148microseconds, is a configuration parameter found in the Configuration Table.
     149RTEMS divides one million microseconds (one second) by the number of
     150microseconds per tick to determine the number of calls to the clock tick
     151directive per second.  The frequency of clock tick calls determines the
     152resolution (granularity) for all time dependent RTEMS actions.  For example,
     153calling the clock tick directive ten times per second yields a higher
     154resolution than calling the clock tick two times per second.  The clock tick
     155directives are responsible for maintaining both calendar time and the dynamic
     156set of timers.
    159157
    160158Setting the Time
     
    726724
    727725This directive may be called from an ISR.
    728 
    729 .. _rtems_clock_set_nanoseconds_extension:
    730 
    731 CLOCK_SET_NANOSECONDS_EXTENSION - Install the nanoseconds since last tick handler
    732 ---------------------------------------------------------------------------------
    733 .. index:: clock set nanoseconds extension
    734 .. index:: nanoseconds extension
    735 .. index:: nanoseconds time accuracy
    736 
    737 **CALLING SEQUENCE:**
    738 
    739 .. index:: rtems_clock_set_nanoseconds_extension
    740 
    741 .. code-block:: c
    742 
    743     rtems_status_code rtems_clock_set_nanoseconds_extension(
    744         rtems_nanoseconds_extension_routine routine
    745     );
    746 
    747 **DIRECTIVE STATUS CODES:**
    748 
    749 ``RTEMS_SUCCESSFUL``
    750   clock tick processed successfully
    751 
    752 ``RTEMS_INVALID_ADDRESS``
    753   ``time_buffer`` is NULL
    754 
    755 **DESCRIPTION:**
    756 
    757 This directive is used by the Clock device driver to install the ``routine``
    758 which will be invoked by the internal RTEMS method used to obtain a highly
    759 accurate time of day.  It is usually called during the initialization of the
    760 driver.
    761 
    762 When the ``routine`` is invoked, it will determine the number of nanoseconds
    763 which have elapsed since the last invocation of the ``rtems_clock_tick``
    764 directive.  It should do this as quickly as possible with as little impact as
    765 possible on the device used as a clock source.
    766 
    767 **NOTES:**
    768 
    769 This directive may be called from an ISR.
    770 
    771 This directive is called as part of every service to obtain the current date
    772 and time as well as timestamps.
    773 
    774 .. _rtems_clock_tick:
    775 
    776 CLOCK_TICK - Announce a clock tick
    777 ----------------------------------
    778 .. index:: clock tick
    779 
    780 **CALLING SEQUENCE:**
    781 
    782 .. index:: rtems_clock_tick
    783 
    784 .. code-block:: c
    785 
    786     rtems_status_code rtems_clock_tick( void );
    787 
    788 **DIRECTIVE STATUS CODES:**
    789 
    790 ``RTEMS_SUCCESSFUL``
    791   clock tick processed successfully
    792 
    793 **DESCRIPTION:**
    794 
    795 This directive announces to RTEMS that a system clock tick has occurred.  The
    796 directive is usually called from the timer interrupt ISR of the local
    797 processor.  This directive maintains the system date and time, decrements
    798 timers for delayed tasks, timeouts, rate monotonic periods, and implements
    799 timeslicing.
    800 
    801 **NOTES:**
    802 
    803 This directive is typically called from an ISR.
    804 
    805 The ``microseconds_per_tick`` and ``ticks_per_timeslice`` parameters in the
    806 Configuration Table contain the number of microseconds per tick and number of
    807 ticks per timeslice, respectively.
  • c-user/configuring_a_system.rst

    r72a62ad r3a58bff  
    44824482
    44834483This device driver is responsible for providing a regular interrupt which
    4484 invokes the ``rtems_clock_tick`` directive.
     4484invokes a clock tick directive.
    44854485
    44864486If neither the Clock Driver not Benchmark Timer is enabled and the
  • c-user/glossary.rst

    r72a62ad r3a58bff  
    674674:dfn:`tick`
    675675    The basic unit of time used by RTEMS.  It is a user-configurable number of
    676     microseconds.  The current tick expires when the ``rtems_clock_tick``
    677     directive is invoked.
     676    microseconds.  The current tick expires when a clock tick directive is
     677    invoked.
    678678
    679679:dfn:`tightly-coupled`
  • c-user/interrupt_manager.rst

    r72a62ad r3a58bff  
    196196  - rtems_clock_get_ticks_since_boot
    197197  - rtems_clock_get_uptime
    198   - rtems_clock_set_nanoseconds_extension
    199   - rtems_clock_tick
     198  - rtems_timecounter_tick
     199  - rtems_timecounter_simple_downcounter_tick
     200  - rtems_timecounter_simple_upcounter_tick
    200201
    201202- Timer Management
  • c-user/task_manager.rst

    r72a62ad r3a58bff  
    13851385This directive blocks the calling task for the specified number of system clock
    13861386ticks.  When the requested interval has elapsed, the task is made ready.  The
    1387 ``rtems_clock_tick`` directive automatically updates the delay period.
     1387clock tick directives automatically updates the delay period.
    13881388
    13891389**NOTES:**
  • c-user/timer_manager.rst

    r72a62ad r3a58bff  
    4949A timer is an RTEMS object which allows the application to schedule operations
    5050to occur at specific times in the future.  User supplied timer service routines
    51 are invoked by either the ``rtems_clock_tick`` directive or a special Timer
     51are invoked by either a clock tick directive or a special Timer
    5252Server task when the timer fires.  Timer service routines may perform any
    5353operations or directives which normally would be performed by the application
    54 code which invoked the ``rtems_clock_tick`` directive.
     54code which invoked a clock tick directive.
    5555
    5656The timer can be used to implement watchdog routines which only fire to denote
     
    130130initiate a timer to fire a user provided timer service routine after the
    131131specified number of clock ticks have elapsed.  When the interval has elapsed,
    132 the timer service routine will be invoked from the ``rtems_clock_tick``
     132the timer service routine will be invoked from a clock tick
    133133directive if it was initiated by the ``rtems_timer_fire_after`` directive and
    134134from the Timer Server task if initiated by the
     
    141141initiate a timer to fire a user provided timer service routine when the
    142142specified time of day has been reached.  When the interval has elapsed, the
    143 timer service routine will be invoked from the ``rtems_clock_tick`` directive
     143timer service routine will be invoked from a clock tick directive
    144144by the ``rtems_timer_fire_when`` directive and from the Timer Server task if
    145145initiated by the ``rtems_timer_server_fire_when`` directive.
Note: See TracChangeset for help on using the changeset viewer.