source: rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c @ 8fbe2e6

4.115
Last change on this file since 8fbe2e6 was 8fbe2e6, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/14 at 13:59:49

Use correct prototype of benchmark_timer_read()

This change starts with removing the effectively empty file
timerdrv.h. The prototypes for benchmark_timer_XXX() were in
btimer.h which was not universally used. Thus every use of
timerdrv.h had to be changed to btimer.h. Then the prototypes
for benchmark_timer_read() had to be adjusted to return
benchmark_timer_t rather than int or uint32_t.

I took this opportunity to also correct the file headers to
separate the copyright from the file description comments which
is needed to ensure the copyright isn't propagated into Doxygen
output.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2013.
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 <timesys.h>
15#include <rtems/btimer.h>
16#include "test_support.h"
17
18const char rtems_test_name[] = "PSXTMNANOSLEEP 01";
19
20/* forward declarations to avoid warnings */
21void *POSIX_Init(void *argument);
22
23void *POSIX_Init(
24  void *argument
25)
26{
27  benchmark_timer_t end_time;
28  struct timespec sleepTime;
29
30  sleepTime.tv_sec = 0;
31  sleepTime.tv_nsec = 0;
32
33  TEST_BEGIN();
34
35  benchmark_timer_initialize();   
36    nanosleep( &sleepTime, (struct  timespec *) NULL );
37  end_time = benchmark_timer_read(); 
38
39  put_time( "nanosleep: yield", end_time, 1, 0, 0 );
40
41  TEST_END();
42
43  rtems_test_exit(0);
44}
45
46/* configuration information */
47
48#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
49#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
50
51#define CONFIGURE_MAXIMUM_POSIX_THREADS     1
52#define CONFIGURE_POSIX_INIT_THREAD_TABLE
53
54#define CONFIGURE_INIT
55
56#include <rtems/confdefs.h>
57/* end of file */
Note: See TracBrowser for help on using the repository browser.