[Wine-patches] [eterhack 01/24] kernel32: Emulate some instructions working with cr4.
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Ср Мар 4 12:25:10 MSK 2009
---
dlls/kernel32/instr.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 68 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/instr.c b/dlls/kernel32/instr.c
index 5259056..a361497 100644
--- a/dlls/kernel32/instr.c
+++ b/dlls/kernel32/instr.c
@@ -528,19 +528,54 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
case 0x0f: /* extended instruction */
switch(instr[1])
{
- case 0x22: /* mov eax, crX */
+ case 0x22: /* mov eXX, crX */
switch (instr[2])
{
- case 0xc0:
+ case 0xc0: /* mov eax, cr0 */
ERR("mov eax,cr0 at 0x%08x, EAX=0x%08x\n",
context->Eip,context->Eax );
context->Eip += prefixlen+3;
return ExceptionContinueExecution;
+ case 0xe0: /* mov eax, cr4 */
+ ERR("mov eax,cr4 at 0x%08x, EAX=0x%08x\n",
+ context->Eip,context->Eax);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe1: /* mov ecx, cr4 */
+ ERR("mov ecx,cr4 at 0x%08x, ECX=0x%08x\n",
+ context->Eip,context->Ecx);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe2: /* mov edx, cr4 */
+ ERR("mov edx,cr4 at 0x%08x, EDX=0x%08x\n",
+ context->Eip,context->Edx);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe3: /* mov ebx, cr4 */
+ ERR("mov ebx,cr4 at 0x%08x, EBX=0x%08x\n",
+ context->Eip,context->Ebx);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe5: /* mov ebp, cr4 */
+ ERR("mov ebp,cr4 at 0x%08x, EBP=0x%08x\n",
+ context->Eip,context->Ebp);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe6: /* mov esi, cr4 */
+ ERR("mov esi,cr4 at 0x%08x, ESI=0x%08x\n",
+ context->Eip,context->Esi);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe7: /* mov edi, cr4 */
+ ERR("mov edi,cr4 at 0x%08x, EDI=0x%08x\n",
+ context->Eip,context->Edi);
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
default:
break; /*fallthrough to bad instruction handling */
}
break; /*fallthrough to bad instruction handling */
- case 0x20: /* mov crX, eax */
+ case 0x20: /* mov crX, eXX */
switch (instr[2])
{
case 0xe0: /* mov cr4, eax */
@@ -559,6 +594,36 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
context->Eax = 0;
context->Eip += prefixlen+3;
return ExceptionContinueExecution;
+ case 0xe1: /* mov cr4, ecx */
+ ERR("mov cr4,ecx at 0x%08x\n",context->Eip);
+ context->Ecx = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe2: /* mov cr4, edx */
+ ERR("mov cr4,edx at 0x%08x\n",context->Eip);
+ context->Edx = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe3: /* mov cr4, ebx */
+ ERR("mov cr4,ebx at 0x%08x\n",context->Eip);
+ context->Ebx = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe5: /* mov cr4, ebp */
+ ERR("mov cr4,ebp at 0x%08x\n",context->Eip);
+ context->Ebp = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe6: /* mov cr4, esi */
+ ERR("mov cr4,esi at 0x%08x\n",context->Eip);
+ context->Esi = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
+ case 0xe7: /* mov cr4, edi */
+ ERR("mov cr4,edi at 0x%08x\n",context->Eip);
+ context->Edi = 0;
+ context->Eip += prefixlen+3;
+ return ExceptionContinueExecution;
case 0xc0: /* mov cr0, eax */
ERR("mov cr0,eax at 0x%08x\n",context->Eip);
context->Eax = 0x10; /* FIXME: set more bits ? */
--
1.6.1.3.GIT
Подробная информация о списке рассылки Wine-patches