mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-30 01:39:28 +02:00
* fixed rtl compilation with -dFPC_USE_LIBC by providing a more generic fpprctl() call (including libc variant) and moving related constants slightly
git-svn-id: trunk@6134 -
This commit is contained in:
parent
216150e2e1
commit
704f8dae14
@ -581,24 +581,9 @@ end;
|
|||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$if defined(cpupowerpc)}
|
{$if defined(cpupowerpc)}
|
||||||
const
|
{ fpprctl() call }
|
||||||
{ FP exception related constants for prctl(); PowerPC specific }
|
function fpprctl(option : cint; const arg : ptrint) : cint;
|
||||||
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
|
begin
|
||||||
prctl_get_fpexc := do_syscall(syscall_nr_prctl, PR_GET_FPEXC, ptrint(@mode));
|
fpprctl := do_syscall(syscall_nr_prctl, option, arg);
|
||||||
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;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
@ -280,6 +280,18 @@ type
|
|||||||
tiovec=iovec;
|
tiovec=iovec;
|
||||||
piovec=^tiovec;
|
piovec=^tiovec;
|
||||||
|
|
||||||
|
{$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 }
|
||||||
|
{$endif}
|
||||||
|
|
||||||
{*************************************************************************}
|
{*************************************************************************}
|
||||||
{ SIGNALS }
|
{ SIGNALS }
|
||||||
{*************************************************************************}
|
{*************************************************************************}
|
||||||
|
@ -304,7 +304,7 @@ begin
|
|||||||
{$if defined(cpupowerpc)}
|
{$if defined(cpupowerpc)}
|
||||||
// some PPC kernels set the exception bits FE0/FE1 in the MSR to zero,
|
// some PPC kernels set the exception bits FE0/FE1 in the MSR to zero,
|
||||||
// disabling all FPU exceptions. Enable them again.
|
// disabling all FPU exceptions. Enable them again.
|
||||||
prctl_set_fpexc(PR_FP_EXC_PRECISE);
|
fpprctl(PR_SET_FPEXC, PR_FP_EXC_PRECISE);
|
||||||
{$endif}
|
{$endif}
|
||||||
IsConsole := TRUE;
|
IsConsole := TRUE;
|
||||||
StackLength := CheckInitialStkLen(initialStkLen);
|
StackLength := CheckInitialStkLen(initialStkLen);
|
||||||
|
@ -117,3 +117,7 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
|
|||||||
function FpReadV (fd: cint; const iov : piovec; iovcnt : cint):TSSize; cdecl; external clib name 'readv';
|
function FpReadV (fd: cint; const iov : piovec; iovcnt : cint):TSSize; cdecl; external clib name 'readv';
|
||||||
Function FpPWrite (fd : cInt; buf:pChar; nbytes : TSize; offset:Toff): TSSize; cdecl; external clib name 'pwrite';
|
Function FpPWrite (fd : cInt; buf:pChar; nbytes : TSize; offset:Toff): TSSize; cdecl; external clib name 'pwrite';
|
||||||
function FpWriteV (fd: cint; const iov : piovec; iovcnt : cint):TSSize; cdecl; external clib name 'writev';
|
function FpWriteV (fd: cint; const iov : piovec; iovcnt : cint):TSSize; cdecl; external clib name 'writev';
|
||||||
|
|
||||||
|
{$ifdef linux}
|
||||||
|
function FpPrCtl(options : cInt; const args : ptrint) : cint; cdecl; external clib name 'prctl';
|
||||||
|
{$endif}
|
||||||
|
Loading…
Reference in New Issue
Block a user