mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:26:24 +02:00
* explicitly enable FPU exception reporting on PowerPC in the MSR because some distros disable them by default
git-svn-id: trunk@6033 -
This commit is contained in:
parent
67e6d8d2da
commit
f6d79e8abb
@ -579,3 +579,26 @@ begin
|
|||||||
TSysParam(resource), TSysParam(rlim));
|
TSysParam(resource), TSysParam(rlim));
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{$if defined(cpupowerpc)}
|
||||||
|
const
|
||||||
|
{ FP exception related constants for prctl(); PowerPC specific }
|
||||||
|
PR_GET_FPEXC = 11; { get floating point exception mode }
|
||||||
|
PR_SET_FPEXC = 12; { set floating point exception mode }
|
||||||
|
|
||||||
|
PR_FP_EXC_DISABLED = 0; { FP exceptions disabled }
|
||||||
|
PR_FP_EXC_NONREC = 1; { async non-recoverable exc. mode }
|
||||||
|
PR_FP_EXC_ASYNC = 2; { async recoverable exc. mode }
|
||||||
|
PR_FP_EXC_PRECISE = 3; { precise exception mode }
|
||||||
|
|
||||||
|
{ prctl() call to get FP exception mode }
|
||||||
|
function prctl_get_fpexc(var mode : cint): cint;
|
||||||
|
begin
|
||||||
|
prctl_get_fpexc := do_syscall(syscall_nr_prctl, PR_GET_FPEXC, ptrint(@mode));
|
||||||
|
end;
|
||||||
|
{ prctl() call to set FP exception mode }
|
||||||
|
function prctl_set_fpexc(const mode : cint): cint;
|
||||||
|
begin
|
||||||
|
prctl_set_fpexc := do_syscall(syscall_nr_prctl, PR_SET_FPEXC, mode);
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
|
@ -301,6 +301,11 @@ var
|
|||||||
initialstkptr : Pointer;external name '__stkptr';
|
initialstkptr : Pointer;external name '__stkptr';
|
||||||
begin
|
begin
|
||||||
SysResetFPU;
|
SysResetFPU;
|
||||||
|
{$if defined(cpupowerpc)}
|
||||||
|
// some PPC kernels set the exception bits FE0/FE1 in the MSR to zero,
|
||||||
|
// disabling all FPU exceptions. Enable them again.
|
||||||
|
prctl_set_fpexc(PR_FP_EXC_PRECISE);
|
||||||
|
{$endif}
|
||||||
IsConsole := TRUE;
|
IsConsole := TRUE;
|
||||||
StackLength := CheckInitialStkLen(initialStkLen);
|
StackLength := CheckInitialStkLen(initialStkLen);
|
||||||
StackBottom := initialstkptr - StackLength;
|
StackBottom := initialstkptr - StackLength;
|
||||||
|
Loading…
Reference in New Issue
Block a user