2009-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>

* cdtest/main.cc, fileio/init.c, fileio/system.h, pppd/pppdapp.c,
	ticker/system.h, ticker/tasks.c: Eliminate test routines
	TICKS_PER_SECOND and get_ticks_per_second() in favor of new
	rtems_clock_get_ticks_per_second().
This commit is contained in:
Joel Sherrill
2009-08-12 20:50:38 +00:00
parent c9460e17ed
commit 99f0971146
7 changed files with 17 additions and 28 deletions

View File

@@ -1,3 +1,10 @@
2009-08-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* cdtest/main.cc, fileio/init.c, fileio/system.h, pppd/pppdapp.c,
ticker/system.h, ticker/tasks.c: Eliminate test routines
TICKS_PER_SECOND and get_ticks_per_second() in favor of new
rtems_clock_get_ticks_per_second().
2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com> 2009-08-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* fileio/system.h, ticker/system.h, ticker/ticker.scn: Convert calls to * fileio/system.h, ticker/system.h, ticker/ticker.scn: Convert calls to

View File

@@ -152,7 +152,7 @@ cdtest(void)
printf("IO Stream not tested\n"); printf("IO Stream not tested\n");
#endif #endif
bar = blech; bar = blech;
rtems_task_wake_after( 5 * get_ticks_per_second() ); rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() );
} }
// //
@@ -211,7 +211,7 @@ rtems_task main_task(
printf( "Caught another exception.\n" ); printf( "Caught another exception.\n" );
} }
printf( "Exceptions are working properly.\n" ); printf( "Exceptions are working properly.\n" );
rtems_task_wake_after( 5 * get_ticks_per_second() ); rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() );
printf( "Global Dtors should be called after this line....\n" ); printf( "Global Dtors should be called after this line....\n" );
exit(0); exit(0);
} }

View File

@@ -296,7 +296,7 @@ void fileio_list_file(void)
printf("\n ******** End of file reached, flen = %d\n",flen); printf("\n ******** End of file reached, flen = %d\n",flen);
close(fd); close(fd);
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec); ticks_per_sec = rtems_clock_get_ticks_per_second();
printf("time elapsed for read: %g seconds\n", printf("time elapsed for read: %g seconds\n",
((double)curr_tick-start_tick)/ticks_per_sec); ((double)curr_tick-start_tick)/ticks_per_sec);
} }
@@ -361,7 +361,7 @@ void fileio_write_file(void)
/* /*
* get number of ticks per second * get number of ticks per second
*/ */
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec); ticks_per_sec = rtems_clock_get_ticks_per_second();
/* /*
* get path to file to write * get path to file to write
@@ -520,7 +520,7 @@ void fileio_read_file(void)
/* /*
* get number of ticks per second * get number of ticks per second
*/ */
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_sec); ticks_per_sec = rtems_clock_get_ticks_per_second();
/* /*
* get path to file to read * get path to file to read

View File

@@ -100,16 +100,6 @@ rtems_task Init(
putchar( '\n' ); \ putchar( '\n' ); \
} while (0) } while (0)
/*
* static inline routine to make obtaining ticks per second easier.
*/
static inline uint32_t get_ticks_per_second( void )
{
return rtems_clock_get_ticks_per_second();
}
/* /*
* This allows us to view the "Test_task" instantiations as a set * This allows us to view the "Test_task" instantiations as a set
* of numbered tasks by eliminating the number of application * of numbered tasks by eliminating the number of application

View File

@@ -90,7 +90,7 @@ static rtems_task pppdapp(rtems_task_argument arg)
rtems_event_set out; rtems_event_set out;
/* initialize ticks per second */ /* initialize ticks per second */
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &tickspersecond); tickspersecond = rtems_clock_get_ticks_per_second();
if ( tickspersecond == 0 ) { if ( tickspersecond == 0 ) {
/* ensure value is greater than zero */ /* ensure value is greater than zero */
tickspersecond = 100; tickspersecond = 100;

View File

@@ -3,7 +3,7 @@
* This include file contains information that is included in every * This include file contains information that is included in every
* function in the test set. * function in the test set.
* *
* COPYRIGHT (c) 1989-2008. * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -88,15 +88,6 @@ extern rtems_name Task_name[ 4 ]; /* array of task names */
putchar( '\n' ); \ putchar( '\n' ); \
} while (0) } while (0)
/*
* static inline routine to make obtaining ticks per second easier.
*/
static inline uint32_t get_ticks_per_second( void )
{
return rtems_clock_get_ticks_per_second();
}
/* /*
* This allows us to view the "Test_task" instantiations as a set * This allows us to view the "Test_task" instantiations as a set
* of numbered tasks by eliminating the number of application * of numbered tasks by eliminating the number of application

View File

@@ -7,7 +7,7 @@
* *
* Output parameters: NONE * Output parameters: NONE
* *
* COPYRIGHT (c) 1989-1999. * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR). * On-Line Applications Research Corporation (OAR).
* *
* The license and distribution terms for this file may be * The license and distribution terms for this file may be
@@ -38,6 +38,7 @@ rtems_task Test_task(
} }
put_name( Task_name[ task_index ], FALSE ); put_name( Task_name[ task_index ], FALSE );
print_time( " - rtems_clock_get_tod - ", &time, "\n" ); print_time( " - rtems_clock_get_tod - ", &time, "\n" );
status = rtems_task_wake_after( task_index * 5 * get_ticks_per_second() ); status = rtems_task_wake_after(
task_index * 5 * rtems_clock_get_ticks_per_second() );
} }
} }