source: rtems/cpukit/rtems/src/timergetinfo.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Get Timer Information
5 *  @ingroup ClassicTimer
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2007.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/rtems/status.h>
23#include <rtems/rtems/support.h>
24#include <rtems/score/thread.h>
25#include <rtems/rtems/timerimpl.h>
26#include <rtems/score/watchdog.h>
27
28rtems_status_code rtems_timer_get_information(
29  rtems_id                 id,
30  rtems_timer_information *the_info
31)
32{
33  Timer_Control     *the_timer;
34  Objects_Locations  location;
35
36  if ( !the_info )
37    return RTEMS_INVALID_ADDRESS;
38
39  the_timer = _Timer_Get( id, &location );
40  switch ( location ) {
41
42    case OBJECTS_LOCAL:
43      the_info->the_class  = the_timer->the_class;
44      the_info->initial    = the_timer->Ticker.initial;
45      the_info->start_time = the_timer->Ticker.start_time;
46      the_info->stop_time  = the_timer->Ticker.stop_time;
47      _Objects_Put( &the_timer->Object );
48      return RTEMS_SUCCESSFUL;
49
50#if defined(RTEMS_MULTIPROCESSING)
51    case OBJECTS_REMOTE:            /* should never return this */
52#endif
53    case OBJECTS_ERROR:
54      break;
55  }
56
57  return RTEMS_INVALID_ID;
58}
Note: See TracBrowser for help on using the repository browser.