source: rtems/testsuites/smptests/smp02/tasks.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include "system.h"
15
16void Loop(void) {
17  volatile int i;
18
19  for (i=0; i<300000; i++);
20}
21
22void LogSemaphore(
23  bool      obtained,
24  int       cpu_num,
25  uint32_t  task_index
26){
27  if (Log_index < LOG_SIZE) {
28    /* Log the information */
29    Log[ Log_index ].IsLocked   = obtained;
30    Log[ Log_index ].cpu_num    = cpu_num;
31    Log[ Log_index ].task_index = task_index;
32    Log_index++;
33  }
34}
35
36rtems_task Test_task(
37  rtems_task_argument task_index
38)
39{
40  int               cpu_num;
41  rtems_status_code sc;
42
43  cpu_num = bsp_smp_processor_id();
44
45  do {
46
47    /* Poll to obtain the synchronization semaphore */
48    do {
49      sc = rtems_semaphore_obtain( Semaphore, RTEMS_NO_WAIT, 0 );
50    } while (sc != RTEMS_SUCCESSFUL );
51
52    LogSemaphore(true, cpu_num, task_index);
53    LogSemaphore(false, cpu_num, task_index);
54 
55    rtems_semaphore_release( Semaphore );
56  } while(1);
57}
Note: See TracBrowser for help on using the repository browser.