From 5640182e962a3190dd28eff714cdda9de2d3f877 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 22 Feb 2002 00:10:00 +0000 Subject: Several mips fixes from Geoffrey Espin. With these, busybox with ash/vi/etc now works just fine with uClibc on mips. --- libc/sysdeps/linux/mips/pipe.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libc/sysdeps/linux/mips/pipe.c (limited to 'libc/sysdeps/linux/mips/pipe.c') diff --git a/libc/sysdeps/linux/mips/pipe.c b/libc/sysdeps/linux/mips/pipe.c new file mode 100644 index 000000000..65e335964 --- /dev/null +++ b/libc/sysdeps/linux/mips/pipe.c @@ -0,0 +1,23 @@ +/* pipe system call for Linux/MIPS */ + +/*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */ + +#include +#include +#include + +int pipe(int *fd) +{ + register long int res __asm__ ("$2"); // v0 + register long int res2 __asm__ ("$3"); // v1 + + asm ("move\t$4,%2\n\t" // $4 = a0 + "syscall" /* Perform the system call. */ + : "=r" (res) + : "0" (__NR_pipe), "r" (fd) + : "$4", "$7"); + + fd[0] = res; + fd[1] = res2; + return(0); +} -- cgit v1.2.3