source:
rtems/cpukit/rtems/src/ratemonresetstatistics.c
@
eaef4657
Last change on this file since eaef4657 was ebe61382, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/07 at 21:49:41 | |
---|---|
|
|
File size: 1.5 KB |
Line | |
---|---|
1 | /* |
2 | * Rate Monotonic Manager -- Reset Statistics |
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 | /*PAGE |
27 | * |
28 | * rtems_rate_monotonic_reset_statistics |
29 | * |
30 | * This directive allows a thread to reset the statistics information |
31 | * on a specific period instance. |
32 | * |
33 | * Input parameters: |
34 | * id - rate monotonic id |
35 | * |
36 | * Output parameters: |
37 | * RTEMS_SUCCESSFUL - if successful |
38 | * error code - if unsuccessful |
39 | * |
40 | */ |
41 | |
42 | rtems_status_code rtems_rate_monotonic_reset_statistics( |
43 | Objects_Id id |
44 | ) |
45 | { |
46 | Objects_Locations location; |
47 | Rate_monotonic_Control *the_period; |
48 | |
49 | the_period = _Rate_monotonic_Get( id, &location ); |
50 | switch ( location ) { |
51 | |
52 | case OBJECTS_LOCAL: |
53 | _Rate_monotonic_Reset_statistics( the_period ); |
54 | _Thread_Enable_dispatch(); |
55 | return RTEMS_SUCCESSFUL; |
56 | |
57 | #if defined(RTEMS_MULTIPROCESSING) |
58 | case OBJECTS_REMOTE: /* should never return this */ |
59 | #endif |
60 | case OBJECTS_ERROR: |
61 | break; |
62 | } |
63 | |
64 | return RTEMS_INVALID_ID; |
65 | } |
Note: See TracBrowser
for help on using the repository browser.