mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 21:11:03 +03:00
[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>
This commit is contained in:
@@ -35,6 +35,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
/** Registered root devices */
|
||||
static LIST_HEAD ( devices );
|
||||
|
||||
/** Device removal inhibition counter */
|
||||
int device_keep_count = 0;
|
||||
|
||||
/**
|
||||
* Probe a root device
|
||||
*
|
||||
@@ -87,11 +90,11 @@ static void probe_devices ( void ) {
|
||||
* Remove all devices
|
||||
*
|
||||
*/
|
||||
static void remove_devices ( int flags ) {
|
||||
static void remove_devices ( int booting __unused ) {
|
||||
struct root_device *rootdev;
|
||||
struct root_device *tmp;
|
||||
|
||||
if ( flags & SHUTDOWN_KEEP_DEVICES ) {
|
||||
if ( device_keep_count != 0 ) {
|
||||
DBG ( "Refusing to remove devices on shutdown\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ __asmcall int main ( void ) {
|
||||
shell();
|
||||
}
|
||||
|
||||
shutdown ( SHUTDOWN_EXIT | shutdown_exit_flags );
|
||||
shutdown_exit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user