source: rtems/cpukit/rtems/src/timercancel.c @ 4b48ece0

4.115
Last change on this file since 4b48ece0 was 4b48ece0, checked in by Sebastian Huber <sebastian.huber@…>, on 07/22/13 at 08:21:03

score: Create watchdog implementation header

Move implementation specific parts of watchdog.h and watchdog.inl into
new header file watchdogimpl.h. The watchdog.h contains now only the
application visible API.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  Timer Manager - rtems_timer_cancel directive
3 *
4 *
5 *  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 */
12
13#if HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <rtems/system.h>
18#include <rtems/rtems/status.h>
19#include <rtems/rtems/support.h>
20#include <rtems/score/object.h>
21#include <rtems/score/thread.h>
22#include <rtems/rtems/timer.h>
23#include <rtems/score/tod.h>
24#include <rtems/score/watchdogimpl.h>
25
26/*
27 *  rtems_timer_cancel
28 *
29 *  This directive allows a thread to cancel a timer.
30 *
31 *  Input parameters:
32 *    id - timer id
33 *
34 *  Output parameters:
35 *    RTEMS_SUCCESSFUL - if successful
36 *    error code       - if unsuccessful
37 */
38
39rtems_status_code rtems_timer_cancel(
40  rtems_id id
41)
42{
43  Timer_Control   *the_timer;
44  Objects_Locations       location;
45
46  the_timer = _Timer_Get( id, &location );
47  switch ( location ) {
48
49    case OBJECTS_LOCAL:
50      if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
51        (void) _Watchdog_Remove( &the_timer->Ticker );
52      _Objects_Put( &the_timer->Object );
53      return RTEMS_SUCCESSFUL;
54
55#if defined(RTEMS_MULTIPROCESSING)
56    case OBJECTS_REMOTE:            /* should never return this */
57#endif
58    case OBJECTS_ERROR:
59      break;
60  }
61
62  return RTEMS_INVALID_ID;
63}
Note: See TracBrowser for help on using the repository browser.