Browse Source

+ call fpc_cpucodeinit, so sse_support gets initialised for *bsd/darwin
+ support for catching sigill on FreeBSD in case not running on
an SSE2-capable cpu (untested) -- Darwin only runs on SSE2-capable
cpus

git-svn-id: trunk@9419 -

Jonas Maebe 17 years ago
parent
commit
b20652821d
2 changed files with 15 additions and 3 deletions
  1. 3 0
      rtl/bsd/system.pp
  2. 12 3
      rtl/freebsd/i386/sighnd.inc

+ 3 - 0
rtl/bsd/system.pp

@@ -277,6 +277,9 @@ Begin
   StackBottom := Sptr - StackLength;
   { Set up signals handlers }
   InstallSignals;
+{$if defined(cpui386) or defined(cpuarm)}
+  fpc_cpucodeinit;
+{$endif cpui386}
   { Setup heap }
   InitHeap;
   SysInitExceptions;

+ 12 - 3
rtl/freebsd/i386/sighnd.inc

@@ -34,10 +34,19 @@ begin
                 End;
              sysResetFPU;
           End;
-    SIGILL,
-    SIGBUS,
-    SIGSEGV :
+    SIGILL:
+      if sse_check then
+        begin
+          os_supports_sse:=false;
+          res:=0;
+          inc(sigcontext^.sc_eip,3);
+        end
+      else
         res:=216;
+    SIGBUS:
+      res:=214;
+    SIGSEGV :
+      res:=216;
   end;
   {$ifdef FPC_USE_SIGPROCMASK}
    reenable_signal(sig);