source: rtems/cpukit/rtems/src/ratemoncancel.c @ 92635cb

4.115
Last change on this file since 92635cb was 92635cb, checked in by Sebastian Huber <sebastian.huber@…>, on 06/03/14 at 14:27:53

score: Remove scheduler parameter from most ops

Remove the scheduler parameter from most high level scheduler operations
like

  • _Scheduler_Block(),
  • _Scheduler_Unblock(),
  • _Scheduler_Change_priority(),
  • _Scheduler_Update_priority(),
  • _Scheduler_Release_job(), and
  • _Scheduler_Yield().

This simplifies the scheduler operations usage.

  • Property mode set to 100644
File size: 1.3 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
33  the_period = _Rate_monotonic_Get( id, &location );
34  switch ( location ) {
35
36    case OBJECTS_LOCAL:
37      if ( !_Thread_Is_executing( the_period->owner ) ) {
38        _Objects_Put( &the_period->Object );
39        return RTEMS_NOT_OWNER_OF_RESOURCE;
40      }
41      (void) _Watchdog_Remove( &the_period->Timer );
42      the_period->state = RATE_MONOTONIC_INACTIVE;
43      _Scheduler_Release_job( the_period->owner, 0 );
44      _Objects_Put( &the_period->Object );
45      return RTEMS_SUCCESSFUL;
46
47#if defined(RTEMS_MULTIPROCESSING)
48    case OBJECTS_REMOTE:
49#endif
50    case OBJECTS_ERROR:
51      break;
52  }
53
54  return RTEMS_INVALID_ID;
55}
Note: See TracBrowser for help on using the repository browser.