source: rtems/cpukit/score/src/ts64toticks.c @ e57cb3c

4.104.115
Last change on this file since e57cb3c was e57cb3c, checked in by Joel Sherrill <joel.sherrill@…>, on 12/09/08 at 21:27:35

2008-12-09 Joel Sherrill <joel.sherrill@…>

  • score/Makefile.am, score/preinstall.am, score/include/rtems/score/timespec.h, score/include/rtems/score/timestamp.h: Add 64-bit implementation of SuperCore? Timestamps. Tested on PowerPC/psim and SPARC/sis.
  • score/include/rtems/score/timestamp64.h, score/src/ts64addto.c, score/src/ts64divide.c, score/src/ts64dividebyinteger.c, score/src/ts64equalto.c, score/src/ts64getnanoseconds.c, score/src/ts64getseconds.c, score/src/ts64greaterthan.c, score/src/ts64lessthan.c, score/src/ts64set.c, score/src/ts64settozero.c, score/src/ts64subtract.c, score/src/ts64toticks.c, score/src/ts64totimespec.c: New files.
  • Property mode set to 100644
File size: 774 bytes
Line 
1/**
2 *  @file  score/src/ts64toticks.c
3 */
4
5/*
6 *  COPYRIGHT (c) 1989-2008.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <sys/types.h>
21
22#include <rtems/system.h>
23#include <rtems/score/timestamp.h>
24#include <rtems/score/tod.h>
25
26#if defined(CPU_RTEMS_SCORE_TIMESTAMP_IS_INT64) && \
27    !defined(CPU_RTEMS_SCORE_TIMESTAMP_INT64_INLINE)
28uint32_t _Timestamp64_To_ticks(
29  const Timestamp64_Control *time
30)
31{
32  uint32_t ticks;
33
34  ticks = *time / (_TOD_Microseconds_per_tick * 1000);
35  if ( ticks )
36    return ticks;
37  return 1;
38}
39#endif
Note: See TracBrowser for help on using the repository browser.