source: rtems/cpukit/rtems/src/ratemondelete.c @ 40ee2fc0

4.115
Last change on this file since 40ee2fc0 was 40ee2fc0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 20, 2011 at 1:06:42 PM

2011-09-20 Petr Benes <benesp16@…>

PR 1916/testing

  • rtems/src/ratemondelete.c, score/src/schedulercbsreleasejob.c, score/src/scheduleredfupdate.c, score/src/scheduleredfyield.c: Rework to improve coverage.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  Rate Monotonic Manager -- Delete a Period
3 *
4 *  COPYRIGHT (c) 1989-2007.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#if HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/system.h>
19#include <rtems/rtems/status.h>
20#include <rtems/rtems/support.h>
21#include <rtems/score/isr.h>
22#include <rtems/score/object.h>
23#include <rtems/rtems/ratemon.h>
24#include <rtems/score/thread.h>
25
26/*
27 *  rtems_rate_monotonic_delete
28 *
29 *  This directive allows a thread to delete a rate monotonic timer.
30 *
31 *  Input parameters:
32 *    id - rate monotonic id
33 *
34 *  Output parameters:
35 *    RTEMS_SUCCESSFUL - if successful
36 *    error code       - if unsuccessful
37 */
38
39rtems_status_code rtems_rate_monotonic_delete(
40  rtems_id id
41)
42{
43  Rate_monotonic_Control *the_period;
44  Objects_Locations       location;
45
46  the_period = _Rate_monotonic_Get( id, &location );
47  switch ( location ) {
48
49    case OBJECTS_LOCAL:
50      _Scheduler_Release_job(the_period->owner, 0);
51      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
52      (void) _Watchdog_Remove( &the_period->Timer );
53      the_period->state = RATE_MONOTONIC_INACTIVE;
54      _Rate_monotonic_Free( the_period );
55      _Thread_Enable_dispatch();
56      return RTEMS_SUCCESSFUL;
57
58#if defined(RTEMS_MULTIPROCESSING)
59    case OBJECTS_REMOTE:            /* should never return this */
60#endif
61    case OBJECTS_ERROR:
62      break;
63  }
64
65  return RTEMS_INVALID_ID;
66}
Note: See TracBrowser for help on using the repository browser.