forked from Imagelibrary/rtems
2011-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
* psx01/init.c, psx07/init.c, psx09/init.c, psx12/init.c, psxclock/init.c, psxtimer01/psxtimer.c: Include "pritime.h". Use PRIdtime_t to print time_t.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2011-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* psx01/init.c, psx07/init.c, psx09/init.c, psx12/init.c,
|
||||
psxclock/init.c, psxtimer01/psxtimer.c: Include "pritime.h".
|
||||
Use PRIdtime_t to print time_t.
|
||||
|
||||
2011-09-30 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* configure.ac: Check for size of time_t.
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <sched.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include "pritime.h"
|
||||
|
||||
void *POSIX_Init(
|
||||
void *argument
|
||||
)
|
||||
@@ -87,7 +89,7 @@ void *POSIX_Init(
|
||||
|
||||
status = sched_rr_get_interval( getpid(), &tr );
|
||||
printf(
|
||||
"Init: Round Robin quantum is %ld seconds, %ld nanoseconds\n",
|
||||
"Init: Round Robin quantum is %" PRIdtime_t " seconds, %ld nanoseconds\n",
|
||||
tr.tv_sec,
|
||||
tr.tv_nsec
|
||||
);
|
||||
|
||||
@@ -32,6 +32,7 @@ extern int pthread_attr_setcputime(
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
#include "tmacros.h"
|
||||
#include "pritime.h"
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
@@ -47,10 +48,10 @@ void print_schedparam(
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%ssched_ss_low_priority = %d\n",
|
||||
prefix, schedparam->sched_ss_low_priority );
|
||||
printf( "%ssched_ss_replenish_period = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_ss_replenish_period = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_repl_period.tv_sec,
|
||||
schedparam->sched_ss_repl_period.tv_nsec );
|
||||
printf( "%ssched_sched_ss_initial_budget = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_sched_ss_initial_budget = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_init_budget.tv_sec,
|
||||
schedparam->sched_ss_init_budget.tv_nsec );
|
||||
#else
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
#include "pritime.h"
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
@@ -37,10 +38,10 @@ void print_schedparam(
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%ssched_ss_low_priority = %d\n",
|
||||
prefix, schedparam->sched_ss_low_priority );
|
||||
printf( "%ssched_ss_repl_period = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_ss_repl_period = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_repl_period.tv_sec,
|
||||
schedparam->sched_ss_repl_period.tv_nsec );
|
||||
printf( "%ssched_ss_init_budget = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_ss_init_budget = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_init_budget.tv_sec,
|
||||
schedparam->sched_ss_init_budget.tv_nsec );
|
||||
#else
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
#include <errno.h>
|
||||
#include "pritime.h"
|
||||
|
||||
void print_schedparam(
|
||||
char *prefix,
|
||||
@@ -33,10 +34,10 @@ void print_schedparam(
|
||||
#if defined(_POSIX_SPORADIC_SERVER)
|
||||
printf( "%ssched_ss_low_priority = %d\n",
|
||||
prefix, schedparam->sched_ss_low_priority );
|
||||
printf( "%ssched_ss_repl_period = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_ss_repl_period = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_repl_period.tv_sec,
|
||||
schedparam->sched_ss_repl_period.tv_nsec );
|
||||
printf( "%ssched_ss_init_budget = (%ld, %ld)\n", prefix,
|
||||
printf( "%ssched_ss_init_budget = (%" PRIdtime_t ", %ld)\n", prefix,
|
||||
schedparam->sched_ss_init_budget.tv_sec,
|
||||
schedparam->sched_ss_init_budget.tv_nsec );
|
||||
#else
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <pmacros.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "pmacros.h"
|
||||
#include "pritime.h"
|
||||
|
||||
void check_enosys(int status);
|
||||
|
||||
void check_enosys(int status)
|
||||
@@ -84,7 +86,7 @@ rtems_task Init(
|
||||
|
||||
puts( "Init: clock_getres - SUCCESSFUL" );
|
||||
sc = clock_getres( CLOCK_REALTIME, &tv );
|
||||
printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
|
||||
printf( "Init: resolution = sec (%" PRIdtime_t "), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec );
|
||||
rtems_test_assert( !sc );
|
||||
|
||||
/* set the time of day, and print our buffer in multiple ways */
|
||||
@@ -114,7 +116,7 @@ rtems_task Init(
|
||||
/* print new times to make sure it has changed and we can get the realtime */
|
||||
sc = clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &tv );
|
||||
rtems_test_assert( !sc );
|
||||
printf("Time since boot: (%" PRItime_t ", %ld)\n", tv.tv_sec,tv.tv_nsec );
|
||||
printf("Time since boot: (%" PRIdtime_t ", %ld)\n", tv.tv_sec,tv.tv_nsec );
|
||||
|
||||
sc = clock_gettime( CLOCK_REALTIME, &tv );
|
||||
rtems_test_assert( !sc );
|
||||
@@ -207,7 +209,7 @@ rtems_task Init(
|
||||
|
||||
/* check the time remaining */
|
||||
|
||||
printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
|
||||
printf( "Init: sec (%" PRIdtime_t "), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec );
|
||||
rtems_test_assert( !tr.tv_sec && !tr.tv_nsec );
|
||||
|
||||
puts( "Init: nanosleep - 1.35 seconds" );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <time.h> /* time facilities */
|
||||
#include <stdio.h> /* console facilities */
|
||||
#include <rtems/score/timespec.h>
|
||||
#include "pritime.h"
|
||||
|
||||
void StopTimer(
|
||||
timer_t timer_id,
|
||||
@@ -125,7 +126,7 @@ void * task_a (void *arg)
|
||||
rtems_test_exit(0);
|
||||
}
|
||||
printf(
|
||||
"task A: timer_settime - value=%" PRItime_t ":%ld interval=%" PRItime_t ":%ld\n",
|
||||
"task A: timer_settime - value=%" PRIdtime_t ":%ld interval=%" PRIdtime_t ":%ld\n",
|
||||
timergetdata.it_value.tv_sec, timergetdata.it_value.tv_nsec,
|
||||
timergetdata.it_interval.tv_sec, timergetdata.it_interval.tv_nsec
|
||||
);
|
||||
@@ -311,7 +312,7 @@ void * task_c (void *arg)
|
||||
rtems_test_exit(0);
|
||||
}
|
||||
printf(
|
||||
"task C: timer_gettime - %" PRItime_t ":%ld remaining from %" PRItime_t ":%ld\n",
|
||||
"task C: timer_gettime - %" PRIdtime_t ":%ld remaining from %" PRIdtime_t ":%ld\n",
|
||||
timergetdata.it_value.tv_sec, timergetdata.it_value.tv_nsec,
|
||||
timergetdata.it_interval.tv_sec, timergetdata.it_interval.tv_nsec
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user