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

4.115
Last change on this file since ac9d2ecc was ac9d2ecc, checked in by Joel Sherrill <joel.sherrill@…>, on 09/01/11 at 18:13:54

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

PR 1895/cpukit

  • rtems/src/ratemoncancel.c, rtems/src/ratemondelete.c, rtems/src/ratemonperiod.c, sapi/include/confdefs.h, score/Makefile.am, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/schedulersimple.h, score/include/rtems/score/schedulersimplesmp.h, score/inline/rtems/score/scheduler.inl, score/inline/rtems/score/schedulerpriority.inl, score/src/coremutexseize.c: Add priority_compare and release_job hooks interfaces to scheduler interface.
  • score/src/schedulerpriorityprioritycompare.c, score/src/schedulerpriorityreleasejob.c: New files.
  • 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      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
51      (void) _Watchdog_Remove( &the_period->Timer );
52      the_period->state = RATE_MONOTONIC_INACTIVE;
53      _Rate_monotonic_Free( the_period );
54      _Scheduler_Release_job(the_period->owner, 0);
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.