Browse Source

Merged revisions 7363,7972 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r7363 | jonas | 2007-05-16 17:13:36 +0200 (Wed, 16 May 2007) | 2 lines

* -dFPC_USE_LIBC fix

........
r7972 | Almindor | 2007-07-07 10:41:42 +0200 (Sat, 07 Jul 2007) | 2 lines

* make FUTEX_OP implemented also with FPC_USE_LIBC since it's a macro

........

git-svn-id: branches/fixes_2_2@8082 -

joost 18 years ago
parent
commit
d06b1cea55
2 changed files with 10 additions and 5 deletions
  1. 6 5
      rtl/linux/linux.pp
  2. 4 0
      rtl/linux/system.pp

+ 6 - 5
rtl/linux/linux.pp

@@ -197,6 +197,12 @@ function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint):
 
 implementation
 
+// FUTEX_OP is a macro, doesn't exist in libC as function
+function FUTEX_OP(op, oparg, cmp, cmparg: cint): cint; {$ifdef SYSTEMINLINE}inline;{$endif}
+begin
+  FUTEX_OP := ((op and $F) shl 28) or ((cmp and $F) shl 24) or ((oparg and $FFF) shl 12) or (cmparg and $FFF);
+end;
+
 {$ifndef FPC_USE_LIBC}
 Uses Syscall;
 
@@ -287,11 +293,6 @@ begin
 {$endif cpum68k}
 end;
 
-function FUTEX_OP(op, oparg, cmp, cmparg: cint): cint;
-begin
-  FUTEX_OP := ((op and $F) shl 28) or ((cmp and $F) shl 24) or ((oparg and $FFF) shl 12) or (cmparg and $FFF);
-end;
-
 function epoll_create(size: cint): cint;
 begin
   epoll_create := do_syscall(syscall_nr_epoll_create,tsysparam(size));

+ 4 - 0
rtl/linux/system.pp

@@ -299,6 +299,10 @@ end;
 var
   initialstkptr : Pointer;external name '__stkptr';
 begin
+{$if defined(i386) and not defined(FPC_USE_LIBC)}
+  InitSyscallIntf;
+{$endif}
+
   SysResetFPU;
 {$if defined(cpupowerpc)}
   // some PPC kernels set the exception bits FE0/FE1 in the MSR to zero,