1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief rtems_rate_monotonic_reset_all_statistics |
---|
5 | * @ingroup ClassicRateMon Rate Monotonic Scheduler |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2010. |
---|
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 | #ifdef 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/rtems/ratemonimpl.h> |
---|
25 | #include <rtems/score/thread.h> |
---|
26 | |
---|
27 | /* |
---|
28 | * rtems_rate_monotonic_reset_all_statistics |
---|
29 | */ |
---|
30 | void rtems_rate_monotonic_reset_all_statistics( void ) |
---|
31 | { |
---|
32 | Objects_Id id; |
---|
33 | |
---|
34 | /* |
---|
35 | * Prevent allocation or deallocation of any of the periods while |
---|
36 | * we are cycling. Also this is an optimization which ensures that |
---|
37 | * we only disable/enable once. The call to |
---|
38 | * rtems_rate_monotonic_reset_statistics will be in a nested dispatch |
---|
39 | * disabled critical section. |
---|
40 | */ |
---|
41 | _Thread_Disable_dispatch(); |
---|
42 | |
---|
43 | /* |
---|
44 | * Cycle through all possible ids and try to reset each one. If it |
---|
45 | * is a period that is inactive, we just get an error back. No big deal. |
---|
46 | */ |
---|
47 | for ( id=_Rate_monotonic_Information.minimum_id ; |
---|
48 | id <= _Rate_monotonic_Information.maximum_id ; |
---|
49 | id++ ) { |
---|
50 | (void) rtems_rate_monotonic_reset_statistics( id ); |
---|
51 | } |
---|
52 | |
---|
53 | /* |
---|
54 | * Done so exit thread dispatching disabled critical section. |
---|
55 | */ |
---|
56 | _Thread_Enable_dispatch(); |
---|
57 | } |
---|