source: rtems/c/src/tests/libtests/rtmonuse/getall.c @ 61a183a9

4.104.114.84.9
Last change on this file since 61a183a9 was 61a183a9, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 9, 1997 at 8:19:35 PM

new test

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*  Get_all_counters
2 *
3 *  This routine allows TA5 to atomically obtain the iteration counters.
4 *
5 *  Input parameters:  NONE
6 *
7 *  Output parameters:  NONE
8 *
9 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
10 *  On-Line Applications Research Corporation (OAR).
11 *  All rights assigned to U.S. Government, 1994.
12 *
13 *  This material may be reproduced by or for the U.S. Government pursuant
14 *  to the copyright license under the clause at DFARS 252.227-7013.  This
15 *  notice must appear in all copies of this file and its derivatives.
16 *
17 *  getall.c,v 1.3 1995/12/19 20:21:07 joel Exp
18 */
19
20#include "system.h"
21
22void Get_all_counters()
23{
24  rtems_mode        previous_mode;
25  rtems_status_code status;
26
27  status = rtems_task_mode(
28    RTEMS_NO_PREEMPT,
29    RTEMS_PREEMPT_MASK,
30    &previous_mode
31  );
32  directive_failed( status, "rtems_task_mode to RTEMS_NO_PREEMPT" );
33
34  Temporary_count = Count;
35  Count.count[ 1 ] = 0;
36  Count.count[ 2 ] = 0;
37  Count.count[ 3 ] = 0;
38  Count.count[ 4 ] = 0;
39  Count.count[ 5 ] = 0;
40
41  status = rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode );
42  directive_failed( status, "rtems_task_mode to RTEMS_PREEMPT" );
43}
Note: See TracBrowser for help on using the repository browser.