entered into RCS
authorBrendan Kehoe <brendan@zen.org>
Thu, 26 Aug 1993 23:30:59 +0000 (23:30 +0000)
committerBrendan Kehoe <brendan@zen.org>
Thu, 26 Aug 1993 23:30:59 +0000 (23:30 +0000)
sysdeps/unix/bsd/ultrix4/mips/__handler.S
sysdeps/unix/bsd/ultrix4/mips/vfork.S [new file with mode: 0644]
sysdeps/unix/bsd/ultrix4/wait3.S [new file with mode: 0644]
sysdeps/unix/bsd/ultrix4/waitpid.S [new file with mode: 0644]
sysdeps/unix/mips/brk.S [new file with mode: 0644]
sysdeps/unix/mips/fork.S [new file with mode: 0644]
sysdeps/unix/mips/pipe.S [new file with mode: 0644]

index 6f26028..3ea697c 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (C) 1992 Free Software Foundation, Inc.
-   Contributed by Brendan Kehoe (brendan@cs.widener.edu).
+   Contributed by Brendan Kehoe (brendan@zen.org).
    Also hacked by Ian Lance Taylor (ian@airs.com).
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -51,8 +51,8 @@ ENTRY (__handler)
        sw t3, 56(a2)
        sw t4, 60(a2)
        sw t5, 64(a2)
-       sw t6, 48(a2)
-       sw t7, 52(a2)
+       sw t6, 68(a2)
+       sw t7, 72(a2)
 
        /* Save the callee saved registers in sc_regs[16..23].  */
        sw s0, 76(a2)
@@ -78,9 +78,13 @@ ENTRY (__handler)
        /* ... and also the return address in sc_regs[31].  */
        sw ra, 136(a2)
 
-       /* Save the floating pointer and the stack pointer in
-          sc_regs[29] and sc_regs[30].  */
+       /* Note: we don't save the stack pointer in sc_regs[29];
+          instead, we use the one that was already there.  */
+#if 0
        sw sp, 128(a2)
+#endif
+
+       /* Save the floating pointer in sc_regs[30].  */
        sw $fp, 132(a2)
 
        /* Save the mul/div stuff in sc_mdlo and sc_mdhi.  */
diff --git a/sysdeps/unix/bsd/ultrix4/mips/vfork.S b/sysdeps/unix/bsd/ultrix4/mips/vfork.S
new file mode 100644 (file)
index 0000000..e194db0
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+#ifndef        SYS_vfork
+#define        SYS_vfork      66
+#endif
+
+SYSCALL__ (vfork, 0)
+       beq v1, zero, parent /* Branch if parent.  */
+       nop
+       move v0, zero
+parent:
+       ret
+       nop
diff --git a/sysdeps/unix/bsd/ultrix4/wait3.S b/sysdeps/unix/bsd/ultrix4/wait3.S
new file mode 100644 (file)
index 0000000..102ca18
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+SYSCALL__ (wait3, 3)
+       ret
diff --git a/sysdeps/unix/bsd/ultrix4/waitpid.S b/sysdeps/unix/bsd/ultrix4/waitpid.S
new file mode 100644 (file)
index 0000000..3bc5ce2
--- /dev/null
@@ -0,0 +1,22 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+SYSCALL__ (waitpid, 3)
+       ret
diff --git a/sysdeps/unix/mips/brk.S b/sysdeps/unix/mips/brk.S
new file mode 100644 (file)
index 0000000..79e4fec
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+#ifndef SYS_brk
+#define SYS_brk 17
+#endif
+
+#ifndef       HAVE_GNU_LD
+#define __end           end
+#endif
+
+.data
+.sdata
+ENTRY(__curbrk)
+       .word __end
+
+.text
+.set noreorder
+.set noat
+
+ENTRY(__brk)
+       /* Minimum is one page.  */
+       lui v0, 4096
+       lw v0, __end
+       nop
+
+       /* If they ask for less than a page, givvem the whole
+          thing anyway.  */
+       sltu AT, a0, v0
+       beq AT, zero, down1
+       nop
+       move a0, v0
+down1:
+       li v0, SYS_brk
+       syscall
+       bne a3, zero, error
+
+       /* Update __curbrk and exit cleanly.  */
+       lui AT, 4096
+       sw a0, __curbrk
+       j ra
+       move v0, zero
+
+       /* What a horrible way to die.  */
+error: j syscall_error
+       nop
+       nop
+       nop
diff --git a/sysdeps/unix/mips/fork.S b/sysdeps/unix/mips/fork.S
new file mode 100644 (file)
index 0000000..53cae3c
--- /dev/null
@@ -0,0 +1,27 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+SYSCALL__ (fork, 0)
+       beq v1, zero, parent /* Branch if parent.  */
+       nop
+       /* We are the child.  Return zero.  */
+       move v0, zero
+parent:
+       ret
diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S
new file mode 100644 (file)
index 0000000..507a753
--- /dev/null
@@ -0,0 +1,29 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+   Contributed by Brendan Kehoe (brendan@zen.org).
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <sysdep.h>
+
+SYSCALL__ (pipe, 1)
+       /* Plop in the two descriptors.  */
+       sw v0, 0(a0)
+       sw v1, 4(a0)
+
+       /* Go out with a clean status.  */
+       j ra
+       move v0, zero
+       nop