summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2011-01-27 21:35:48 +0100
committerMichael Brown2011-01-27 21:40:26 +0100
commit962cada830e9b0ce7049a59bef4c33ab01c6161e (patch)
tree057160b6a5f46e3e099166102f3a91b393d35103 /src/arch
parent[xfer] Expose xfer_uri_opener() (diff)
downloadipxe-962cada830e9b0ce7049a59bef4c33ab01c6161e.tar.gz
ipxe-962cada830e9b0ce7049a59bef4c33ab01c6161e.tar.xz
ipxe-962cada830e9b0ce7049a59bef4c33ab01c6161e.zip
[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/arch')
-rw-r--r--src/arch/i386/drivers/net/undionly.c6
-rw-r--r--src/arch/i386/image/bzimage.c2
-rw-r--r--src/arch/i386/image/elfboot.c2
-rw-r--r--src/arch/i386/image/multiboot.c2
-rw-r--r--src/arch/i386/image/nbi.c2
-rw-r--r--src/arch/i386/interface/pcbios/int13.c8
-rw-r--r--src/arch/i386/interface/pxe/pxe_call.c2
-rw-r--r--src/arch/i386/interface/pxe/pxe_preboot.c2
-rw-r--r--src/arch/i386/interface/syslinux/comboot_call.c4
9 files changed, 18 insertions, 12 deletions
diff --git a/src/arch/i386/drivers/net/undionly.c b/src/arch/i386/drivers/net/undionly.c
index ab9c61fb1..c38b574db 100644
--- a/src/arch/i386/drivers/net/undionly.c
+++ b/src/arch/i386/drivers/net/undionly.c
@@ -114,13 +114,13 @@ struct root_device undi_root_device __root_device = {
/**
* Prepare for exit
*
- * @v flags Shutdown flags
+ * @v booting System is shutting down for OS boot
*/
-static void undionly_shutdown ( int flags ) {
+static void undionly_shutdown ( int booting ) {
/* If we are shutting down to boot an OS, clear the "keep PXE
* stack" flag.
*/
- if ( flags & SHUTDOWN_BOOT )
+ if ( booting )
preloaded_undi.flags &= ~UNDI_FL_KEEP_ALL;
}
diff --git a/src/arch/i386/image/bzimage.c b/src/arch/i386/image/bzimage.c
index 900e34e1a..45a1e8620 100644
--- a/src/arch/i386/image/bzimage.c
+++ b/src/arch/i386/image/bzimage.c
@@ -477,7 +477,7 @@ static int bzimage_exec ( struct image *image ) {
bzimage_update_header ( image, &bzimg, bzimg.rm_kernel );
/* Prepare for exiting */
- shutdown ( SHUTDOWN_BOOT );
+ shutdown_boot();
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
"(stack %04x:%04zx)\n", image, ( bzimg.rm_kernel_seg + 0x20 ),
diff --git a/src/arch/i386/image/elfboot.c b/src/arch/i386/image/elfboot.c
index 7cb51bf9a..331d3764c 100644
--- a/src/arch/i386/image/elfboot.c
+++ b/src/arch/i386/image/elfboot.c
@@ -48,7 +48,7 @@ static int elfboot_exec ( struct image *image ) {
/* An ELF image has no callback interface, so we need to shut
* down before invoking it.
*/
- shutdown ( SHUTDOWN_BOOT );
+ shutdown_boot();
/* Jump to OS with flat physical addressing */
DBGC ( image, "ELF %p starting execution at %lx\n", image, entry );
diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c
index 041f0f2ae..3ed4d8407 100644
--- a/src/arch/i386/image/multiboot.c
+++ b/src/arch/i386/image/multiboot.c
@@ -278,7 +278,7 @@ static int multiboot_exec ( struct image *image ) {
/* Multiboot images may not return and have no callback
* interface, so shut everything down prior to booting the OS.
*/
- shutdown ( SHUTDOWN_BOOT );
+ shutdown_boot();
/* Build memory map after unhiding bootloader memory regions as part of
* shutting everything down.
diff --git a/src/arch/i386/image/nbi.c b/src/arch/i386/image/nbi.c
index 67f0d5111..804b23037 100644
--- a/src/arch/i386/image/nbi.c
+++ b/src/arch/i386/image/nbi.c
@@ -406,7 +406,7 @@ static int nbi_exec ( struct image *image ) {
/* Shut down now if NBI image will not return */
may_return = NBI_PROGRAM_RETURNS ( imgheader.flags );
if ( ! may_return )
- shutdown ( SHUTDOWN_BOOT );
+ shutdown_boot();
/* Execute NBI image */
if ( NBI_LINEAR_EXEC_ADDR ( imgheader.flags ) ) {
diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c
index 1d973e778..a27dbad7a 100644
--- a/src/arch/i386/interface/pcbios/int13.c
+++ b/src/arch/i386/interface/pcbios/int13.c
@@ -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 );
diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c
index f6324bbf6..f32080006 100644
--- a/src/arch/i386/interface/pxe/pxe_call.c
+++ b/src/arch/i386/interface/pxe/pxe_call.c
@@ -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;
}
diff --git a/src/arch/i386/interface/pxe/pxe_preboot.c b/src/arch/i386/interface/pxe/pxe_preboot.c
index 7698df528..9e4853b01 100644
--- a/src/arch/i386/interface/pxe/pxe_preboot.c
+++ b/src/arch/i386/interface/pxe/pxe_preboot.c
@@ -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 ) {
diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c
index 0c52b28a8..950832702 100644
--- a/src/arch/i386/interface/syslinux/comboot_call.c
+++ b/src/arch/i386/interface/syslinux/comboot_call.c
@@ -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 );