1 | -- |
---|
2 | -- RTEMS / Specification |
---|
3 | -- |
---|
4 | -- DESCRIPTION: |
---|
5 | -- |
---|
6 | -- This package provides the interface to the RTEMS API. |
---|
7 | -- |
---|
8 | -- DEPENDENCIES: |
---|
9 | -- |
---|
10 | -- NOTES: |
---|
11 | -- RTEMS initialization and configuration are called from |
---|
12 | -- the BSP side, therefore should never be called from ADA. |
---|
13 | -- |
---|
14 | -- COPYRIGHT (c) 1997-2011. |
---|
15 | -- On-Line Applications Research Corporation (OAR). |
---|
16 | -- |
---|
17 | -- The license and distribution terms for this file may in |
---|
18 | -- the file LICENSE in this distribution or at |
---|
19 | -- http://www.rtems.org/license/LICENSE. |
---|
20 | -- |
---|
21 | |
---|
22 | |
---|
23 | package RTEMS.Clock is |
---|
24 | |
---|
25 | -- |
---|
26 | -- Clock Types |
---|
27 | -- |
---|
28 | |
---|
29 | type Time_Value is |
---|
30 | record |
---|
31 | Seconds : RTEMS.Unsigned32; |
---|
32 | Microseconds : RTEMS.Unsigned32; |
---|
33 | end record; |
---|
34 | |
---|
35 | type Clock_Get_Options is ( |
---|
36 | Clock_Get_TOD, |
---|
37 | Clock_Get_Seconds_Since_Epoch, |
---|
38 | Clock_Get_Ticks_Since_Boot, |
---|
39 | Clock_Get_Ticks_Per_Second, |
---|
40 | Clock_Get_Time_Value |
---|
41 | ); |
---|
42 | |
---|
43 | type Get_Options is ( |
---|
44 | Get_TOD, |
---|
45 | Get_Seconds_Since_Epoch, |
---|
46 | Get_Ticks_Since_Boot, |
---|
47 | Get_Ticks_Per_Second, |
---|
48 | Get_Time_Value |
---|
49 | ); |
---|
50 | |
---|
51 | -- |
---|
52 | -- Clock Manager |
---|
53 | -- |
---|
54 | |
---|
55 | procedure Set ( |
---|
56 | Time_Buffer : in RTEMS.Time_Of_Day; |
---|
57 | Result : out RTEMS.Status_Codes |
---|
58 | ); |
---|
59 | |
---|
60 | procedure Get ( |
---|
61 | Option : in RTEMS.Clock.Get_Options; |
---|
62 | Time_Buffer : in RTEMS.Address; |
---|
63 | Result : out RTEMS.Status_Codes |
---|
64 | ); |
---|
65 | |
---|
66 | procedure Get_TOD ( |
---|
67 | Time : out RTEMS.Time_Of_Day; |
---|
68 | Result : out RTEMS.Status_Codes |
---|
69 | ); |
---|
70 | |
---|
71 | procedure Get_TOD_Time_Value ( |
---|
72 | Time : out RTEMS.Time_Value; |
---|
73 | Result : out RTEMS.Status_Codes |
---|
74 | ); |
---|
75 | |
---|
76 | procedure Get_Seconds_Since_Epoch( |
---|
77 | The_Interval : out RTEMS.Interval; |
---|
78 | Result : out RTEMS.Status_Codes |
---|
79 | ); |
---|
80 | |
---|
81 | function Get_Ticks_Per_Second |
---|
82 | return RTEMS.Interval; |
---|
83 | pragma Import ( |
---|
84 | C, |
---|
85 | Get_Ticks_Per_Second, |
---|
86 | "rtems_clock_get_ticks_per_second" |
---|
87 | ); |
---|
88 | |
---|
89 | function Get_Ticks_Since_Boot |
---|
90 | return RTEMS.Interval; |
---|
91 | pragma Import ( |
---|
92 | C, |
---|
93 | Get_Ticks_Since_Boot, |
---|
94 | "rtems_clock_get_ticks_since_boot" |
---|
95 | ); |
---|
96 | |
---|
97 | procedure Get_Uptime ( |
---|
98 | Uptime : out RTEMS.Timespec; |
---|
99 | Result : out RTEMS.Status_Codes |
---|
100 | ); |
---|
101 | |
---|
102 | procedure Tick ( |
---|
103 | Result : out RTEMS.Status_Codes |
---|
104 | ); |
---|
105 | |
---|
106 | end RTEMS.Clock; |
---|
107 | |
---|