[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:
Michael Brown
2011-01-27 20:35:48 +00:00
parent 35a50399a5
commit 962cada830
17 changed files with 64 additions and 37 deletions

View File

@@ -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;
}

View File

@@ -85,7 +85,7 @@ __asmcall int main ( void ) {
shell();
}
shutdown ( SHUTDOWN_EXIT | shutdown_exit_flags );
shutdown_exit();
return 0;
}