Browse Source

[pxe] Check for unhookable interrupts in PXENV_STOP_UNDI

PXENV_STOP_UNDI should return PXENV_STATUS_KEEP_UNDI if the UNDI
cannot be safely unloaded (e.g. due to interrupt vectors that could
not be unhooked).
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
ee1d315ac0
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      src/arch/i386/interface/pxe/pxe_preboot.c

+ 9
- 0
src/arch/i386/interface/pxe/pxe_preboot.c View File

@@ -37,6 +37,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
37 37
 #include <gpxe/init.h>
38 38
 #include <gpxe/if_ether.h>
39 39
 #include <basemem_packet.h>
40
+#include <biosint.h>
40 41
 #include "pxe.h"
41 42
 #include "pxe_call.h"
42 43
 
@@ -316,6 +317,14 @@ PXENV_EXIT_t pxenv_stop_undi ( struct s_PXENV_STOP_UNDI *stop_undi ) {
316 317
 	/* Prepare for unload */
317 318
 	shutdown ( SHUTDOWN_BOOT );
318 319
 
320
+	/* Check to see if we still have any hooked interrupts */
321
+	if ( hooked_bios_interrupts != 0 ) {
322
+		DBG ( "PXENV_STOP_UNDI failed: %d interrupts still hooked\n",
323
+		      hooked_bios_interrupts );
324
+		stop_undi->Status = PXENV_STATUS_KEEP_UNDI;
325
+		return PXENV_EXIT_FAILURE;
326
+	}
327
+
319 328
 	stop_undi->Status = PXENV_STATUS_SUCCESS;
320 329
 	return PXENV_EXIT_SUCCESS;
321 330
 }

Loading…
Cancel
Save