Browse Source

+ sparc specific pipe implementation

florian 20 years ago
parent
commit
a6b7be5ca1
2 changed files with 49 additions and 2 deletions
  1. 8 1
      rtl/linux/bunxsysc.inc
  2. 41 1
      rtl/linux/sparc/syscall.inc

+ 8 - 1
rtl/linux/bunxsysc.inc

@@ -337,11 +337,15 @@ begin
  fputime:=do_syscall(syscall_nr_utime,TSysParam(path),TSysParam(times));
  fputime:=do_syscall(syscall_nr_utime,TSysParam(path),TSysParam(times));
 end;
 end;
 
 
+
+{$ifndef FPC_SYSTEM_HAS_FPPIPE}
 Function fppipe(var fildes : tfildes):cint;
 Function fppipe(var fildes : tfildes):cint;
 
 
 begin
 begin
  fppipe:=do_syscall(syscall_nr_pipe,TSysParam(@fildes));
  fppipe:=do_syscall(syscall_nr_pipe,TSysParam(@fildes));
 end;
 end;
+{$endif FPC_SYSTEM_HAS_FPPIPE}
+
 
 
 function fpfcntl(fildes:cint;Cmd:cint;Arg:cint):cint;
 function fpfcntl(fildes:cint;Cmd:cint;Arg:cint):cint;
 
 
@@ -530,7 +534,10 @@ end;
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.2  2005-02-14 17:13:30  peter
+ Revision 1.3  2005-03-03 20:13:44  florian
+   + sparc specific pipe implementation
+
+ Revision 1.2  2005/02/14 17:13:30  peter
    * truncate log
    * truncate log
 
 
  Revision 1.1  2005/02/13 20:01:38  peter
  Revision 1.1  2005/02/13 20:01:38  peter

+ 41 - 1
rtl/linux/sparc/syscall.inc

@@ -58,6 +58,43 @@ asm
 end;
 end;
 
 
 
 
+{$define FPC_SYSTEM_HAS_FPPIPE}
+Function fppipe(var fildes : tfildes):cint;assembler;
+{
+  This function puts the registers in place, does the call, and then
+  copies back the registers as they are after the SysCall.
+}
+asm
+				mov     42,%g1
+        mov     %i0,%o0        
+        ta      0x10
+        bcc     .LSyscOK
+        nop
+        mov     %o0,%l0
+        sethi   %hi(fpc_threadvar_relocate_proc),%o2
+        or      %o2,%lo(fpc_threadvar_relocate_proc),%o2
+        ld      [%o2],%o3
+        subcc   %o3,%g0,%g0
+        bne     .LThread
+        nop
+        sethi   %hi(Errno+4),%o0
+        ba      .LNoThread
+        or      %o0,%lo(Errno+4),%o0
+.LThread:
+        sethi   %hi(Errno),%o0
+        or      %o0,%lo(Errno),%o0
+        call    %o3
+        ld      [%o0],%o0
+.LNoThread:
+        st      %l0,[%o0]
+        mov     -1,%o0
+.LSyscOK:
+        st      [%i0],%o0
+        st      [%i0+4],%o1
+end;
+
+
+
 {*****************************************************************************
 {*****************************************************************************
                      --- Main:The System Call Self ---
                      --- Main:The System Call Self ---
 *****************************************************************************}
 *****************************************************************************}
@@ -317,7 +354,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.17  2005-02-14 17:13:30  peter
+  Revision 1.18  2005-03-03 20:13:44  florian
+    + sparc specific pipe implementation
+
+  Revision 1.17  2005/02/14 17:13:30  peter
     * truncate log
     * truncate log
 
 
 }
 }