summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2009-02-23 09:43:27 +0100
committerMichael Brown2009-02-23 09:43:27 +0100
commit784d3f336eced5db53a02b272e77927ce20c2236 (patch)
tree08a7a00cc511367f660ebd4557f4ce9552ca57b2
parent[pxeprefix] Search for the PXE entry points through all methods (diff)
downloadipxe-784d3f336eced5db53a02b272e77927ce20c2236.tar.gz
ipxe-784d3f336eced5db53a02b272e77927ce20c2236.tar.xz
ipxe-784d3f336eced5db53a02b272e77927ce20c2236.zip
[pxe] Set %ax to zero on entry to PXE NBP
This is not strictly an entry requirement, but it does mean that a PXE NBP returning without setting %ax will appear to have returned success.
-rw-r--r--src/arch/i386/interface/pxe/pxe_call.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c
index 320ae125..06dee25c 100644
--- a/src/arch/i386/interface/pxe/pxe_call.c
+++ b/src/arch/i386/interface/pxe/pxe_call.c
@@ -433,23 +433,24 @@ void pxe_init_structures ( void ) {
* @ret rc Return status code
*/
int pxe_start_nbp ( void ) {
- int discard_b, discard_c, discard_d;
+ int discard_b, discard_c, discard_d, discard_D;
uint16_t rc;
/* Far call to PXE NBP */
- __asm__ __volatile__ ( REAL_CODE ( "pushw %%cx\n\t"
- "pushw %%ax\n\t"
- "movw %%cx, %%es\n\t"
+ __asm__ __volatile__ ( REAL_CODE ( "movw %%cx, %%es\n\t"
+ "pushw %%es\n\t"
+ "pushw %%di\n\t"
"sti\n\t"
"lcall $0, $0x7c00\n\t"
"addw $4, %%sp\n\t" )
: "=a" ( rc ), "=b" ( discard_b ),
- "=c" ( discard_c ), "=d" ( discard_d )
- : "a" ( __from_text16 ( &ppxe ) ),
- "b" ( __from_text16 ( &pxenv ) ),
+ "=c" ( discard_c ), "=d" ( discard_d ),
+ "=D" ( discard_D )
+ : "a" ( 0 ), "b" ( __from_text16 ( &pxenv ) ),
"c" ( rm_cs ),
- "d" ( virt_to_phys ( &pxenv ) )
- : "esi", "edi", "ebp", "memory" );
+ "d" ( virt_to_phys ( &pxenv ) ),
+ "D" ( __from_text16 ( &ppxe ) )
+ : "esi", "ebp", "memory" );
return rc;
}