source: rtems/testsuites/smptests/smp08/tasks.c @ cb5eaddf

4.115
Last change on this file since cb5eaddf was cb5eaddf, checked in by Sebastian Huber <sebastian.huber@…>, on 04/10/14 at 09:02:52

rtems: Rename rtems_smp_get_current_processor()

Rename rtems_smp_get_current_processor() in
rtems_get_current_processor(). Make rtems_get_current_processor() a
function in uni-processor configurations to enable ABI compatibility
with SMP configurations.

  • 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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include "system.h"
15
16rtems_task Test_task(
17  rtems_task_argument unused
18)
19{
20  rtems_id          tid;
21  rtems_time_of_day time;
22  uint32_t    task_index;
23  rtems_status_code status;
24  uint32_t          cpu_num;
25  char              name[5];
26  char             *p;
27
28  /* Get the task name */
29  p = rtems_object_get_name( RTEMS_SELF, 5, name );
30  rtems_test_assert( p != NULL );
31
32  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
33  task_index = task_number( tid );
34  for ( ; ; ) {
35
36    /* Get the CPU Number */
37    cpu_num = rtems_get_current_processor();
38
39    status = rtems_clock_get_tod( &time );
40    if ( time.second >= 35 ) {
41      TEST_END();
42      rtems_test_exit( 0 );
43    }
44
45    PrintTaskInfo( p, &time );
46    status = rtems_task_wake_after(
47      task_index * 5 * rtems_clock_get_ticks_per_second() );
48  }
49}
Note: See TracBrowser for help on using the repository browser.