aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/device.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-01-27 20:35:48 +0000
committerMichael Brown <mcb30@ipxe.org>2011-01-27 20:40:26 +0000
commit962cada830e9b0ce7049a59bef4c33ab01c6161e (patch)
tree057160b6a5f46e3e099166102f3a91b393d35103 /src/include/ipxe/device.h
parent35a50399a5881360303c0ed2d49918a660dd727d (diff)
downloadipxe-962cada830e9b0ce7049a59bef4c33ab01c6161e.tar.gz
[init] Remove concept of "shutdown exit flags"
Remove the concept of shutdown exit flags, and replace it with a counter used to keep track of exposed interfaces that require devices to remain active. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/device.h')
-rw-r--r--src/include/ipxe/device.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/ipxe/device.h b/src/include/ipxe/device.h
index 068268ba4..635ce59cc 100644
--- a/src/include/ipxe/device.h
+++ b/src/include/ipxe/device.h
@@ -112,6 +112,24 @@ struct root_driver {
/** Declare a root device */
#define __root_device __table_entry ( ROOT_DEVICES, 01 )
+extern int device_keep_count;
+
+/**
+ * Prevent devices from being removed on shutdown
+ *
+ */
+static inline void devices_get ( void ) {
+ device_keep_count++;
+}
+
+/**
+ * Allow devices to be removed on shutdown
+ *
+ */
+static inline void devices_put ( void ) {
+ device_keep_count--;
+}
+
extern struct device * identify_device ( struct interface *intf );
#define identify_device_TYPE( object_type ) \
typeof ( struct device * ( object_type ) )