mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-27 03:35:11 +01:00
* more small fixes.
This commit is contained in:
parent
417d359871
commit
024df7a7c6
@ -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;
|
const
|
||||||
begin
|
FPU_All = $7f;
|
||||||
{$ifndef CORRECTFLDCW}
|
|
||||||
{$asmmode direct}
|
|
||||||
{$endif}
|
|
||||||
asm
|
|
||||||
fninit
|
|
||||||
fldcw fpucw
|
|
||||||
end;
|
|
||||||
{$ifndef CORRECTFLDCW}
|
|
||||||
{$asmmode att}
|
|
||||||
{$endif}
|
|
||||||
end;
|
|
||||||
|
|
||||||
function GetFPUState(const SigContext : SigContextRec) : longint;
|
function GetFPUState(const SigContext : SigContextRec) : longint;
|
||||||
begin
|
begin
|
||||||
@ -66,7 +45,6 @@ begin
|
|||||||
how to tell if it is or not PM }
|
how to tell if it is or not PM }
|
||||||
res:=200;
|
res:=200;
|
||||||
fpustate:=GetFPUState(SigContext);
|
fpustate:=GetFPUState(SigContext);
|
||||||
|
|
||||||
if (FpuState and FPU_All) <> 0 then
|
if (FpuState and FPU_All) <> 0 then
|
||||||
begin
|
begin
|
||||||
{ first check the more precise options }
|
{ first check the more precise options }
|
||||||
@ -85,7 +63,7 @@ begin
|
|||||||
else
|
else
|
||||||
res:=207; {'Coprocessor Error'}
|
res:=207; {'Coprocessor Error'}
|
||||||
end;
|
end;
|
||||||
ResetFPU;
|
sysResetFPU;
|
||||||
end;
|
end;
|
||||||
SIGILL,
|
SIGILL,
|
||||||
SIGBUS,
|
SIGBUS,
|
||||||
@ -94,12 +72,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
{ give runtime error at the position where the signal was raised }
|
{ give runtime error at the position where the signal was raised }
|
||||||
if res<>0 then
|
if res<>0 then
|
||||||
HandleErrorAddrFrame(res,SigContext.eip,SigContext.ebp);
|
HandleErrorAddrFrame(res,pointer(SigContext.eip),pointer(SigContext.ebp));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* initial version from 1.0.x branch
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -496,33 +496,10 @@ end;
|
|||||||
SystemUnit Initialization
|
SystemUnit Initialization
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
|
// signal handler is arch dependant due to processorexception to language
|
||||||
|
// exception translation
|
||||||
|
|
||||||
procedure SignalToRunerror(Signo: longint; SigContext: SigContextRec);cdecl;
|
{$i sighnd.inc}
|
||||||
//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;
|
|
||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
act: SigActionRec;
|
act: SigActionRec;
|
||||||
@ -621,7 +598,10 @@ End.
|
|||||||
*)
|
*)
|
||||||
{
|
{
|
||||||
$Log$
|
$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.
|
* i386 specific fixes that hopefully fix texception4.
|
||||||
Only the "generic" signal handler was ported to the unix rtl.
|
Only the "generic" signal handler was ported to the unix rtl.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user