فهرست منبع

* MIPS fppipe(): added error handling, and fixed parameter location (assembler procedures should not modify initial location of parameters, but one of MIPS code generator hacks copies parameters to stack. That hack is subject to remove).

git-svn-id: trunk@23610 -
sergei 12 سال پیش
والد
کامیت
58f8a00814
1فایلهای تغییر یافته به همراه17 افزوده شده و 4 حذف شده
  1. 17 4
      rtl/linux/mips/bsyscall.inc

+ 17 - 4
rtl/linux/mips/bsyscall.inc

@@ -24,12 +24,25 @@ Function fppipe(var fildes : tfildes):cint;assembler;
   * argument.  Historically that used to be expensive in Linux.  These days
   * the performance advantage is negligible.
 }
+var
+  tmp: pointer;
 asm
-  li $v0,syscall_nr_pipe
+  sw   $a0,tmp             { if $a0 is preserved in syscall then this is not needed }
+  li   $v0,syscall_nr_pipe
   syscall
+  nop
+  beq  $a3,$0,.L1
+  nop
+  move $a0,$v0
+  jal  fpseterrno
+  nop
+  b    .L2
+  li   $v0,-1              { in delay slot }
+.L1:
   { the two files descriptors are now in v0 and v1 registers 
     copying them back into fildes variable }
-  lw $t1,fildes
-  sw $v0,($t1)
-  sw $v1,4($t1)
+  lw   $t1,tmp
+  sw   $v0,($t1)
+  sw   $v1,4($t1)
+.L2:
 end;