Browse Source

* more small fixes.

marco 22 years ago
parent
commit
024df7a7c6
2 changed files with 14 additions and 53 deletions
  1. 7 26
      rtl/linux/i386/sighnd.inc
  2. 7 27
      rtl/linux/osmain.inc

+ 7 - 26
rtl/linux/i386/sighnd.inc

@@ -16,31 +16,10 @@
 
  **********************************************************************}
 
+
 const
-  fpucw : word = $1332;
-  FPU_Invalid = 1;
-  FPU_Denormal = 2;
-  FPU_DivisionByZero = 4;
-  FPU_Overflow = 8;
-  FPU_Underflow = $10;
-  FPU_StackUnderflow = $20;
-  FPU_StackOverflow = $40;
   FPU_All = $7f;
 
-Procedure ResetFPU;
-begin
-{$ifndef CORRECTFLDCW}
-  {$asmmode direct}
-{$endif}
-  asm
-    fninit
-    fldcw   fpucw
-  end;
-{$ifndef CORRECTFLDCW}
-  {$asmmode att}
-{$endif}
-end;
-
 function GetFPUState(const SigContext : SigContextRec) : longint;
 begin
   if assigned(SigContext.fpstate) then
@@ -66,7 +45,6 @@ begin
       how to tell if it is or not PM }
           res:=200;
           fpustate:=GetFPUState(SigContext);
-
           if (FpuState and FPU_All) <> 0 then
             begin
               { first check the more precise options }
@@ -85,7 +63,7 @@ begin
               else
                 res:=207;  {'Coprocessor Error'}
             end;
-      ResetFPU;
+            sysResetFPU;
         end;
     SIGILL,
     SIGBUS,
@@ -94,12 +72,15 @@ begin
   end;
 { give runtime error at the position where the signal was raised }
   if res<>0 then
-    HandleErrorAddrFrame(res,SigContext.eip,SigContext.ebp);
+    HandleErrorAddrFrame(res,pointer(SigContext.eip),pointer(SigContext.ebp));
 end;
 
 {
   $Log$
-  Revision 1.1  2003-11-01 01:27:20  marco
+  Revision 1.2  2003-11-01 01:58:11  marco
+   * more small fixes.
+
+  Revision 1.1  2003/11/01 01:27:20  marco
    * initial version from 1.0.x branch
 
 

+ 7 - 27
rtl/linux/osmain.inc

@@ -496,33 +496,10 @@ end;
                          SystemUnit Initialization
 *****************************************************************************}
 
+// signal handler is arch dependant due to processorexception to language
+// exception translation
 
-procedure SignalToRunerror(Signo: longint; SigContext: SigContextRec);cdecl;
-//procedure SignalToRunerror(signo: cint); cdecl;
-var
-  res : word;
-begin
-    res:=0;
-    if signo = SIGFPE then
-     begin
-        res := 200;
-     end
-    else
-    if (signo = SIGILL) or (signo = SIGBUS) or (signo = SIGSEGV) then
-      begin
-        res := 216;
-      end;
-  { give runtime error at the position where the signal was raised }
-  if res<>0 then
-   begin
-     {$ifdef cpui386}
-       HandleErrorAddrFrame(res,pointer(SigContext.eip),pointer(SigContext.ebp));
-     {$else}
-       HandleErrorAddrFrame(res);
-     {$endif}
-   end;
-end;
-
+{$i sighnd.inc}  
 
 var
   act: SigActionRec;
@@ -621,7 +598,10 @@ End.
 *)
 {
  $Log$
- Revision 1.7  2003-10-31 20:36:01  marco
+ Revision 1.8  2003-11-01 01:58:11  marco
+  * more small fixes.
+
+ Revision 1.7  2003/10/31 20:36:01  marco
   * i386 specific fixes that hopefully fix texception4.
  	Only the "generic" signal handler was ported to the unix rtl.