소스 검색

[librm] Simplify definitions for prot_call() and real_call() stack frames

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 년 전
부모
커밋
adac4b1984
1개의 변경된 파일17개의 추가작업 그리고 14개의 파일을 삭제
  1. 17
    14
      src/arch/x86/transitions/librm.S

+ 17
- 14
src/arch/x86/transitions/librm.S 파일 보기

@@ -390,13 +390,14 @@ rm_gdtr:
390 390
  *      void pxe_api_call ( struct i386_all_regs *ix86 );
391 391
  ****************************************************************************
392 392
  */
393
-
394
-#define PC_OFFSET_GDT ( 0 )
395
-#define PC_OFFSET_IDT ( PC_OFFSET_GDT + 6 )
396
-#define PC_OFFSET_IX86 ( PC_OFFSET_IDT + 6 )
397
-#define PC_OFFSET_RETADDR ( PC_OFFSET_IX86 + SIZEOF_I386_ALL_REGS )
398
-#define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
399
-#define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
393
+	.struct	0
394
+PC_OFFSET_GDT:		.space	6
395
+PC_OFFSET_IDT:		.space	6
396
+PC_OFFSET_IX86:		.space	SIZEOF_I386_ALL_REGS
397
+PC_OFFSET_RETADDR:	.space	4
398
+PC_OFFSET_FUNCTION:	.space	4
399
+PC_OFFSET_END:
400
+	.previous
400 401
 
401 402
 	.section ".text16.prot_call", "ax", @progbits
402 403
 	.code16
@@ -478,11 +479,13 @@ pc_rmode:
478 479
  * Returns: none
479 480
  ****************************************************************************
480 481
  */
481
-
482
-#define RC_OFFSET_PRESERVE_REGS ( 0 )
483
-#define RC_OFFSET_RETADDR ( RC_OFFSET_PRESERVE_REGS + SIZEOF_I386_REGS )
484
-#define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
485
-#define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
482
+	.struct	0
483
+RC_OFFSET_REGS:		.space	SIZEOF_I386_REGS
484
+RC_OFFSET_REGS_END:
485
+RC_OFFSET_RETADDR:	.space	4
486
+RC_OFFSET_FUNCTION:	.space	4
487
+RC_OFFSET_END:
488
+	.previous
486 489
 
487 490
 	.section ".text.real_call", "ax", @progbits
488 491
 	.code32
@@ -493,7 +496,7 @@ real_call:
493 496
 	pushl	RC_OFFSET_FUNCTION(%esp)
494 497
 
495 498
 	/* Switch to real mode and move register dump to RM stack  */
496
-	movl	$( RC_OFFSET_RETADDR + 4 /* function pointer copy */ ), %ecx
499
+	movl	$( RC_OFFSET_REGS_END + 4 /* function pointer copy */ ), %ecx
497 500
 	pushl	$rc_rmode
498 501
 	movl	$rm_default_gdtr_idtr, %esi
499 502
 	jmp	prot_to_real
@@ -510,7 +513,7 @@ rc_rmode:
510 513
 	cld
511 514
 
512 515
 	/* Switch to protected mode and move register dump back to PM stack */
513
-	movl	$RC_OFFSET_RETADDR, %ecx
516
+	movl	$RC_OFFSET_REGS_END, %ecx
514 517
 	pushl	$rc_pmode
515 518
 	jmp	real_to_prot
516 519
 	.section ".text.real_call", "ax", @progbits

Loading…
취소
저장