am 7f798147: am cc8668f2: Merge "[MIPS] Check error status from pipe system call"
* commit '7f798147980798718ac893229ae20dba9e3a26c7': [MIPS] Check error status from pipe system call
This commit is contained in:
commit
cc0f225365
@ -26,6 +26,12 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The MIPS pipe syscall returns results in two registers, which
|
||||||
|
* we have to copy into the supplied array. This prevents us from
|
||||||
|
* using an auto-generated stub.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
@ -38,12 +44,17 @@
|
|||||||
.ent pipe
|
.ent pipe
|
||||||
pipe:
|
pipe:
|
||||||
.set noreorder
|
.set noreorder
|
||||||
|
.cpload $t9
|
||||||
li $v0,__NR_pipe
|
li $v0,__NR_pipe
|
||||||
syscall /* syscall returns results in v0,v1 */
|
syscall /* syscall returns results in v0,v1 */
|
||||||
|
bnez $a3, 1f /* check errno */
|
||||||
sw $v0,0($a0)
|
nop
|
||||||
sw $v1,4($a0)
|
sw $v0, 0($a0)
|
||||||
|
sw $v1, 4($a0)
|
||||||
j $ra
|
j $ra
|
||||||
move $v0,$zero
|
move $v0, $zero
|
||||||
|
1:
|
||||||
|
la $t9, __set_errno
|
||||||
|
j $t9
|
||||||
|
move $a0, $v0 /* delay slot, prepare args for __set_errno */
|
||||||
.end pipe
|
.end pipe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user