Browse Source

* Win32 SEH: handle 'Athlon prefetch bug' and SSE detection exceptions in __FPC_default_handler.

git-svn-id: trunk@27164 -
sergei 11 years ago
parent
commit
17b5359db0
1 changed files with 15 additions and 0 deletions
  1. 15 0
      rtl/win32/seh32.inc

+ 15 - 0
rtl/win32/seh32.inc

@@ -163,6 +163,21 @@ var
 begin
 begin
   if (rec.ExceptionFlags and EXCEPTION_UNWIND)=0 then
   if (rec.ExceptionFlags and EXCEPTION_UNWIND)=0 then
   begin
   begin
+    { Athlon prefetch bug? }
+    if (rec.ExceptionCode=STATUS_ACCESS_VIOLATION) and is_prefetch(pointer(context.eip)) then
+    begin
+      result:=ExceptionContinueExecution;
+      exit;
+    end
+    else if (rec.ExceptionCode=STATUS_ILLEGAL_INSTRUCTION) and sse_check then
+    begin
+      os_supports_sse:=False;
+      { skip the offending movaps %xmm7,%xmm6 instruction }
+      inc(context.eip,3);
+      result:=ExceptionContinueExecution;
+      exit;
+    end;
+
     RtlUnwind(@frame,nil,@rec,nil);
     RtlUnwind(@frame,nil,@rec,nil);
     asm
     asm
       { RtlUnwind destroys nonvolatile registers, this assembler block prevents
       { RtlUnwind destroys nonvolatile registers, this assembler block prevents