2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>

* base_sp/apptask.c, base_sp/init.c, fileio/init.c, fileio/system.h,
	nsecs/init.c, ticker/init.c, ticker/system.h, ticker/tasks.c: Remove
	warnings.
This commit is contained in:
Joel Sherrill
2011-05-05 16:45:40 +00:00
parent 355d79fae6
commit 7c1e69429a
9 changed files with 45 additions and 98 deletions
+6
View File
@@ -1,3 +1,9 @@
2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* base_sp/apptask.c, base_sp/init.c, fileio/init.c, fileio/system.h,
nsecs/init.c, ticker/init.c, ticker/system.h, ticker/tasks.c: Remove
warnings.
2011-02-22 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Add AC_CONFIG_HEADER(config.h).
+6 -3
View File
@@ -8,7 +8,7 @@
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -36,9 +36,12 @@ rtems_task Application_task(
rtems_status_code status;
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "ident" );
printf( "Application task was invoked with argument (%" PRIdrtems_task_argument ") "
"and has id of 0x%" PRIxrtems_id "\n", argument, tid );
printf(
"Application task was invoked with argument (%" PRIdrtems_task_argument ") "
"and has id of 0x%" PRIxrtems_id "\n", argument, tid
);
printf( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
exit( 0 );
+5 -1
View File
@@ -10,7 +10,7 @@
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -26,6 +26,7 @@
#define CONFIGURE_INIT
#include "system.h"
#include "tmacros.h"
#include <stdio.h>
#define ARGUMENT 0
@@ -45,8 +46,11 @@ rtems_task Init(
status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
directive_failed( status, "create" );
status = rtems_task_start( tid, Application_task, ARGUMENT );
directive_failed( status, "start" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "delete" );
}
+4 -1
View File
@@ -10,7 +10,7 @@
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-2009.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -707,10 +707,13 @@ Init (rtems_task_argument ignored)
RTEMS_DEFAULT_MODES ,
RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
);
directive_failed( status, "create" );
status = rtems_task_start( Task_id, fileio_task, 1 );
directive_failed( status, "start" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "delete" );
}
#if defined(USE_SHELL)
+1 -52
View File
@@ -14,6 +14,7 @@
*/
#include <rtems.h>
#include "tmacros.h"
/* functions */
@@ -63,56 +64,4 @@ rtems_task Init(
#define CONFIGURE_UNIFIED_WORK_AREAS
#include <rtems/confdefs.h>
/*
* Handy macros and static inline functions
*/
/*
* Macro to hide the ugliness of printing the time.
*/
#define print_time(_s1, _tb, _s2) \
do { \
printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \
_s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
(_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
fflush(stdout); \
} while ( 0 )
/*
* Macro to print an task name that is composed of ASCII characters.
*
*/
#define put_name( _name, _crlf ) \
do { \
uint32_t c0, c1, c2, c3; \
\
c0 = ((_name) >> 24) & 0xff; \
c1 = ((_name) >> 16) & 0xff; \
c2 = ((_name) >> 8) & 0xff; \
c3 = (_name) & 0xff; \
putchar( (char)c0 ); \
if ( c1 ) putchar( (char)c1 ); \
if ( c2 ) putchar( (char)c2 ); \
if ( c3 ) putchar( (char)c3 ); \
if ( (_crlf) ) \
putchar( '\n' ); \
} while (0)
/*
* This allows us to view the "Test_task" instantiations as a set
* of numbered tasks by eliminating the number of application
* tasks created.
*
* In reality, this is too complex for the purposes of this
* example. It would have been easier to pass a task argument. :)
* But it shows how rtems_id's can sometimes be used.
*/
#define task_number( tid ) \
( rtems_object_id_get_index( tid ) - \
rtems_configuration_get_rtems_api_configuration()-> \
number_of_initialization_tasks )
/* end of include file */
+3 -2
View File
@@ -2,7 +2,7 @@
* Nanoseconds accuracy timestamp test
*/
/* COPYRIGHT (c) 1989-2007.
/* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -69,6 +69,7 @@ rtems_task Init(
time.ticks = 0;
status = rtems_clock_set( &time );
directive_failed( status, "clock set" );
/*
* Iterate 10 times showing difference in TOD
@@ -91,7 +92,7 @@ rtems_task Init(
my_ctime(stop.tv_sec), stop.tv_nsec
);
printf( " --> %" PRItime_t ":%ld\n", diff.tv_sec, diff.tv_nsec );
printf( " --> %" PRItime_t ":%ld\n", diff.tv_sec, diff.tv_nsec );
}
/*
+13 -1
View File
@@ -10,7 +10,7 @@
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2011.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -52,6 +52,7 @@ rtems_task Init(
time.ticks = 0;
status = rtems_clock_set( &time );
directive_failed( status, "clock get" );
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
@@ -61,18 +62,29 @@ rtems_task Init(
Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
);
directive_failed( status, "create 1" );
status = rtems_task_create(
Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
);
directive_failed( status, "create 2" );
status = rtems_task_create(
Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
);
directive_failed( status, "create 3" );
status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
directive_failed( status, "start 1" );
status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
directive_failed( status, "start 2" );
status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
directive_failed( status, "start 3" );
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "delete" );
}
+1 -36
View File
@@ -16,6 +16,7 @@
#include <rtems.h>
#include <inttypes.h>
#include "../../support/include/buffer_test_io.h"
#include "tmacros.h"
/* functions */
@@ -52,42 +53,6 @@ extern rtems_name Task_name[ 4 ]; /* array of task names */
#include <rtems/confdefs.h>
/*
* Handy macros and static inline functions
*/
/*
* Macro to hide the ugliness of printing the time.
*/
#define print_time(_s1, _tb, _s2) \
do { \
printf( "%s%02" PRId32 ":%02" PRId32 ":%02" PRId32 " %02" PRId32 "/%02" PRId32 "/%04" PRId32 "%s", \
_s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
(_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
} while ( 0 )
/*
* Macro to print an task name that is composed of ASCII characters.
*
*/
#define put_name( _name, _crlf ) \
do { \
uint32_t c0, c1, c2, c3; \
\
c0 = ((_name) >> 24) & 0xff; \
c1 = ((_name) >> 16) & 0xff; \
c2 = ((_name) >> 8) & 0xff; \
c3 = (_name) & 0xff; \
putchar( (char)c0 ); \
if ( c1 ) putchar( (char)c1 ); \
if ( c2 ) putchar( (char)c2 ); \
if ( c3 ) putchar( (char)c3 ); \
if ( (_crlf) ) \
putchar( '\n' ); \
} while (0)
/*
* This allows us to view the "Test_task" instantiations as a set
* of numbered tasks by eliminating the number of application
+6 -2
View File
@@ -29,10 +29,12 @@ rtems_task Test_task(
{
rtems_id tid;
rtems_time_of_day time;
uint32_t task_index;
uint32_t task_index;
rtems_status_code status;
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
directive_failed( status, "task ident" );
task_index = task_number( tid );
for ( ; ; ) {
status = rtems_clock_get_tod( &time );
@@ -43,6 +45,8 @@ rtems_task Test_task(
put_name( Task_name[ task_index ], FALSE );
print_time( " - rtems_clock_get_tod - ", &time, "\n" );
status = rtems_task_wake_after(
task_index * 5 * rtems_clock_get_ticks_per_second() );
task_index * 5 * rtems_clock_get_ticks_per_second()
);
directive_failed( status, "wake after" );
}
}