|
0
|
1 #ifndef CYGONCE_KERNEL_CLOCK_INL |
|
|
2 #define CYGONCE_KERNEL_CLOCK_INL |
|
|
3 |
|
|
4 //========================================================================== |
|
|
5 // |
|
2
|
6 // clock.inl |
|
0
|
7 // |
|
2
|
8 // Clock and Alarm class inlines |
|
0
|
9 // |
|
|
10 //========================================================================== |
|
|
11 //####COPYRIGHTBEGIN#### |
|
|
12 // |
|
|
13 // ------------------------------------------- |
|
|
14 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
15 // Version 1.0 (the "License"); you may not use this file except in |
|
|
16 // compliance with the License. You may obtain a copy of the License at |
|
|
17 // http://sourceware.cygnus.com/ecos |
|
|
18 // |
|
|
19 // Software distributed under the License is distributed on an "AS IS" |
|
|
20 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
21 // License for the specific language governing rights and limitations under |
|
|
22 // the License. |
|
|
23 // |
|
|
24 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
25 // September 30, 1998. |
|
|
26 // |
|
|
27 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
2
|
28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
0
|
29 // ------------------------------------------- |
|
|
30 // |
|
|
31 //####COPYRIGHTEND#### |
|
|
32 //========================================================================== |
|
|
33 //#####DESCRIPTIONBEGIN#### |
|
|
34 // |
|
2
|
35 // Author(s): nickg |
|
|
36 // Contributors: nickg |
|
|
37 // Date: 1997-09-30 |
|
|
38 // Purpose: Define Clock and Alarm class inlines |
|
|
39 // Description: Define inline functions for counter, clock and alarm |
|
0
|
40 // classes. |
|
|
41 // Usage: #include <cyg/kernel/clock.hxx> |
|
|
42 // #include <cyg/kernel/clock.inl> |
|
|
43 // |
|
|
44 //####DESCRIPTIONEND#### |
|
|
45 // |
|
|
46 //========================================================================== |
|
|
47 |
|
|
48 #include <cyg/kernel/clock.hxx> |
|
|
49 |
|
|
50 // ------------------------------------------------------------------------- |
|
|
51 // ------------------------------------------------------------------------- |
|
|
52 // Counter class inlines |
|
|
53 |
|
|
54 // Return current value of counter |
|
|
55 inline cyg_tick_count Cyg_Counter::current_value() |
|
|
56 { |
|
|
57 return counter; |
|
|
58 } |
|
|
59 |
|
|
60 inline cyg_uint32 Cyg_Counter::current_value_lo() |
|
|
61 { |
|
|
62 return counter&0xFFFFFFFF; |
|
|
63 } |
|
|
64 |
|
|
65 inline cyg_uint32 Cyg_Counter::current_value_hi() |
|
|
66 { |
|
|
67 return (counter>>32)&0xFFFFFFFF; |
|
|
68 } |
|
|
69 |
|
|
70 // Set the counter's current value |
|
|
71 inline void Cyg_Counter::set_value( cyg_tick_count new_value) |
|
|
72 { |
|
|
73 counter = new_value; |
|
|
74 } |
|
|
75 |
|
|
76 // ------------------------------------------------------------------------- |
|
|
77 // ------------------------------------------------------------------------- |
|
|
78 // Clock class inlines |
|
|
79 |
|
|
80 // Return current resolution |
|
|
81 inline Cyg_Clock::cyg_resolution Cyg_Clock::get_resolution() |
|
|
82 { |
|
|
83 return resolution; |
|
|
84 } |
|
|
85 |
|
|
86 // Set new resolution |
|
|
87 inline void Cyg_Clock::set_resolution( |
|
|
88 Cyg_Clock::cyg_resolution new_resolution |
|
|
89 ) |
|
|
90 { |
|
|
91 resolution = new_resolution; |
|
|
92 } |
|
|
93 |
|
|
94 // ------------------------------------------------------------------------- |
|
|
95 // ------------------------------------------------------------------------- |
|
|
96 // Alarm inlines |
|
|
97 |
|
|
98 // Ensure alarm disabled |
|
|
99 inline void Cyg_Alarm::disable() |
|
|
100 { |
|
|
101 if( enabled ) counter->rem_alarm(this); |
|
|
102 } |
|
|
103 |
|
|
104 |
|
|
105 // ------------------------------------------------------------------------- |
|
|
106 #endif // ifndef CYGONCE_KERNEL_CLOCK_INL |
|
|
107 // EOF clock.inl |