diff options
| author | Roland McGrath <roland@gnu.org> | 1995-02-18 01:27:10 +0000 |
|---|---|---|
| committer | Roland McGrath <roland@gnu.org> | 1995-02-18 01:27:10 +0000 |
| commit | 28f540f45bbacd939bfd07f213bcad2bf730b1bf (patch) | |
| tree | 15f07c4c43d635959c6afee96bde71fb1b3614ee /sysdeps/vax | |
| download | glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.tar.xz glibc-28f540f45bbacd939bfd07f213bcad2bf730b1bf.zip | |
initial import
Diffstat (limited to 'sysdeps/vax')
40 files changed, 2435 insertions, 0 deletions
diff --git a/sysdeps/vax/DEFS.h b/sysdeps/vax/DEFS.h new file mode 100644 index 0000000000..01f1f0cdd0 --- /dev/null +++ b/sysdeps/vax/DEFS.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 1982, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)DEFS.h 8.1 (Berkeley) 6/4/93 + */ + +#define R0 0x001 +#define R1 0x002 +#define R2 0x004 +#define R3 0x008 +#define R4 0x010 +#define R5 0x020 +#define R6 0x040 +#define R7 0x080 +#define R8 0x100 +#define R9 0x200 +#define R10 0x400 +#define R11 0x800 + +#ifdef PROF +#define ENTRY(x, regs) \ + .globl _/**/x; .align 2; _/**/x: .word regs; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#define ASENTRY(x, regs) \ + .globl x; .align 2; x: .word regs; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#else +#define ENTRY(x, regs) \ + .globl _/**/x; .align 2; _/**/x: .word regs +#define ASENTRY(x, regs) \ + .globl x; .align 2; x: .word regs +#endif diff --git a/sysdeps/vax/Dist b/sysdeps/vax/Dist new file mode 100644 index 0000000000..9830be29a4 --- /dev/null +++ b/sysdeps/vax/Dist @@ -0,0 +1 @@ +DEFS.h diff --git a/sysdeps/vax/Makefile b/sysdeps/vax/Makefile new file mode 100644 index 0000000000..a6149a9524 --- /dev/null +++ b/sysdeps/vax/Makefile @@ -0,0 +1,32 @@ +# Copyright (C) 1991, 1994 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# 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. + +ifeq ($(subdir),math) +ifndef math-twiddled + +elided-routines := $(elided-routines) acos asin cos sin ceil rint hypot \ + __copysign __scalb __drem __logb __finite +sysdep_routines := $(sysdep_routines) asincos sincos argred \ + support exp__E log__L + +math-twiddled := t +endif + +bsdmath_dirs := $(bsdmath_dirs) vax + +endif diff --git a/sysdeps/vax/__longjmp.c b/sysdeps/vax/__longjmp.c new file mode 100644 index 0000000000..0ee040ab25 --- /dev/null +++ b/sysdeps/vax/__longjmp.c @@ -0,0 +1,100 @@ +/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. + Derived from @(#)_setjmp.s 5.7 (Berkeley) 6/27/88, + Copyright (c) 1980 Regents of the University of California. + +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 <ansidecl.h> +#include <setjmp.h> + +#ifndef __GNUC__ + #error This file uses GNU C extensions; you must compile with GCC. +#endif + + +#define REI 02 /* Vax `rei' opcode. */ + +/* Jump to the position specified by ENV, causing the + setjmp call there to return VAL, or 1 if VAL is 0. */ +__NORETURN +void +DEFUN(__longjmp, (env, val), CONST __jmp_buf env AND int val) +{ + register long int *fp asm("fp"); + long int *regsave; + unsigned long int flags; + + if (env.__fp == NULL) + __libc_fatal("longjmp: Invalid ENV argument.\n"); + + if (val == 0) + val = 1; + + asm volatile("loop:"); + + flags = *(long int *) (6 + (char *) fp); + regsave = (long int *) (20 + (char *) fp); + if (flags & 1) + /* R0 was saved by the caller. + Store VAL where it will be restored from. */ + *regsave++ = val; + if (flags & 2) + /* R1 was saved by the caller. + Store ENV where it will be restored from. */ + *regsave = env; + + /* Was the FP saved in the last call the same one in ENV? */ + asm volatile("cmpl %0, 12(fp);" + /* Yes, return to it. */ + "beql done;" + /* The FP in ENV is less than the one saved in the last call. + This means we have already returned from the function that + called `setjmp' with ENV! */ + "blssu latejump;" : /* No outputs. */ : "g" (env.__fp)); + + /* We are more than one level below the state in ENV. + Return to where we will pop another stack frame. */ + asm volatile("movl $loop, 16(fp);" + "ret"); + + asm volatile("done:"); + { + char return_insn asm("*16(fp)"); + if (return_insn == REI) + /* We're returning with an `rei' instruction. + Do a return with PSL-PC pop. */ + asm volatile("movab 0f, 16(fp)"); + else + /* Do a standard return. */ + asm volatile("movab 1f, 16(fp)"); + + /* Return. */ + asm volatile("ret"); + } + + asm volatile("0:" /* `rei' return. */ + /* Compensate for PSL-PC push. */ + "addl2 %0, sp;" + "1:" /* Standard return. */ + /* Return to saved PC. */ + "jmp %1" : /* No outputs. */ : + "g" (8), "g" (env.__pc)); + + /* Jump here when the FP saved in ENV points + to a function that has already returned. */ + asm volatile("latejump:"); + __libc_fatal("longjmp: Attempt to jump to a function that has returned.\n"); +} diff --git a/sysdeps/vax/bcmp.s b/sysdeps/vax/bcmp.s new file mode 100644 index 0000000000..d980feb8e4 --- /dev/null +++ b/sysdeps/vax/bcmp.s @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)bcmp.s 5.6 (Berkeley) 6/1/90" +#endif /* LIBC_SCCS and not lint */ + +/* bcmp(s1, s2, n) */ + +#include "DEFS.h" + +ENTRY(bcmp, 0) + movl 4(ap),r1 + movl 8(ap),r3 + movl 12(ap),r4 +1: + movzwl $65535,r0 + cmpl r4,r0 + jleq 2f + subl2 r0,r4 + cmpc3 r0,(r1),(r3) + jeql 1b + addl2 r4,r0 + ret +2: + cmpc3 r4,(r1),(r3) + ret diff --git a/sysdeps/vax/bcopy.s b/sysdeps/vax/bcopy.s new file mode 100644 index 0000000000..43bb93d216 --- /dev/null +++ b/sysdeps/vax/bcopy.s @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)bcopy.s 5.6 (Berkeley) 6/1/90" +#endif /* LIBC_SCCS and not lint */ + +/* bcopy(from, to, size) */ + +#include "DEFS.h" + +ENTRY(bcopy, R6) + movl 4(ap),r1 + movl 8(ap),r3 + movl 12(ap),r6 + cmpl r1,r3 + bgtr 2f # normal forward case + blss 3f # overlapping, must do backwards + ret # equal, nothing to do +1: + subl2 r0,r6 + movc3 r0,(r1),(r3) +2: + movzwl $65535,r0 + cmpl r6,r0 + jgtr 1b + movc3 r6,(r1),(r3) + ret +3: + addl2 r6,r1 + addl2 r6,r3 + movzwl $65535,r0 + jbr 5f +4: + subl2 r0,r6 + subl2 r0,r1 + subl2 r0,r3 + movc3 r0,(r1),(r3) + movzwl $65535,r0 + subl2 r0,r1 + subl2 r0,r3 +5: + cmpl r6,r0 + jgtr 4b + subl2 r6,r1 + subl2 r6,r3 + movc3 r6,(r1),(r3) + ret diff --git a/sysdeps/vax/bsd-_setjmp.S b/sysdeps/vax/bsd-_setjmp.S new file mode 100644 index 0000000000..039fd71fdb --- /dev/null +++ b/sysdeps/vax/bsd-_setjmp.S @@ -0,0 +1,32 @@ +/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. Vax version. +Copyright (C) 1994 Free Software Foundation, Inc. +This file is part of the GNU C Library. + +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. */ + +/* This just does a tail-call to `__sigsetjmp (ARG, 0)'. + We cannot do it in C because it must be a tail-call, so frame-unwinding + in setjmp doesn't clobber the state restored by longjmp. */ + +#include <sysdep.h> + +ENTRY (setjmp) + popl r0 /* Pop return PC. */ + popl r1 /* Pop jmp_buf argument. */ + pushl $0 /* Push second argument of zero. */ + pushl r1 /* Push back first argument. */ + pushl r0 /* Push back return PC. */ + jmp C_SYMBOL_NAME (__sigsetjmp) diff --git a/sysdeps/vax/bsd-setjmp.S b/sysdeps/vax/bsd-setjmp.S new file mode 100644 index 0000000000..379a65c0e5 --- /d |
