浏览代码

[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.
tags/v0.9.7
Michael Brown 15 年前
父节点
当前提交
784d3f336e
共有 1 个文件被更改,包括 10 次插入9 次删除
  1. 10
    9
      src/arch/i386/interface/pxe/pxe_call.c

+ 10
- 9
src/arch/i386/interface/pxe/pxe_call.c 查看文件

@@ -433,23 +433,24 @@ void pxe_init_structures ( void ) {
433 433
  * @ret rc		Return status code
434 434
  */
435 435
 int pxe_start_nbp ( void ) {
436
-	int discard_b, discard_c, discard_d;
436
+	int discard_b, discard_c, discard_d, discard_D;
437 437
 	uint16_t rc;
438 438
 
439 439
 	/* Far call to PXE NBP */
440
-	__asm__ __volatile__ ( REAL_CODE ( "pushw %%cx\n\t"
441
-					   "pushw %%ax\n\t"
442
-					   "movw %%cx, %%es\n\t"
440
+	__asm__ __volatile__ ( REAL_CODE ( "movw %%cx, %%es\n\t"
441
+					   "pushw %%es\n\t"
442
+					   "pushw %%di\n\t"
443 443
 					   "sti\n\t"
444 444
 					   "lcall $0, $0x7c00\n\t"
445 445
 					   "addw $4, %%sp\n\t" )
446 446
 			       : "=a" ( rc ), "=b" ( discard_b ),
447
-				 "=c" ( discard_c ), "=d" ( discard_d )
448
-			       : "a" ( __from_text16 ( &ppxe ) ),
449
-			         "b" ( __from_text16 ( &pxenv ) ),
447
+				 "=c" ( discard_c ), "=d" ( discard_d ),
448
+				 "=D" ( discard_D )
449
+			       : "a" ( 0 ), "b" ( __from_text16 ( &pxenv ) ),
450 450
 			         "c" ( rm_cs ),
451
-			         "d" ( virt_to_phys ( &pxenv ) )
452
-			       : "esi", "edi", "ebp", "memory" );
451
+			         "d" ( virt_to_phys ( &pxenv ) ),
452
+				 "D" ( __from_text16 ( &ppxe ) )
453
+			       : "esi", "ebp", "memory" );
453 454
 
454 455
 	return rc;
455 456
 }

正在加载...
取消
保存