RTEMS
timerreset.c
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2007.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif
21 
22 #include <rtems/rtems/timerimpl.h>
23 
25  rtems_id id
26 )
27 {
28  Timer_Control *the_timer;
29  ISR_lock_Context lock_context;
30 
31  the_timer = _Timer_Get( id, &lock_context );
32  if ( the_timer != NULL ) {
33  Per_CPU_Control *cpu;
34  rtems_status_code status;
35 
36  cpu = _Timer_Acquire_critical( the_timer, &lock_context );
37 
38  if ( _Timer_Is_interval_class( the_timer->the_class ) ) {
39  _Timer_Cancel( cpu, the_timer );
42  &the_timer->Ticker,
43  cpu->Watchdog.ticks + the_timer->initial
44  );
45  status = RTEMS_SUCCESSFUL;
46  } else {
47  status = RTEMS_NOT_DEFINED;
48  }
49 
50  _Timer_Release( cpu, &lock_context );
51  return status;
52  }
53 
54  return RTEMS_INVALID_ID;
55 }
Watchdog_Header Header[PER_CPU_WATCHDOG_COUNT]
Header for watchdogs.
Definition: percpu.h:474
void _Watchdog_Insert(Watchdog_Header *header, Watchdog_Control *the_watchdog, uint64_t expire)
Inserts a watchdog into the set of scheduled watchdogs according to the specified expiration time...
rtems_status_code rtems_timer_reset(rtems_id id)
%
Definition: timerreset.c:24
uint64_t ticks
Protects all watchdog operations on this processor.
Definition: percpu.h:467
Classic Timer Implementation.
This status code indicates successful completion.
Definition: status.h:86
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:82
Watchdog_Control Ticker
Definition: timerdata.h:45
Per CPU Core Structure.
Definition: percpu.h:347
struct Per_CPU_Control::@13 Watchdog
Watchdog state for this processor.
This status code indicates that the item has not been initialized.
Definition: status.h:143
This status code indicates that an object identifier was invalid.
Definition: status.h:106
Objects_Id rtems_id
Values of this type identify an RTEMS object.
Definition: types.h:99
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
Timer_Classes the_class
Definition: timerdata.h:47
Index for tick clock per-CPU watchdog header.
Definition: percpu.h:316
Watchdog_Interval initial
Definition: timerdata.h:53