summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/device.h
diff options
context:
space:
mode:
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 ) )