[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:
@@ -1209,8 +1209,10 @@ static int int13_hook ( struct uri *uri, unsigned int drive ) {
|
||||
int13->cylinders, int13->heads, int13->sectors_per_track );
|
||||
|
||||
/* Hook INT 13 vector if not already hooked */
|
||||
if ( list_empty ( &int13s ) )
|
||||
if ( list_empty ( &int13s ) ) {
|
||||
int13_hook_vector();
|
||||
devices_get();
|
||||
}
|
||||
|
||||
/* Add to list of emulated drives */
|
||||
list_add ( &int13->list, &int13s );
|
||||
@@ -1277,8 +1279,10 @@ static void int13_unhook ( unsigned int drive ) {
|
||||
DBGC ( int13, "INT13 drive %02x unregistered\n", int13->drive );
|
||||
|
||||
/* Unhook INT 13 vector if no more drives */
|
||||
if ( list_empty ( &int13s ) )
|
||||
if ( list_empty ( &int13s ) ) {
|
||||
devices_put();
|
||||
int13_unhook_vector();
|
||||
}
|
||||
|
||||
/* Drop list's reference to drive */
|
||||
ref_put ( &int13->refcnt );
|
||||
|
||||
@@ -448,6 +448,7 @@ void pxe_activate ( struct net_device *netdev ) {
|
||||
if ( ! int_1a_hooked ) {
|
||||
hook_bios_interrupt ( 0x1a, ( unsigned int ) pxe_int_1a,
|
||||
&pxe_int_1a_vector );
|
||||
devices_get();
|
||||
int_1a_hooked = 1;
|
||||
}
|
||||
|
||||
@@ -475,6 +476,7 @@ int pxe_deactivate ( void ) {
|
||||
strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
devices_put();
|
||||
int_1a_hooked = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI *stop_undi ) {
|
||||
pxe_deactivate();
|
||||
|
||||
/* Prepare for unload */
|
||||
shutdown ( SHUTDOWN_BOOT );
|
||||
shutdown_boot();
|
||||
|
||||
/* Check to see if we still have any hooked interrupts */
|
||||
if ( hooked_bios_interrupts != 0 ) {
|
||||
|
||||
@@ -531,7 +531,7 @@ static __asmcall void int22 ( struct i386_all_regs *ix86 ) {
|
||||
break;
|
||||
|
||||
/* Perform final cleanup */
|
||||
shutdown ( SHUTDOWN_BOOT );
|
||||
shutdown_boot();
|
||||
|
||||
/* Perform sequence of copies */
|
||||
shuffle ( ix86->segs.es, ix86->regs.di, ix86->regs.cx );
|
||||
@@ -608,7 +608,7 @@ static __asmcall void int22 ( struct i386_all_regs *ix86 ) {
|
||||
break;
|
||||
|
||||
/* Perform final cleanup */
|
||||
shutdown ( SHUTDOWN_BOOT );
|
||||
shutdown_boot();
|
||||
|
||||
/* Perform sequence of copies */
|
||||
shuffle ( ix86->segs.es, ix86->regs.di, ix86->regs.cx );
|
||||
|
||||
Reference in New Issue
Block a user