OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [src/] [ratemondelete.c] - Blame information for rev 593

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  Rate Monotonic Manager
3
 *
4
 *
5
 *  COPYRIGHT (c) 1989-1999.
6
 *  On-Line Applications Research Corporation (OAR).
7
 *
8
 *  The license and distribution terms for this file may be
9
 *  found in the file LICENSE in this distribution or at
10
 *  http://www.OARcorp.com/rtems/license.html.
11
 *
12
 *  $Id: ratemondelete.c,v 1.2 2001-09-27 11:59:19 chris Exp $
13
 */
14
 
15
#include <rtems/system.h>
16
#include <rtems/rtems/status.h>
17
#include <rtems/rtems/support.h>
18
#include <rtems/score/isr.h>
19
#include <rtems/score/object.h>
20
#include <rtems/rtems/ratemon.h>
21
#include <rtems/score/thread.h>
22
 
23
/*PAGE
24
 *
25
 *  rtems_rate_monotonic_delete
26
 *
27
 *  This directive allows a thread to delete a rate monotonic timer.
28
 *
29
 *  Input parameters:
30
 *    id - rate monotonic id
31
 *
32
 *  Output parameters:
33
 *    RTEMS_SUCCESSFUL - if successful
34
 *    error code        - if unsuccessful
35
 */
36
 
37
rtems_status_code rtems_rate_monotonic_delete(
38
  Objects_Id id
39
)
40
{
41
  Rate_monotonic_Control *the_period;
42
  Objects_Locations              location;
43
 
44
  the_period = _Rate_monotonic_Get( id, &location );
45
  switch ( location ) {
46
    case OBJECTS_REMOTE:            /* should never return this */
47
      return RTEMS_INTERNAL_ERROR;
48
 
49
    case OBJECTS_ERROR:
50
      return RTEMS_INVALID_ID;
51
 
52
    case OBJECTS_LOCAL:
53
      _Objects_Close( &_Rate_monotonic_Information, &the_period->Object );
54
      (void) _Watchdog_Remove( &the_period->Timer );
55
      the_period->state = RATE_MONOTONIC_INACTIVE;
56
      _Rate_monotonic_Free( the_period );
57
      _Thread_Enable_dispatch();
58
      return RTEMS_SUCCESSFUL;
59
  }
60
 
61
  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
62
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.