source: rtems/testsuites/libtests/rtmonuse/getall.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 22, 1997 at 5:20:27 PM

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • 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-1997.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright assigned to U.S. Government, 1994.
12 *
13 *  The license and distribution terms for this file may in
14 *  the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
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.