Changes in kernel/generic/include/time/timeout.h [111b9b9:a6e55886] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/time/timeout.h
r111b9b9 ra6e55886 42 42 typedef void (*timeout_handler_t)(void *arg); 43 43 44 typedef uint64_t deadline_t;45 #define DEADLINE_NEVER ((deadline_t) UINT64_MAX) 44 typedef struct { 45 IRQ_SPINLOCK_DECLARE(lock); 46 46 47 typedef struct { 48 /** Link to the list of active timeouts on timeout->cpu */ 47 /** Link to the list of active timeouts on CURRENT->cpu */ 49 48 link_t link; 50 /** Timeout will be activated when current clock tick reaches this value. */51 deadline_t deadline;49 /** Timeout will be activated in this amount of clock() ticks. */ 50 uint64_t ticks; 52 51 /** Function that will be called on timeout activation. */ 53 52 timeout_handler_t handler; … … 56 55 /** On which processor is this timeout registered. */ 57 56 cpu_t *cpu; 58 /** Used to synchronize with the handler callback. */59 atomic_bool finished;60 57 } timeout_t; 61 58 62 59 #define us2ticks(us) ((uint64_t) (((uint32_t) (us) / (1000000 / HZ)))) 63 60 64 extern deadline_t timeout_deadline_in_usec(uint32_t us);65 66 61 extern void timeout_init(void); 67 62 extern void timeout_initialize(timeout_t *); 63 extern void timeout_reinitialize(timeout_t *); 68 64 extern void timeout_register(timeout_t *, uint64_t, timeout_handler_t, void *); 69 extern void timeout_register_deadline(timeout_t *, deadline_t, timeout_handler_t, void *);70 65 extern bool timeout_unregister(timeout_t *); 71 66
Note:
See TracChangeset
for help on using the changeset viewer.