summaryrefslogblamecommitdiffstats
path: root/cpukit/score/src/coretod.c
blob: f33d716ecf9aec10e268136db33e791cdeadd889 (plain) (tree)
1
2
3
4
5
6
7
8
9





                                             

   
                            
                                                    
  

                                                           
                                         

   



                   
                                
 




                                                                   
                                      
 

                           
                                            
 


                                                                
 

                                                
 
                            
                      
 
/**
 * @file
 *
 * @brief Initializes the Time of Day Handler
 *
 * @ingroup ScoreTODConstants
 */

/*  COPYRIGHT (c) 1989-2008.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#if HAVE_CONFIG_H
#include "config.h"
#endif

#include <rtems/score/todimpl.h>

static uint32_t _TOD_Nanoseconds_since_tick_default_handler( void )
{
  return 0;
}

void _TOD_Handler_initialization(void)
{
  TOD_Control *tod = &_TOD;

  _ISR_lock_Initialize( &tod->lock, "TOD" );

  _Timestamp_Set( &tod->now, TOD_SECONDS_1970_THROUGH_1988, 0 );

  _Timestamp_Set_to_zero( &tod->uptime );

  tod->nanoseconds_since_last_tick =
    _TOD_Nanoseconds_since_tick_default_handler;

  /* TOD has not been set */
  tod->is_set = false;
}