Mercurial > ecos
comparison packages/kernel/current/include/clock.hxx @ 148:8f2f7615e727
Merge from eCos master repository on 2001-01-12-06:43:03-GMT
| author | jlarmour |
|---|---|
| date | Fri, 12 Jan 2001 08:11:46 +0000 |
| parents | 6ed91473a1cd |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 147:d397fc472bcf | 148:8f2f7615e727 |
|---|---|
| 48 //========================================================================== | 48 //========================================================================== |
| 49 | 49 |
| 50 #include <cyg/kernel/ktypes.h> | 50 #include <cyg/kernel/ktypes.h> |
| 51 #include <cyg/infra/cyg_ass.h> // assertion macros | 51 #include <cyg/infra/cyg_ass.h> // assertion macros |
| 52 | 52 |
| 53 // ------------------------------------------------------------------------- | 53 #include <cyg/infra/clist.hxx> |
| 54 | |
| 55 // ------------------------------------------------------------------------- | |
| 56 // Forward definitions and typedefs. | |
| 54 | 57 |
| 55 class Cyg_Alarm; | 58 class Cyg_Alarm; |
| 56 | 59 |
| 57 typedef void cyg_alarm_fn(Cyg_Alarm *alarm, CYG_ADDRWORD data); | 60 typedef void cyg_alarm_fn(Cyg_Alarm *alarm, CYG_ADDRWORD data); |
| 61 | |
| 62 typedef Cyg_CList_T<Cyg_Alarm> Cyg_Alarm_List; | |
| 58 | 63 |
| 59 // ------------------------------------------------------------------------- | 64 // ------------------------------------------------------------------------- |
| 60 // Counter object. | 65 // Counter object. |
| 61 | 66 |
| 62 class Cyg_Counter | 67 class Cyg_Counter |
| 64 | 69 |
| 65 friend class Cyg_Alarm; | 70 friend class Cyg_Alarm; |
| 66 | 71 |
| 67 #if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) | 72 #if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) |
| 68 | 73 |
| 69 Cyg_Alarm *alarm_list; // Linear list of Alarms | 74 Cyg_Alarm_List alarm_list; // Linear list of Alarms |
| 70 | 75 |
| 71 #elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) | 76 #elif defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) |
| 72 | 77 |
| 73 Cyg_Alarm *alarm_list[CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE]; | 78 Cyg_Alarm_List alarm_list[CYGNUM_KERNEL_COUNTERS_MULTI_LIST_SIZE]; |
| 74 | 79 |
| 75 #endif | 80 #endif |
| 76 | 81 |
| 77 volatile cyg_tick_count counter; // counter value | 82 volatile cyg_tick_count counter; // counter value |
| 78 | 83 |
| 187 // ------------------------------------------------------------------------- | 192 // ------------------------------------------------------------------------- |
| 188 // Alarm class. An alarm may be attached to a counter (or a clock) to be | 193 // Alarm class. An alarm may be attached to a counter (or a clock) to be |
| 189 // called when the trigger value is reached. | 194 // called when the trigger value is reached. |
| 190 | 195 |
| 191 class Cyg_Alarm | 196 class Cyg_Alarm |
| 197 #if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) || defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) | |
| 198 : public Cyg_DNode_T<Cyg_Alarm> | |
| 199 #endif | |
| 192 { | 200 { |
| 193 friend class Cyg_Counter; | 201 friend class Cyg_Counter; |
| 194 | 202 |
| 195 #if defined(CYGIMP_KERNEL_COUNTERS_SINGLE_LIST) || defined(CYGIMP_KERNEL_COUNTERS_MULTI_LIST) | |
| 196 | |
| 197 Cyg_Alarm *next; // next alarm in list | |
| 198 | |
| 199 #endif | |
| 200 | |
| 201 protected: | 203 protected: |
| 202 Cyg_Counter *counter; // Attached to this counter/clock | 204 Cyg_Counter *counter; // Attached to this counter/clock |
| 203 | 205 |
| 204 cyg_alarm_fn *alarm; // Call-back function | 206 cyg_alarm_fn *alarm; // Call-back function |
| 205 | 207 |
