瀏覽代碼

PM function called by prot_call() should be allowed to modifying

registers returned to RM code.
tags/v0.9.3
Michael Brown 19 年之前
父節點
當前提交
a800e9657d
共有 1 個檔案被更改,包括 15 行新增2 行删除
  1. 15
    2
      src/arch/i386/transitions/librm.S

+ 15
- 2
src/arch/i386/transitions/librm.S 查看文件

496
 	movl	$SIZEOF_REAL_MODE_REGS, %ecx
496
 	movl	$SIZEOF_REAL_MODE_REGS, %ecx
497
 	subl	%ecx, %esp
497
 	subl	%ecx, %esp
498
 	movl	%esp, %edi
498
 	movl	%esp, %edi
499
+	pushl	%esi
499
 	cld
500
 	cld
500
-	rep	movsb
501
+	rep movsb
502
+	popl	%edi		/* %edi = phys addr of RM copy of rm_regs */
501
 	
503
 	
502
 	/* Switch to virtual addresses. */
504
 	/* Switch to virtual addresses. */
503
 	call	1f
505
 	call	1f
522
 
524
 
523
 	/* Switch to physical addresses, discard PM register store */
525
 	/* Switch to physical addresses, discard PM register store */
524
 	lcall	$VIRTUAL_CS, $_virt_to_phys
526
 	lcall	$VIRTUAL_CS, $_virt_to_phys
525
-	addl	$SIZEOF_REAL_MODE_REGS+4, %esp /* also discard lcall seg */
527
+	popl	%eax /* discard */
528
+
529
+	/* Copy rm_regs from PM stack to RM stack, and remove rm_regs
530
+	 * from PM stack.  (%edi still contains physical address of
531
+	 * rm_regs on RM stack from earlier, since C code preserves
532
+	 * %edi).
533
+	 */
534
+	movl	%esp, %esi
535
+	movl	$SIZEOF_REAL_MODE_REGS, %ecx
536
+	cld
537
+	rep movsb
538
+	movl	%esi, %esp	/* remove rm_regs from PM stack */
526
 
539
 
527
 	/* Switch to real mode */
540
 	/* Switch to real mode */
528
 	call	prot_to_real
541
 	call	prot_to_real

Loading…
取消
儲存