summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2009-02-17 03:03:16 +0100
committerMichael Brown2009-02-17 03:03:16 +0100
commit7f903f03afbadd809923a10fac57d59400e94182 (patch)
treed51cffa86e1dc7352a8054461a2887c12dd63256
parent[comboot] Fix reference counting on replacement images (diff)
downloadipxe-7f903f03afbadd809923a10fac57d59400e94182.tar.gz
ipxe-7f903f03afbadd809923a10fac57d59400e94182.tar.xz
ipxe-7f903f03afbadd809923a10fac57d59400e94182.zip
[comboot] Unhook interrupt vectors after returning from a COMBOOT image
-rw-r--r--src/arch/i386/image/com32.c1
-rw-r--r--src/arch/i386/image/comboot.c1
-rw-r--r--src/arch/i386/include/comboot.h1
-rw-r--r--src/arch/i386/interface/syslinux/comboot_call.c15
4 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/i386/image/com32.c b/src/arch/i386/image/com32.c
index 3e81f485..00f75263 100644
--- a/src/arch/i386/image/com32.c
+++ b/src/arch/i386/image/com32.c
@@ -136,6 +136,7 @@ static int com32_exec ( struct image *image ) {
break;
}
+ unhook_comboot_interrupts();
comboot_force_text_mode();
return 0;
diff --git a/src/arch/i386/image/comboot.c b/src/arch/i386/image/comboot.c
index e0452647..d9b16c57 100644
--- a/src/arch/i386/image/comboot.c
+++ b/src/arch/i386/image/comboot.c
@@ -205,6 +205,7 @@ static int comboot_exec ( struct image *image ) {
break;
}
+ unhook_comboot_interrupts();
comboot_force_text_mode();
return 0;
diff --git a/src/arch/i386/include/comboot.h b/src/arch/i386/include/comboot.h
index 4376650f..6b8ea6b6 100644
--- a/src/arch/i386/include/comboot.h
+++ b/src/arch/i386/include/comboot.h
@@ -64,6 +64,7 @@ typedef struct {
} comboot_shuffle_descriptor;
extern void hook_comboot_interrupts ( );
+extern void unhook_comboot_interrupts ( );
/* These are not the correct prototypes, but it doens't matter,
* as we only ever get the address of these functions;
diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c
index f37aa2ae..c641c840 100644
--- a/src/arch/i386/interface/syslinux/comboot_call.c
+++ b/src/arch/i386/interface/syslinux/comboot_call.c
@@ -616,3 +616,18 @@ void hook_comboot_interrupts ( ) {
hook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
&int22_vector );
}
+
+/**
+ * Unhook BIOS interrupts related to COMBOOT API (INT 20h, 21h, 22h)
+ */
+void unhook_comboot_interrupts ( ) {
+
+ unhook_bios_interrupt ( 0x20, ( unsigned int ) int20_wrapper,
+ &int20_vector );
+
+ unhook_bios_interrupt ( 0x21, ( unsigned int ) int21_wrapper,
+ &int21_vector );
+
+ unhook_bios_interrupt ( 0x22, ( unsigned int ) int22_wrapper,
+ &int22_vector );
+}