Changeset 62181b21 in rtems for cpukit/score/src/coretodget.c


Ignore:
Timestamp:
Nov 16, 2012, 12:59:27 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
bfddb047
Parents:
154721c4
git-author:
Sebastian Huber <sebastian.huber@…> (11/16/12 12:59:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/21/12 15:24:22)
Message:

score: Add and use _TOD_Get_with_nanoseconds()

Delete _TOD_Get_as_timestamp().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/coretodget.c

    r154721c4 r62181b21  
    1111
    1212#if HAVE_CONFIG_H
    13 #include "config.h"
     13  #include "config.h"
    1414#endif
    1515
    16 #include <rtems/system.h>
    17 #include <rtems/score/isr.h>
    18 #include <rtems/score/timespec.h>
    19 #include <rtems/score/timestamp.h>
    2016#include <rtems/score/tod.h>
    2117#include <rtems/score/watchdog.h>
    2218
    23 void _TOD_Get_as_timestamp(
    24   Timestamp_Control *tod
     19Timestamp_Control *_TOD_Get_with_nanoseconds(
     20  Timestamp_Control *snapshot,
     21  const Timestamp_Control *clock
    2522)
    2623{
     
    2825  Timestamp_Control offset;
    2926  Timestamp_Control now;
    30   long              nanoseconds;
     27  uint32_t          nanoseconds;
    3128
    32   /* assume time checked for NULL by caller */
    33 
    34   /* _TOD.now is the native current time */
    3529  _ISR_Disable( level );
    36     now = _TOD.now;
    3730    nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)();
     31    now = *clock;
    3832  _ISR_Enable( level );
    3933
     
    4135  _Timestamp_Add_to( &now, &offset );
    4236
    43   *tod = now;
     37  *snapshot = now;
     38
     39  return snapshot;
    4440}
Note: See TracChangeset for help on using the changeset viewer.