source: rtems/cpukit/rtems/src/timergetinfo.c @ 80cf60e

5
Last change on this file since 80cf60e was 80cf60e, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/20 at 07:48:32

Canonicalize config.h include

Use the following variant which was already used by most source files:

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

  • Property mode set to 100644
File size: 1.1 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#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/timerimpl.h>
22
23rtems_status_code rtems_timer_get_information(
24  rtems_id                 id,
25  rtems_timer_information *the_info
26)
27{
28  Timer_Control    *the_timer;
29  ISR_lock_Context  lock_context;
30
31  if ( !the_info )
32    return RTEMS_INVALID_ADDRESS;
33
34  the_timer = _Timer_Get( id, &lock_context );
35  if ( the_timer != NULL ) {
36    Per_CPU_Control *cpu;
37
38    cpu = _Timer_Acquire_critical( the_timer, &lock_context );
39    the_info->the_class  = the_timer->the_class;
40    the_info->initial    = the_timer->initial;
41    the_info->start_time = the_timer->start_time;
42    the_info->stop_time  = the_timer->stop_time;
43    _Timer_Release( cpu, &lock_context );
44    return RTEMS_SUCCESSFUL;
45  }
46
47  return RTEMS_INVALID_ID;
48}
Note: See TracBrowser for help on using the repository browser.