diff options
Diffstat (limited to 'ports/sysdeps/unix/sysv/sysv4/solaris2/sparc')
10 files changed, 420 insertions, 0 deletions
diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile new file mode 100644 index 000000000..1c17ea168 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/Makefile @@ -0,0 +1,11 @@ +# This flag is necessary because GCC now tries to call _Q_{mul, etc...} +# instead of doing the stuff the hard way. For now, printf_fp.o, __vfscanf.o, +# and difftime.o don't work because of this. The long-term fix is to actually +# implement what they're doing, but for the short-term, we must do this. +sysdep-CFLAGS := $(sysdep-CFLAGS) -mhard-quad-float + +ifeq ($(subdir),crypt) + +crypt := crypt.solar + +endif diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h new file mode 100644 index 000000000..7c4bca604 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/bits/sigcontext.h @@ -0,0 +1,34 @@ +/* Structure describing state saved while handling a signal. Sparc version. + Copyright (C) 1992, 1994, 1997 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _SIGNAL_H +# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead." +#endif + +struct sigcontext + { + int sc_onstack; + __sigset_t sc_mask; + +#define SPARC_MAXREGWINDOW 31 /* Maximum usable register windows. */ + int sc_sp, sc_pc, sc_npc, sc_psr, sc_g1, sc_o0; + int sc_wbcnt; /* Number of outstanding windows. */ + __ptr_t sc_spbuf[SPARC_MAXREGWINDOW]; /* SP's for each window. */ + int sc_wbuf[SPARC_MAXREGWINDOW][16]; /* Saved register windows. */ + }; diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c new file mode 100644 index 000000000..3c75e3f01 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c @@ -0,0 +1,185 @@ +/* Copyright (C) 1999 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <stddef.h> +#include <libintl.h> + + +/* This is a list of all known `errno' codes. */ + + +const int _sys_nerr = 152; + +const char *const _sys_errlist[] = +{ + N_("Error 0"), + N_("Not owner"), + N_("No such file or directory"), + N_("No such process"), + N_("Interrupted system call"), + N_("I/O error"), + N_("No such device or address"), + N_("Arg list too long"), + N_("Exec format error"), + N_("Bad file number"), + N_("No child processes"), + N_("Resource temporarily unavailable"), + N_("Not enough space"), + N_("Permission denied"), + N_("Bad address"), + N_("Block device required"), + N_("Device busy"), + N_("File exists"), + N_("Cross-device link"), + N_("No such device"), + N_("Not a directory"), + N_("Is a directory"), + N_("Invalid argument"), + N_("File table overflow"), + N_("Too many open files"), + N_("Inappropriate ioctl for device"), + N_("Text file busy"), + N_("File too large"), + N_("No space left on device"), + N_("Illegal seek"), + N_("Read-only file system"), + N_("Too many links"), + N_("Broken pipe"), + N_("Argument out of domain"), + N_("Result too large"), + N_("No message of desired type"), + N_("Identifier removed"), + N_("Channel number out of range"), + N_("Level 2 not synchronized"), + N_("Level 3 halted"), + N_("Level 3 reset"), + N_("Link number out of range"), + N_("Protocol driver not attached"), + N_("No CSI structure available"), + N_("Level 2 halted"), + N_("Deadlock situation detected/avoided"), + N_("No record locks available"), + N_("Operation canceled"), + N_("Operation not supported"), + N_("Disc quota exceeded"), + N_("Bad exchange descriptor"), + N_("Bad request descriptor"), + N_("Message tables full"), + N_("Anode table overflow"), + N_("Bad request code"), + N_("Invalid slot"), + N_("File locking deadlock"), + N_("Bad font file format"), + N_("Error 58"), + N_("Error 59"), + N_("Not a stream device"), + N_("No data available"), + N_("Timer expired"), + N_("Out of stream resources"), + N_("Machine is not on the network"), + N_("Package not installed"), + N_("Object is remote"), + N_("Link has been severed"), + N_("Advertise error"), + N_("Srmount error"), + N_("Communication error on send"), + N_("Protocol error"), + N_("Error 72"), + N_("Error 73"), + N_("Multihop attempted"), + N_("Error 75"), + N_("Error 76"), + N_("Not a data message"), + N_("File name too long"), + N_("Value too large for defined data type"), + N_("Name not unique on network"), + N_("File descriptor in bad state"), + N_("Remote address changed"), + N_("Can not access a needed shared library"), + N_("Accessing a corrupted shared library"), + N_(".lib section in a.out corrupted"), + N_("Attempting to link in more shared libraries than system limit"), + N_("Can not exec a shared library directly"), + N_("Illegal byte sequence"), + N_("Operation not applicable"), + N_("Number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS"), + N_("Error 91"), + N_("Error 92"), + N_("Directory not empty"), + N_("Too many users"), + N_("Socket operation on non-socket"), + N_("Destination address required"), + N_("Message too long"), + N_("Protocol wrong type for socket"), + N_("Option not supported by protocol"), + N_("Error 100"), + N_("Error 101"), + N_("Error 102"), + N_("Error 103"), + N_("Error 104"), + N_("Error 105"), + N_("Error 106"), + N_("Error 107"), + N_("Error 108"), + N_("Error 109"), + N_("Error 110"), + N_("Error 111"), + N_("Error 112"), + N_("Error 113"), + N_("Error 114"), + N_("Error 115"), + N_("Error 116"), + N_("Error 117"), + N_("Error 118"), + N_("Error 119"), + N_("Protocol not supported"), + N_("Socket type not supported"), + N_("Operation not supported on transport endpoint"), + N_("Protocol family not supported"), + N_("Address family not supported by protocol family"), + N_("Address already in use"), + N_("Cannot assign requested address"), + N_("Network is down"), + N_("Network is unreachable"), + N_("Network dropped connection because of reset"), + N_("Software caused connection abort"), + N_("Connection reset by peer"), + N_("No buffer space available"), + N_("Transport endpoint is already connected"), + N_("Transport endpoint is not connected"), + N_("Structure needs cleaning"), + N_("Error 136"), + N_("Not a name file"), + N_("Not available"), + N_("Is a name file"), + N_("Remote I/O error"), + N_("Reserved for future use"), + N_("Error 142"), + N_("Cannot send after socket shutdown"), + N_("Too many references: cannot splice"), + N_("Connection timed out"), + N_("Connection refused"), + N_("Host is down"), + N_("No route to host"), + N_("Operation already in progress"), + N_("Operation now in progress"), + N_("Stale NFS file handle") +}; + +weak_alias (_sys_errlist, sys_errlist) +weak_alias (_sys_nerr, sys_nerr) diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32/syscall.S b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32/syscall.S new file mode 100644 index 000000000..b9f2996e3 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sparc32/syscall.S @@ -0,0 +1,2 @@ +/* Bets are that the Linux code works... */ +#include <sysdeps/unix/sysv/linux/sparc/sparc32/syscall.S> diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c new file mode 100644 index 000000000..afdfaaa2e --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/start.c @@ -0,0 +1,4 @@ +#define NO_SHLIB +/* Solaris needs start named `_start', not `start'. */ +#define NO_EXPLICIT_START +#include <sysdeps/unix/sparc/start.c> diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/trap.h b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/trap.h new file mode 100644 index 000000000..39d264597 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/trap.h @@ -0,0 +1,36 @@ +/* Copyright (C) 1998 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _SYS_TRAP_H +#define _SYS_TRAP_H 1 + +/* Solaris2 software traps. */ + +#define ST_OSYSCALL 0x00 +#define ST_BREAKPOINT 0x01 +#define ST_DIV0 0x02 +#define ST_FLUSH_WINDOWS 0x03 +#define ST_CLEAN_WINDOWS 0x04 +#define ST_RANGE_CHECK 0x05 +#define ST_FIX_ALIGN 0x06 +#define ST_INT_OVERFLOW 0x07 +#define ST_SYSCALL 0x08 + +/* Traps 0x10 through 0x1f are allotted to the user. */ + +#endif /* sys/trap.h */ diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/ucontext.h b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/ucontext.h new file mode 100644 index 000000000..6e9f69067 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sys/ucontext.h @@ -0,0 +1,42 @@ +/* Copyright (C) 1998 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _SYS_UCONTEXT_H +#define _SYS_UCONTEXT_H 1 + +#include <features.h> +#include <signal.h> +#include <sys/types.h> + +typedef struct +{ + long int mc_filler[78]; +} mcontext_t; + +struct ucontext +{ + unsigned long int uc_flags; + struct ucontext *uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; + long int uc_filler[23]; +}; +typedef struct ucontext ucontext_t; + +#endif /* sys/ucontext.h */ diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/syscalls.list b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/syscalls.list new file mode 100644 index 000000000..d96fbba7e --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/syscalls.list @@ -0,0 +1,3 @@ +# File name Caller Syscall name # args Strong name Weak names + +sys-sig - context 2 __context_syscall diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S new file mode 100644 index 000000000..2ac767c98 --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.S @@ -0,0 +1,47 @@ +/* Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <sysdep.h> +#define _ERRNO_H +#include <bits/errno.h> + +ENTRY(syscall_error) + /* If it was a syscall that got interrupted, but can + be restarted, drop EINTR in. */ + cmp %o0, ERESTART + be,a notint + mov EINTR, %o0 + +notint: +#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN + /* We translate the system's EWOULDBLOCK error into EAGAIN. + The GNU C library always defines EWOULDBLOCK==EAGAIN. + EWOULDBLOCK_sys is the original number. */ + cmp %o0, EWOULDBLOCK_sys + be,a notblock + mov EAGAIN, %o0 +#endif + +notblock:/* Store it in errno... */ + sethi %hi(C_SYMBOL_NAME(errno)), %g1 + st %o0, [%g1 + %lo(C_SYMBOL_NAME(errno))] + + /* And just kick back a -1. */ + retl + mov -1, %o0 diff --git a/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h new file mode 100644 index 000000000..9a0db6afe --- /dev/null +++ b/ports/sysdeps/unix/sysv/sysv4/solaris2/sparc/sysdep.h @@ -0,0 +1,56 @@ +/* Copyright (C) 1993,1994,1995,1997,1998,2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* Solaris 2 does not precede the asm names of C symbols with a `_'. */ +#ifndef NO_UNDERSCORES +#define NO_UNDERSCORES +#endif + +#include <sysdeps/unix/sysdep.h> + +#ifdef __ASSEMBLER__ + +/* As of gcc-2.6.0, it complains about pound signs in front of things + that aren't arguments to the macro. So we use this to pull it off + instead. */ +#define cat(a,b) a##b +#define poundfnc cat(#,function) + +#define ENTRY(name) \ + .section ".text"; \ + .align 4; \ + .global C_SYMBOL_NAME(name); \ + .type C_SYMBOL_NAME(name), poundfnc; \ + C_LABEL(name) + +#define PSEUDO(name, syscall_name, args) \ + ENTRY (name) \ + mov SYS_ify(syscall_name), %g1; \ + ta 8; \ + bcs C_SYMBOL_NAME(syscall_error); \ + nop + +#define ret retl; nop +#define r0 %o0 +#define r1 %o1 +#define MOVE(x,y) mov x, y + +#define LOC(name) .L##name + +#endif /* __ASSEMBLER__ */ |