Browse Source

[retry] Add TIMER_INIT() for initialising static timers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
0f65efc185
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      src/include/ipxe/retry.h

+ 9
- 0
src/include/ipxe/retry.h View File

72
 	timer->refcnt = refcnt;
72
 	timer->refcnt = refcnt;
73
 }
73
 }
74
 
74
 
75
+/**
76
+ * Initialise a static timer
77
+ *
78
+ * @v expired_fn	Timer expired callback
79
+ */
80
+#define TIMER_INIT( expired_fn ) {			\
81
+		.expired = (expired_fn),		\
82
+	}
83
+
75
 extern void start_timer ( struct retry_timer *timer );
84
 extern void start_timer ( struct retry_timer *timer );
76
 extern void start_timer_fixed ( struct retry_timer *timer,
85
 extern void start_timer_fixed ( struct retry_timer *timer,
77
 				unsigned long timeout );
86
 				unsigned long timeout );

Loading…
Cancel
Save