entered into RCS

This commit is contained in:
Brendan Kehoe 1993-08-26 23:30:59 +00:00
parent a13ebb05b8
commit ebb0156a44
7 changed files with 205 additions and 5 deletions

View 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. */

View File

@ -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

View File

@ -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

View File

@ -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

65
sysdeps/unix/mips/brk.S Normal file
View File

@ -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

27
sysdeps/unix/mips/fork.S Normal file
View File

@ -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

29
sysdeps/unix/mips/pipe.S Normal file
View File

@ -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