WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] rombios: fix argument to PMM

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] rombios: fix argument to PMM
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Mon, 26 Jan 2009 14:27:06 +0900
Delivery-date: Sun, 25 Jan 2009 21:27:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The pointer to PMM function arguments must be converted to
protected-mode from real-mode.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 2f993fde1dc6 tools/firmware/rombios/rombios.c
--- a/tools/firmware/rombios/rombios.c  Sun Jan 25 10:32:26 2009 +0000
+++ b/tools/firmware/rombios/rombios.c  Mon Jan 26 14:03:01 2009 +0900
@@ -10366,18 +10366,34 @@
   db 0,0,0,0,0 ;; reserved
 
 pmm_entry_point:
+  pushf
   pushad
-  mov   eax, esp
-  add   eax, #(8*4+2+2) ;; skip regs of pushad, ip, cs
-  push  eax ;; pointer to PMM function args
+; Calculate protected-mode address of PMM function args
+  xor  eax, eax
+  mov  ax, sp
+  xor  ebx, ebx
+  mov  bx, ss
+  shl  ebx, 4
+  lea  ebx, [eax+ebx+38] ;; ebx=(ss<<4)+sp+4(far call)+2(pushf)+32(pushad)
+  push ebx
+;
+; Stack layout at this point:
+;
+;        : +0x0    +0x2    +0x4    +0x6    +0x8    +0xa    +0xc    +0xe
+; -----------------------------------------------------------------------
+; sp     : [&arg1         ][edi           ][esi           ][ebp           ]
+; sp+0x10: [esp           ][ebx           ][edx           ][ecx           ]
+; sp+0x20: [eax           ][flags ][ip    ][cs    ][arg1  ][arg2, ...
+;
   call _pmm
-  mov   bx, sp
+  mov  bx, sp
 SEG SS
-  mov   [bx+(4+7*4)], ax
+  mov  [bx+0x20], ax
 SEG SS
-  mov   [bx+(4+5*4)], dx
-  pop   eax
+  mov  [bx+0x18], dx
+  pop  ebx
   popad
+  popf
   db 0xcb ;; lret
 #endif // BX_PMM
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] rombios: fix argument to PMM, Kouya Shimura <=