1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief RTEMS Rate Monotonic Reset Statistics |
---|
5 | * @ingroup ClassicRateMon Rate Monotonic Scheduler |
---|
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/system.h> |
---|
22 | #include <rtems/rtems/status.h> |
---|
23 | #include <rtems/rtems/support.h> |
---|
24 | #include <rtems/score/isr.h> |
---|
25 | #include <rtems/rtems/ratemonimpl.h> |
---|
26 | #include <rtems/score/thread.h> |
---|
27 | |
---|
28 | /* |
---|
29 | * rtems_rate_monotonic_reset_statistics |
---|
30 | * |
---|
31 | * This directive allows a thread to reset the statistics information |
---|
32 | * on a specific period instance. |
---|
33 | * |
---|
34 | * Input parameters: |
---|
35 | * id - rate monotonic id |
---|
36 | * |
---|
37 | * Output parameters: |
---|
38 | * RTEMS_SUCCESSFUL - if successful |
---|
39 | * error code - if unsuccessful |
---|
40 | * |
---|
41 | */ |
---|
42 | |
---|
43 | rtems_status_code rtems_rate_monotonic_reset_statistics( |
---|
44 | rtems_id id |
---|
45 | ) |
---|
46 | { |
---|
47 | Objects_Locations location; |
---|
48 | Rate_monotonic_Control *the_period; |
---|
49 | |
---|
50 | the_period = _Rate_monotonic_Get( id, &location ); |
---|
51 | switch ( location ) { |
---|
52 | |
---|
53 | case OBJECTS_LOCAL: |
---|
54 | _Rate_monotonic_Reset_statistics( the_period ); |
---|
55 | _Objects_Put( &the_period->Object ); |
---|
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 | } |
---|