From 024df7a7c69b0aefc901936b5231bb94efec7d87 Mon Sep 17 00:00:00 2001 From: marco Date: Sat, 1 Nov 2003 01:58:11 +0000 Subject: [PATCH] * more small fixes. --- rtl/linux/i386/sighnd.inc | 35 ++++++++--------------------------- rtl/linux/osmain.inc | 34 +++++++--------------------------- 2 files changed, 15 insertions(+), 54 deletions(-) diff --git a/rtl/linux/i386/sighnd.inc b/rtl/linux/i386/sighnd.inc index 985c98299c..868f59ca31 100644 --- a/rtl/linux/i386/sighnd.inc +++ b/rtl/linux/i386/sighnd.inc @@ -16,30 +16,9 @@ **********************************************************************} -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; +const + FPU_All = $7f; function GetFPUState(const SigContext : SigContextRec) : longint; begin @@ -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 diff --git a/rtl/linux/osmain.inc b/rtl/linux/osmain.inc index 9631564c9e..4828894d93 100644 --- a/rtl/linux/osmain.inc +++ b/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.