source: rtems/cpukit/rtems/src/ratemondelete.c @ e6b31b27

4.115
Last change on this file since e6b31b27 was 2903090, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/15 at 09:26:46

score: Add header to _Watchdog_Remove()

Add watchdog header parameter to _Watchdog_Remove() to be in line with
the other operations. Add _Watchdog_Remove_ticks() and
_Watchdog_Remove_seconds() for convenience.

Update #2307.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Delete Rate Monotonic
5 *  @ingroup ClassicRateMon
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/rtems/ratemonimpl.h>
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/thread.h>
24#include <rtems/score/watchdogimpl.h>
25
26rtems_status_code rtems_rate_monotonic_delete(
27  rtems_id id
28)
29{
30  Rate_monotonic_Control *the_period;
31  Objects_Locations       location;
32
33  _Objects_Allocator_lock();
34  the_period = _Rate_monotonic_Get( id, &location );
35  switch ( location ) {
36
37    case OBJECTS_LOCAL:
38      _Scheduler_Release_job( the_period->owner, 0 );
39      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
40      _Watchdog_Remove_ticks( &the_period->Timer );
41      the_period->state = RATE_MONOTONIC_INACTIVE;
42      _Objects_Put( &the_period->Object );
43      _Rate_monotonic_Free( the_period );
44      _Objects_Allocator_unlock();
45      return RTEMS_SUCCESSFUL;
46
47#if defined(RTEMS_MULTIPROCESSING)
48    case OBJECTS_REMOTE:            /* should never return this */
49#endif
50    case OBJECTS_ERROR:
51      break;
52  }
53
54  _Objects_Allocator_unlock();
55
56  return RTEMS_INVALID_ID;
57}
Note: See TracBrowser for help on using the repository browser.