source: rtems/testsuites/sptests/sp20/getall.c @ afcd563

4.104.114.84.95
Last change on this file since afcd563 was cf42c54c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/00 at 14:51:16

2000-09-29 Stephan Merker <merker@…>

  • sp20/getall.c, sp20/init.c, sp20/system.h, sp20/task1.c: Added new task to test sequence of altering a period's length while it is still active.
  • Property mode set to 100644
File size: 1.0 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-1999.
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.OARcorp.com/rtems/license.html.
15 *
16 *  $Id$
17 */
18
19#include "system.h"
20
21void Get_all_counters()
22{
23  rtems_mode        previous_mode;
24  rtems_status_code status;
25
26  status = rtems_task_mode(
27    RTEMS_NO_PREEMPT,
28    RTEMS_PREEMPT_MASK,
29    &previous_mode
30  );
31  directive_failed( status, "rtems_task_mode to RTEMS_NO_PREEMPT" );
32
33  Temporary_count = Count;
34  Count.count[ 1 ] = 0;
35  Count.count[ 2 ] = 0;
36  Count.count[ 3 ] = 0;
37  Count.count[ 4 ] = 0;
38  Count.count[ 5 ] = 0;
39  Count.count[ 6 ] = 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.