4.104.115
Line | |
---|
1 | /* |
---|
2 | * Clock Manager - get uptime |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2007. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #if HAVE_CONFIG_H |
---|
15 | #include "config.h" |
---|
16 | #endif |
---|
17 | |
---|
18 | #include <rtems/system.h> |
---|
19 | #include <rtems/rtems/status.h> |
---|
20 | #include <rtems/rtems/clock.h> |
---|
21 | #include <rtems/score/isr.h> |
---|
22 | #include <rtems/score/thread.h> |
---|
23 | #include <rtems/score/timestamp.h> |
---|
24 | #include <rtems/score/tod.h> |
---|
25 | #include <rtems/score/watchdog.h> |
---|
26 | |
---|
27 | /*PAGE |
---|
28 | * |
---|
29 | * rtems_clock_get_uptime |
---|
30 | * |
---|
31 | * This directive obtains the system uptime. A timestamp is the seconds |
---|
32 | * and nanoseconds since boot. |
---|
33 | * |
---|
34 | * Input parameters: |
---|
35 | * timestamp - pointer to the timestamp |
---|
36 | * |
---|
37 | * Output parameters: |
---|
38 | * *uptime - filled in |
---|
39 | * RTEMS_SUCCESSFUL - if successful |
---|
40 | * error code - if unsuccessful |
---|
41 | */ |
---|
42 | rtems_status_code rtems_clock_get_uptime( |
---|
43 | struct timespec *uptime |
---|
44 | ) |
---|
45 | { |
---|
46 | if ( !uptime ) |
---|
47 | return RTEMS_INVALID_ADDRESS; |
---|
48 | |
---|
49 | _TOD_Get_uptime_as_timespec( uptime ); |
---|
50 | return RTEMS_SUCCESSFUL; |
---|
51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.