1 #ifndef _IPXE_PENDING_H
2 #define _IPXE_PENDING_H
3 
4 /** @file
5  *
6  * Pending operations
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 /** A pending operation */
13 struct pending_operation {
14 	/** Pending count */
15 	unsigned int count;
16 };
17 
18 /**
19  * Check if an operation is pending
20  *
21  * @v pending		Pending operation
22  * @ret is_pending	Operation is pending
23  */
is_pending(struct pending_operation * pending)24 static inline int is_pending ( struct pending_operation *pending ) {
25 	return ( pending->count != 0 );
26 }
27 
28 extern int pending_total;
29 
30 /**
31  * Check if any operations are pending
32  *
33  * @ret have_pending	Some operations are pending
34  */
have_pending(void)35 static inline int have_pending ( void ) {
36 	return ( pending_total != 0 );
37 }
38 
39 extern void pending_get ( struct pending_operation *pending );
40 extern void pending_put ( struct pending_operation *pending );
41 
42 #endif /* _IPXE_PENDING_H */
43