source: rtems/cpukit/rtems/src/ratemoncancel.c @ 03b900d

5
Last change on this file since 03b900d was 03b900d, checked in by Sebastian Huber <sebastian.huber@…>, on 02/18/16 at 07:36:26

score: Replace watchdog handler implementation

Use a red-black tree instead of delta chains.

Close #2344.
Update #2554.
Update #2555.
Close #2606.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief RTEMS Rate Monotonic Cancel
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/threadimpl.h>
24#include <rtems/score/watchdogimpl.h>
25
26rtems_status_code rtems_rate_monotonic_cancel(
27  rtems_id id
28)
29{
30  Rate_monotonic_Control *the_period;
31  Objects_Locations       location;
32  ISR_Level               level;
33
34  the_period = _Rate_monotonic_Get( id, &location );
35  switch ( location ) {
36
37    case OBJECTS_LOCAL:
38      if ( !_Thread_Is_executing( the_period->owner ) ) {
39        _Objects_Put( &the_period->Object );
40        return RTEMS_NOT_OWNER_OF_RESOURCE;
41      }
42      _ISR_Disable( level );
43      _Watchdog_Per_CPU_remove_relative( &the_period->Timer );
44      _ISR_Enable( level );
45      the_period->state = RATE_MONOTONIC_INACTIVE;
46      _Scheduler_Release_job( the_period->owner, 0 );
47      _Objects_Put( &the_period->Object );
48      return RTEMS_SUCCESSFUL;
49
50#if defined(RTEMS_MULTIPROCESSING)
51    case OBJECTS_REMOTE:
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.