Include "tmacros.h". Use PRIxrtems_id to print rtems_ids.

This commit is contained in:
Ralf Corsepius
2009-10-26 11:34:27 +00:00
parent b9deb1c3d5
commit 732276e95d
5 changed files with 17 additions and 11 deletions

View File

@@ -19,6 +19,8 @@
*/
#include "system.h"
#include "tmacros.h"
#include <stdio.h>
#include <stdlib.h>
@@ -32,7 +34,7 @@ rtems_task Application_task(
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
printf( "Application task was invoked with argument (%d) "
"and has id of 0x%x\n", argument, tid );
"and has id of 0x%" PRIxrtems_id "\n", argument, tid );
printf( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
exit( 0 );

View File

@@ -23,6 +23,7 @@
#define CONFIGURE_INIT
#include "system.h"
#include "tmacros.h"
#include <stdio.h>
#include <stdlib.h>
@@ -87,7 +88,7 @@ void destory_all_tasks(
for (task = 0; task < MAX_TASKS; task++)
if (task_id[task])
{
printf(" %s : signal task %08x to delete, ", who, task_id[task]);
printf(" %s : signal task %08" PRIxrtems_id " to delete, ", who, task_id[task]);
fflush(stdout);
rtems_event_send(task_id[task], 1);
task_id[task] = 0;

View File

@@ -22,6 +22,7 @@
#include <stdlib.h>
#include "system.h"
#include "tmacros.h"
#include <rtems/score/object.h>
void test1()
@@ -66,7 +67,7 @@ void test1()
if (status_code_bad(result))
break;
printf("number = %3" PRIi32 ", id = %08x, starting, ", task_count, task_id[task_count]);
printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[task_count]);
fflush(stdout);
result = rtems_task_start(task_id[task_count],

View File

@@ -25,6 +25,7 @@
#include <stdlib.h>
#include "system.h"
#include "tmacros.h"
void test2()
{
@@ -65,7 +66,7 @@ void test2()
if (status_code_bad(result))
break;
printf("number = %3" PRIi32 ", id = %08x, starting, ", task_count, task_id[task_count]);
printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[task_count]);
fflush(stdout);
result = rtems_task_start(task_id[task_count],
@@ -119,7 +120,7 @@ void test2()
removed_ids[task++] = task_id[remove_task];
printf(" TEST2 : block %" PRIi32 " remove, signal task %08x, ", block, task_id[remove_task]);
printf(" TEST2 : block %" PRIi32 " remove, signal task %08" PRIxrtems_id ", ", block, task_id[remove_task]);
rtems_event_send(task_id[remove_task], 1);
task_id[remove_task] = 0;
}
@@ -165,7 +166,7 @@ void test2()
exit( 1 );
}
printf("number = %3" PRIi32 ", id = %08x, starting, ", task_count, task_id[id_slot]);
printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[id_slot]);
result = rtems_task_start(task_id[id_slot],
test_task,
@@ -210,13 +211,13 @@ void test2()
if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id))
{
printf( " FAIL2 : the new id is the same as an id already allocated -\n"
" task id = %08x\n",
" task id = %08" PRIxrtems_id "\n",
task_id[id_slot]);
exit( 1 );
}
printf( " FAIL2 : could not find the task id in the removed table -\n"
" task id = %08x\n",
" task id = %08" PRIxrtems_id "\n",
task_id[id_slot]);
exit( 1 );
}

View File

@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "system.h"
#include "tmacros.h"
void test3()
{
@@ -72,7 +73,7 @@ void test3()
if (status_code_bad(result))
break;
printf("number = %3" PRIi32 ", id = %08x, starting, ", task_count, task_id[task_count]);
printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[task_count]);
fflush(stdout);
result = rtems_task_start(task_id[task_count],
@@ -118,7 +119,7 @@ void test3()
exit( 1 );
}
printf(" TEST3 : remove, signal task %08x, ", task_id[remove_task]);
printf(" TEST3 : remove, signal task %08" PRIxrtems_id ", ", task_id[remove_task]);
rtems_event_send(task_id[remove_task], 1);
task_id[remove_task] = 0;
}
@@ -135,7 +136,7 @@ void test3()
{
if (task_id[remove_task])
{
printf(" TEST3 : remove, signal task %08x, ", task_id[remove_task]);
printf(" TEST3 : remove, signal task %08" PRIxrtems_id ", ", task_id[remove_task]);
rtems_event_send(task_id[remove_task], 1);
task_id[remove_task] = 0;
}