From e0ea35832e9039a89809102688e57a1040587b87 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 25 Apr 2001 20:50:21 +0000 Subject: Update. 2001-04-25 Jakub Jelinek * sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h: Move to... * sysdeps/unix/sysv/linux/sparc/bits/time.h: ...here. * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/bits/time.h: Remove. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/socket.h: Move to... * sysdeps/unix/sysv/linux/sparc/bits/socket.h: ...here. Adjust struct msghdr for __WORDSIZE == 32. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statvfs.h: Move to... * sysdeps/unix/sysv/linux/sparc/bits/statvfs.h: ...here. Adjust for __WORDSIZE == 32. * sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h: Remove. * sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/get_clockfreq.c: New file. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S (__libc_siglongjmp): Rename from longjmp, make longjmp weak alias to it. 2001-04-24 David S. Miller * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c: New file. --- sysdeps/unix/sysv/linux/sparc/bits/socket.h | 314 +++++++++++++++++++++ sysdeps/unix/sysv/linux/sparc/bits/statvfs.h | 106 +++++++ sysdeps/unix/sysv/linux/sparc/bits/time.h | 73 +++++ .../sysv/linux/sparc/sparc32/sparcv9/bits/time.h | 73 ----- .../linux/sparc/sparc32/sparcv9/get_clockfreq.c | 1 + .../unix/sysv/linux/sparc/sparc64/bits/siginfo.h | 306 -------------------- .../unix/sysv/linux/sparc/sparc64/bits/socket.h | 308 -------------------- .../unix/sysv/linux/sparc/sparc64/bits/statvfs.h | 96 ------- sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h | 73 ----- .../unix/sysv/linux/sparc/sparc64/get_clockfreq.c | 240 ++++++++++++++++ sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S | 16 +- 11 files changed, 742 insertions(+), 864 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/socket.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/statvfs.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/time.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/bits/time.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/get_clockfreq.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/bits/socket.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/bits/statvfs.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c (limited to 'sysdeps/unix/sysv') diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/bits/socket.h new file mode 100644 index 0000000000..5d683dcfe6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h @@ -0,0 +1,314 @@ +/* System-specific socket constants and types. Linux/SPARC version. + Copyright (C) 1991,1992,1994-1999,2000,2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef __BITS_SOCKET_H +#define __BITS_SOCKET_H + +#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H +# error "Never include directly; use instead." +#endif + +#define __need_size_t +#define __need_NULL +#include + +#include +#include + +/* Type for length arguments in socket calls. */ +#ifndef __socklen_t_defined +typedef __socklen_t socklen_t; +# define __socklen_t_defined +#endif + +/* Types of sockets. */ +enum __socket_type +{ + SOCK_STREAM = 1, /* Sequenced, reliable, connection-based + byte streams. */ +#define SOCK_STREAM SOCK_STREAM + SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams + of fixed maximum length. */ +#define SOCK_DGRAM SOCK_DGRAM + SOCK_RAW = 3, /* Raw protocol interface. */ +#define SOCK_RAW SOCK_RAW + SOCK_RDM = 4, /* Reliably-delivered messages. */ +#define SOCK_RDM SOCK_RDM + SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, + datagrams of fixed maximum length. */ +#define SOCK_SEQPACKET SOCK_SEQPACKET + SOCK_PACKET = 10 /* Linux specific way of getting packets + at the dev level. For writing rarp and + other similar things on the user level. */ +#define SOCK_PACKET SOCK_PACKET +}; + +/* Protocol families. */ +#define PF_UNSPEC 0 /* Unspecified. */ +#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ +#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ +#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ +#define PF_INET 2 /* IP protocol family. */ +#define PF_AX25 3 /* Amateur Radio AX.25. */ +#define PF_IPX 4 /* Novell Internet Protocol. */ +#define PF_APPLETALK 5 /* Appletalk DDP. */ +#define PF_NETROM 6 /* Amateur radio NetROM. */ +#define PF_BRIDGE 7 /* Multiprotocol bridge. */ +#define PF_ATMPVC 8 /* ATM PVCs. */ +#define PF_X25 9 /* Reserved for X.25 project. */ +#define PF_INET6 10 /* IP version 6. */ +#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ +#define PF_DECnet 12 /* Reserved for DECnet project. */ +#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ +#define PF_SECURITY 14 /* Security callback pseudo AF. */ +#define PF_KEY 15 /* PF_KEY key management API. */ +#define PF_NETLINK 16 +#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ +#define PF_PACKET 17 /* Packet family. */ +#define PF_ASH 18 /* Ash. */ +#define PF_ECONET 19 /* Acorn Econet. */ +#define PF_ATMSVC 20 /* ATM SVCs. */ +#define PF_SNA 22 /* Linux SNA Project */ +#define PF_IRDA 23 /* IRDA sockets. */ +#define PF_PPPOX 24 /* PPPoX sockets. */ +#define PF_MAX 32 /* For now.. */ + +/* Address families. */ +#define AF_UNSPEC PF_UNSPEC +#define AF_LOCAL PF_LOCAL +#define AF_UNIX PF_UNIX +#define AF_FILE PF_FILE +#define AF_INET PF_INET +#define AF_AX25 PF_AX25 +#define AF_IPX PF_IPX +#define AF_APPLETALK PF_APPLETALK +#define AF_NETROM PF_NETROM +#define AF_BRIDGE PF_BRIDGE +#define AF_ATMPVC PF_ATMPVC +#define AF_X25 PF_X25 +#define AF_INET6 PF_INET6 +#define AF_ROSE PF_ROSE +#define AF_DECnet PF_DECnet +#define AF_NETBEUI PF_NETBEUI +#define AF_SECURITY PF_SECURITY +#define AF_KEY PF_KEY +#define AF_NETLINK PF_NETLINK +#define AF_ROUTE PF_ROUTE +#define AF_PACKET PF_PACKET +#define AF_ASH PF_ASH +#define AF_ECONET PF_ECONET +#define AF_ATMSVC PF_ATMSVC +#define AF_SNA PF_SNA +#define AF_IRDA PF_IRDA +#define AF_PPPOX PF_PPPOX +#define AF_MAX PF_MAX + +/* Socket level values. Others are defined in the appropriate headers. + + XXX These definitions also should go into the appropriate headers as + far as they are available. */ +#define SOL_RAW 255 +#define SOL_DECNET 261 +#define SOL_X25 262 +#define SOL_PACKET 263 +#define SOL_ATM 264 /* ATM layer (cell level). */ +#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ +#define SOL_IRDA 266 + +/* Maximum queue length specifiable by listen. */ +#define SOMAXCONN 128 + +/* Get the definition of the macro to define the common sockaddr members. */ +#include + +/* Structure describing a generic socket address. */ +struct sockaddr + { + __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ + char sa_data[14]; /* Address data. */ + }; + + +/* Structure large enough to hold any socket address (with the historical + exception of AF_UNIX). We reserve 128 bytes. */ +#if ULONG_MAX > 0xffffffff +# define __ss_aligntype __uint64_t +#else +# define __ss_aligntype __uint32_t +#endif +#define _SS_SIZE 128 +#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) + +struct sockaddr_storage + { + __SOCKADDR_COMMON (ss_); /* Address family, etc. */ + __ss_aligntype __ss_align; /* Force desired alignment. */ + char __ss_padding[_SS_PADSIZE]; + }; + + +/* Bits in the FLAGS argument to `send', `recv', et al. */ +enum + { + MSG_OOB = 0x01, /* Process out-of-band data. */ +#define MSG_OOB MSG_OOB + MSG_PEEK = 0x02, /* Peek at incoming messages. */ +#define MSG_PEEK MSG_PEEK + MSG_DONTROUTE = 0x04, /* Don't use local routing. */ +#define MSG_DONTROUTE MSG_DONTROUTE +#ifdef __USE_GNU + /* DECnet uses a different name. */ + MSG_TRYHARD = MSG_DONTROUTE, +# define MSG_TRYHARD MSG_DONTROUTE +#endif + MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ +#define MSG_CTRUNC MSG_CTRUNC + MSG_PROXY = 0x10, /* Supply or ask second address. */ +#define MSG_PROXY MSG_PROXY + MSG_TRUNC = 0x20, +#define MSG_TRUNC MSG_TRUNC + MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ +#define MSG_DONTWAIT MSG_DONTWAIT + MSG_EOR = 0x80, /* End of record. */ +#define MSG_EOR MSG_EOR + MSG_WAITALL = 0x100, /* Wait for a full request. */ +#define MSG_WAITALL MSG_WAITALL + MSG_FIN = 0x200, +#define MSG_FIN MSG_FIN + MSG_SYN = 0x400, +#define MSG_SYN MSG_SYN + MSG_CONFIRM = 0x800, /* Confirm path validity. */ +#define MSG_CONFIRM MSG_CONFIRM + MSG_RST = 0x1000, +#define MSG_RST MSG_RST + MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ +#define MSG_ERRQUEUE MSG_ERRQUEUE + MSG_NOSIGNAL = 0x4000 /* Do not generate SIGPIPE. */ +#define MSG_NOSIGNAL MSG_NOSIGNAL + }; + + +/* Structure describing messages sent by + `sendmsg' and received by `recvmsg'. */ +struct msghdr + { + void *msg_name; /* Address to send to/receive from. */ + socklen_t msg_namelen; /* Length of address data. */ + + struct iovec *msg_iov; /* Vector of data to send/receive into. */ +#if __WORDSIZE == 32 + int msg_iovlen; /* Number of elements in the vector. */ + + void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ + socklen_t msg_controllen; /* Ancillary data buffer length. */ +#else + size_t msg_iovlen; /* Number of elements in the vector. */ + + void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ + size_t msg_controllen; /* Ancillary data buffer length. */ +#endif + int msg_flags; /* Flags on received message. */ + }; + +/* Structure used for storage of ancillary data object information. */ +struct cmsghdr + { + size_t cmsg_len; /* Length of data in cmsg_data plus length + of cmsghdr structure. */ + int cmsg_level; /* Originating protocol. */ + int cmsg_type; /* Protocol specific type. */ + __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ + /* XXX Perhaps this should be removed. */ + }; + +/* Ancillary data object manipulation macros. */ +#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 +# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) +#else +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) +#endif +#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) +#define CMSG_FIRSTHDR(mhdr) \ + ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ + ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) +#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ + & (size_t) ~(sizeof (size_t) - 1)) +#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ + + CMSG_ALIGN (sizeof (struct cmsghdr))) +#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) + +extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, + struct cmsghdr *__cmsg) __THROW; +#ifdef __USE_EXTERN_INLINES +# ifndef _EXTERN_INLINE +# define _EXTERN_INLINE extern __inline +# endif +_EXTERN_INLINE struct cmsghdr * +__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW +{ + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) + /* The kernel header does this so there may be a reason. */ + return 0; + + __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + + CMSG_ALIGN (__cmsg->cmsg_len)); + if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control + + __mhdr->msg_controllen) + || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + /* No more entries. */ + return 0; + return __cmsg; +} +#endif /* Use `extern inline'. */ + +/* Socket level message types. This must match the definitions in + . */ +enum + { + SCM_RIGHTS = 0x01, /* Transfer file descriptors. */ +#define SCM_RIGHTS SCM_RIGHTS +#ifdef __USE_BSD + SCM_CREDENTIALS = 0x02, /* Credentials passing. */ +# define SCM_CREDENTIALS SCM_CREDENTIALS +#endif + __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */ + }; + +/* User visible structure for SCM_CREDENTIALS message */ + +struct ucred +{ + pid_t pid; /* PID of sending process. */ + uid_t uid; /* UID of sending process. */ + gid_t gid; /* GID of sending process. */ +}; + +/* Get socket manipulation related informations from kernel headers. */ +#include + + +/* Structure used to manipulate the SO_LINGER option. */ +struct linger + { + int l_onoff; /* Nonzero to linger on close. */ + int l_linger; /* Time to linger. */ + }; + +#endif /* bits/socket.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/statvfs.h b/sysdeps/unix/sysv/linux/sparc/bits/statvfs.h new file mode 100644 index 0000000000..4197149fb7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/statvfs.h @@ -0,0 +1,106 @@ +/* Copyright (C) 1997, 1998, 2000, 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _SYS_STATVFS_H +# error "Never include directly; use instead." +#endif + +#include /* For __fsblkcnt_t and __fsfilcnt_t. */ + +#if __WORDSIZE == 32 +#define _STATVFSBUF_F_UNUSED +#endif + +struct statvfs + { + unsigned long int f_bsize; + unsigned long int f_frsize; +#ifndef __USE_FILE_OFFSET64 + __fsblkcnt_t f_blocks; + __fsblkcnt_t f_bfree; + __fsblkcnt_t f_bavail; + __fsfilcnt_t f_files; + __fsfilcnt_t f_ffree; + __fsfilcnt_t f_favail; +#else + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsfilcnt64_t f_favail; +#endif + unsigned long int f_fsid; +#ifdef _STATVFSBUF_F_UNUSED + int __f_unused; +#endif + unsigned long int f_flag; + unsigned long int f_namemax; + int __f_spare[6]; + }; + +#ifdef __USE_LARGEFILE64 +struct statvfs64 + { + unsigned long int f_bsize; + unsigned long int f_frsize; + __fsblkcnt64_t f_blocks; + __fsblkcnt64_t f_bfree; + __fsblkcnt64_t f_bavail; + __fsfilcnt64_t f_files; + __fsfilcnt64_t f_ffree; + __fsfilcnt64_t f_favail; + unsigned long int f_fsid; +#ifdef _STATVFSBUF_F_UNUSED + int __f_unused; +#endif + unsigned long int f_flag; + unsigned long int f_namemax; + int __f_spare[6]; + }; +#endif + +/* Definitions for the flag in `f_flag'. These definitions should be + kept in sync which the definitions in . */ +enum +{ + ST_RDONLY = 1, /* Mount read-only. */ +#define ST_RDONLY ST_RDONLY + ST_NOSUID = 2, /* Ignore suid and sgid bits. */ +#define ST_NOSUID ST_NOSUID +#ifdef __USE_GNU + ST_NODEV = 4, /* Disallow access to device special files. */ +# define ST_NODEV ST_NODEV + ST_NOEXEC = 8, /* Disallow program execution. */ +# define ST_NOEXEC ST_NOEXEC + ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ +# define ST_SYNCHRONOUS ST_SYNCHRONOUS + ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ +# define ST_MANDLOCK ST_MANDLOCK + ST_WRITE = 128, /* Write on file/directory/symlink. */ +# define ST_WRITE ST_WRITE + ST_APPEND = 256, /* Append-only file. */ +# define ST_APPEND ST_APPEND + ST_IMMUTABLE = 512, /* Immutable file. */ +# define ST_IMMUTABLE ST_IMMUTABLE + ST_NOATIME = 1024, /* Do not update access times. */ +# define ST_NOATIME ST_NOATIME + ST_NODIRATIME /* Do not update directory access times. */ +# define ST_NODIRATIME ST_NODIRATIME +#endif /* Use GNU. */ +}; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/time.h b/sysdeps/unix/sysv/linux/sparc/bits/time.h new file mode 100644 index 0000000000..13b4251209 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/time.h @@ -0,0 +1,73 @@ +/* System-dependent timing definitions. Linux/SPARC version. + Copyright (C) 1996, 1997, 1999, 2000, 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + * Never include this file directly; use instead. + */ + +#ifndef __need_timeval +# ifndef _BITS_TIME_H +# define _BITS_TIME_H 1 + +/* ISO/IEC 9899:1990 7.12.1: + The macro `CLOCKS_PER_SEC' is the number per second of the value + returned by the `clock' function. */ +/* CAE XSH, Issue 4, Version 2: + The value of CLOCKS_PER_SEC is required to be 1 million on all + XSI-conformant systems. */ +# define CLOCKS_PER_SEC 1000000l + +# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K +/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK + presents the real value for clock ticks per second for the system. */ +# include +extern long int __sysconf (int); +# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ +# endif + +# ifdef __USE_POSIX199309 +/* Identifier for system-wide realtime clock. */ +# define CLOCK_REALTIME 0 +/* High-resolution timer from the CPU. */ +# define CLOCK_PROCESS_CPUTIME_ID 2 +/* Thread-specific CPU-time clock. */ +# define CLOCK_THREAD_CPUTIME_ID 3 + +/* Flag to indicate time is absolute. */ +# define TIMER_ABSTIME 1 +# endif + +# endif /* bits/time.h */ +#endif + +#ifdef __need_timeval +# undef __need_timeval +# ifndef _STRUCT_TIMEVAL +# define _STRUCT_TIMEVAL 1 +# include + +/* A time value that is accurate to the nearest + microsecond but also has a range of years. */ +struct timeval + { + __time_t tv_sec; /* Seconds. */ + __suseconds_t tv_usec; /* Microseconds. */ + }; +# endif /* struct timeval */ +#endif /* need timeval */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/bits/time.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/bits/time.h deleted file mode 100644 index 26d9b51693..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/bits/time.h +++ /dev/null @@ -1,73 +0,0 @@ -/* System-dependent timing definitions. Linux/SPARCv9 version. - Copyright (C) 1996, 1997, 1999, 2000, 2001 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use instead. - */ - -#ifndef __need_timeval -# ifndef _BITS_TIME_H -# define _BITS_TIME_H 1 - -/* ISO/IEC 9899:1990 7.12.1: - The macro `CLOCKS_PER_SEC' is the number per second of the value - returned by the `clock' function. */ -/* CAE XSH, Issue 4, Version 2: - The value of CLOCKS_PER_SEC is required to be 1 million on all - XSI-conformant systems. */ -# define CLOCKS_PER_SEC 1000000l - -# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K -/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK - presents the real value for clock ticks per second for the system. */ -# include -extern long int __sysconf (int); -# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ -# endif - -# ifdef __USE_POSIX199309 -/* Identifier for system-wide realtime clock. */ -# define CLOCK_REALTIME 0 -/* High-resolution timer from the CPU. */ -# define CLOCK_PROCESS_CPUTIME_ID 2 -/* Thread-specific CPU-time clock. */ -# define CLOCK_THREAD_CPUTIME_ID 3 - -/* Flag to indicate time is absolute. */ -# define TIMER_ABSTIME 1 -# endif - -# endif /* bits/time.h */ -#endif - -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -# include - -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - __time_t tv_sec; /* Seconds. */ - __suseconds_t tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/get_clockfreq.c b/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/get_clockfreq.c new file mode 100644 index 0000000000..4191085d1f --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sparcv9/get_clockfreq.c @@ -0,0 +1 @@ +#include diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h deleted file mode 100644 index 9e52fbb849..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/siginfo.h +++ /dev/null @@ -1,306 +0,0 @@ -/* siginfo_t, sigevent and constants. Linux/SPARC64 version. - Copyright (C) 1997, 1998, 1999, 2000, 2001 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if !defined _SIGNAL_H && !defined __need_siginfo_t \ - && !defined __need_sigevent_t -# error "Never include this file directly. Use instead" -#endif - -#include - -#if (!defined __have_sigval_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t \ - || defined __need_sigevent_t)) -# define __have_sigval_t 1 - -/* Type for data associated with a signal. */ -typedef union sigval - { - int sival_int; - void *sival_ptr; - } sigval_t; -#endif - -#if (!defined __have_siginfo_t \ - && (defined _SIGNAL_H || defined __need_siginfo_t)) -# define __have_siginfo_t 1 - -# define __SI_MAX_SIZE 128 -# if __WORDSIZE == 64 -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4) -# else -# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3) -# endif - -typedef struct siginfo - { - int si_signo; /* Signal number. */ - int si_errno; /* If non-zero, an errno value associated with - this signal, as defined in . */ - int si_code; /* Signal code. */ - - union - { - int _pad[__SI_PAD_SIZE]; - - /* kill(). */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - } _kill; - - /* POSIX.1b timers. */ - struct - { - unsigned int _timer1; - unsigned int _timer2; - } _timer; - - /* POSIX.1b signals. */ - struct - { - __pid_t si_pid; /* Sending process ID. */ - __uid_t si_uid; /* Real user ID of sending process. */ - sigval_t si_sigval; /* Signal value. */ - } _rt; - - /* SIGCHLD. */ - struct - { - __pid_t si_pid; /* Which child. */ - __uid_t si_uid; /* Real user ID of sending process. */ - int si_status; /* Exit value or signal. */ - __clock_t si_utime; - __clock_t si_stime; - } _sigchld; - - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */ - struct - { - void *si_addr; /* Faulting insn/memory ref. */ - } _sigfault; - - /* SIGPOLL. */ - struct - { - int si_band; /* Band event for SIGPOLL. */ - int si_fd; - } _sigpoll; - } _sifields; - } siginfo_t; - - -/* X/Open requires some more fields with fixed names. */ -# define si_pid _sifields._kill.si_pid -# define si_uid _sifields._kill.si_uid -# define si_timer1 _sifields._timer._timer1 -# define si_timer2 _sifields._timer._timer2 -# define si_status _sifields._sigchld.si_status -# define si_utime _sifields._sigchld.si_utime -# define si_stime _sifields._sigchld.si_stime -# define si_value _sifields._rt.si_sigval -# define si_int _sifields._rt.si_sigval.sival_int -# define si_ptr _sifields._rt.si_sigval.sival_ptr -# define si_addr _sifields._sigfault.si_addr -# define si_band _sifields._sigpoll.si_band -# define si_fd _sifields._sigpoll.si_fd - - -/* Values for `si_code'. Positive values are reserved for kernel-generated - signals. */ -enum -{ - SI_ASYNCNL = -6, /* Sent by asynch name lookup completion. */ -# define SI_ASYNCNL SI_ASYNCNL - SI_SIGIO, /* Sent by queued SIGIO. */ -# define SI_SIGIO SI_SIGIO - SI_ASYNCIO, /* Sent by AIO completion. */ -# define SI_ASYNCIO SI_ASYNCIO - SI_MESGQ, /* Sent by real time mesq state change. */ -# define SI_MESGQ SI_MESGQ - SI_TIMER, /* Sent by timer expiration. */ -# define SI_TIMER SI_TIMER - SI_QUEUE, /* Sent by sigqueue. */ -# define SI_QUEUE SI_QUEUE - SI_USER, /* Sent by kill, sigsend, raise. */ -# define SI_USER SI_USER - SI_KERNEL = 0x80 /* Send by kernel. */ -#define SI_KERNEL SI_KERNEL -}; - - -/* `si_code' values for SIGILL signal. */ -enum -{ - ILL_ILLOPC = 1, /* Illegal opcode. */ -# define ILL_ILLOPC ILL_ILLOPC - ILL_ILLOPN, /* Illegal operand. */ -# define ILL_ILLOPN ILL_ILLOPN - ILL_ILLADR, /* Illegal addressing mode. */ -# define ILL_ILLADR ILL_ILLADR - ILL_ILLTRP, /* Illegal trap. */ -# define ILL_ILLTRP ILL_ILLTRP - ILL_PRVOPC, /* Privileged opcode. */ -# define ILL_PRVOPC ILL_PRVOPC - ILL_PRVREG, /* Privileged register. */ -# define ILL_PRVREG ILL_PRVREG - ILL_COPROC, /* Coprocessor error. */ -# define ILL_COPROC ILL_COPROC - ILL_BADSTK /* Internal stack error. */ -# define ILL_BADSTK ILL_BADSTK -}; - -/* `si_code' values for SIGFPE signal. */ -enum -{ - FPE_INTDIV = 1, /* Integer divide by zero. */ -# define FPE_INTDIV FPE_INTDIV - FPE_INTOVF, /* Integer overflow. */ -# define FPE_INTOVF FPE_INTOVF - FPE_FLTDIV, /* Floating point divide by zero. */ -# define FPE_FLTDIV FPE_FLTDIV - FPE_FLTOVF, /* Floating point overflow. */ -# define FPE_FLTOVF FPE_FLTOVF - FPE_FLTUND, /* Floating point underflow. */ -# define FPE_FLTUND FPE_FLTUND - FPE_FLTRES, /* Floating point inexact result. */ -# define FPE_FLTRES FPE_FLTRES - FPE_FLTINV, /* Floating point invalid operation. */ -# define FPE_FLTINV FPE_FLTINV - FPE_FLTSUB /* Subscript out of range. */ -# define FPE_FLTSUB FPE_FLTSUB -}; - -/* `si_code' values for SIGSEGV signal. */ -enum -{ - SEGV_MAPERR = 1, /* Address not mapped to object. */ -# define SEGV_MAPERR SEGV_MAPERR - SEGV_ACCERR /* Invalid permissions for mapped object. */ -# define SEGV_ACCERR SEGV_ACCERR -}; - -/* `si_code' values for SIGBUS signal. */ -enum -{ - BUS_ADRALN = 1, /* Invalid address alignment. */ -# define BUS_ADRALN BUS_ADRALN - BUS_ADRERR, /* Non-existant physical address. */ -# define BUS_ADRERR BUS_ADRERR - BUS_OBJERR /* Object specific hardware error. */ -# define BUS_OBJERR BUS_OBJERR -}; - -/* `si_code' values for SIGTRAP signal. */ -enum -{ - TRAP_BRKPT = 1, /* Process breakpoint. */ -# define TRAP_BRKPT TRAP_BRKPT - TRAP_TRACE /* Process trace trap. */ -# define TRAP_TRACE TRAP_TRACE -}; - -/* `si_code' values for SIGCHLD signal. */ -enum -{ - CLD_EXITED = 1, /* Child has exited. */ -# define CLD_EXITED CLD_EXITED - CLD_KILLED, /* Child was killed. */ -# define CLD_KILLED CLD_KILLED - CLD_DUMPED, /* Child terminated abnormally. */ -# define CLD_DUMPED CLD_DUMPED - CLD_TRAPPED, /* Traced child has trapped. */ -# define CLD_TRAPPED CLD_TRAPPED - CLD_STOPPED, /* Child has stopped. */ -# define CLD_STOPPED CLD_STOPPED - CLD_CONTINUED /* Stopped child has continued. */ -# define CLD_CONTINUED CLD_CONTINUED -}; - -/* `si_code' values for SIGPOLL signal. */ -enum -{ - POLL_IN = 1, /* Data input available. */ -# define POLL_IN POLL_IN - POLL_OUT, /* Output buffers available. */ -# define POLL_OUT POLL_OUT - POLL_MSG, /* Input message available. */ -# define POLL_MSG POLL_MSG - POLL_ERR, /* I/O error. */ -# define POLL_ERR POLL_ERR - POLL_PRI, /* High priority input available. */ -# define POLL_PRI POLL_PRI - POLL_HUP /* Device disconnected. */ -# define POLL_HUP POLL_HUP -}; - -# undef __need_siginfo_t -#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */ - - -#if (defined _SIGNAL_H || defined __need_sigevent_t) \ - && !defined __have_sigevent_t -# define __have_sigevent_t 1 - -/* Structure to transport application-defined values with signals. */ -# define __SIGEV_MAX_SIZE 64 -# if __WORDSIZE == 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) -# else -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) -# endif - -/* Forward declaration of the `pthread_attr_t' type. */ -struct __pthread_attr_s; - -typedef struct sigevent - { - sigval_t sigev_value; - int sigev_signo; - int sigev_notify; - - union - { - int _pad[__SIGEV_PAD_SIZE]; - - struct - { - void (*_function) (sigval_t); /* Function to start. */ - struct __pthread_attr_s *_attribute; /* Really pthread_attr_t. */ - } _sigev_thread; - } _sigev_un; - } sigevent_t; - -/* POSIX names to access some of the members. */ -# define sigev_notify_function _sigev_un._sigev_thread._function -# define sigev_notify_attributes _sigev_un._sigev_thread._attribute - -/* `sigev_notify' values. */ -enum -{ - SIGEV_SIGNAL = 0, /* Notify via signal. */ -# define SIGEV_SIGNAL SIGEV_SIGNAL - SIGEV_NONE, /* Other notification: meaningless. */ -# define SIGEV_NONE SIGEV_NONE - SIGEV_THREAD /* Deliver via thread creation. */ -# define SIGEV_THREAD SIGEV_THREAD -}; - -#endif /* have _SIGNAL_H. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/socket.h deleted file mode 100644 index 50074c7885..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/socket.h +++ /dev/null @@ -1,308 +0,0 @@ -/* System-specific socket constants and types. Linux/SPARC64 version. - Copyright (C) 1991,1992,1994-1999,2000,2001 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef __BITS_SOCKET_H -#define __BITS_SOCKET_H - -#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H -# error "Never include directly; use instead." -#endif - -#define __need_size_t -#define __need_NULL -#include - -#include -#include - -/* Type for length arguments in socket calls. */ -#ifndef __socklen_t_defined -typedef __socklen_t socklen_t; -# define __socklen_t_defined -#endif - -/* Types of sockets. */ -enum __socket_type -{ - SOCK_STREAM = 1, /* Sequenced, reliable, connection-based - byte streams. */ -#define SOCK_STREAM SOCK_STREAM - SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams - of fixed maximum length. */ -#define SOCK_DGRAM SOCK_DGRAM - SOCK_RAW = 3, /* Raw protocol interface. */ -#define SOCK_RAW SOCK_RAW - SOCK_RDM = 4, /* Reliably-delivered messages. */ -#define SOCK_RDM SOCK_RDM - SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based, - datagrams of fixed maximum length. */ -#define SOCK_SEQPACKET SOCK_SEQPACKET - SOCK_PACKET = 10 /* Linux specific way of getting packets - at the dev level. For writing rarp and - other similar things on the user level. */ -#define SOCK_PACKET SOCK_PACKET -}; - -/* Protocol families. */ -#define PF_UNSPEC 0 /* Unspecified. */ -#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */ -#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */ -#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */ -#define PF_INET 2 /* IP protocol family. */ -#define PF_AX25 3 /* Amateur Radio AX.25. */ -#define PF_IPX 4 /* Novell Internet Protocol. */ -#define PF_APPLETALK 5 /* Appletalk DDP. */ -#define PF_NETROM 6 /* Amateur radio NetROM. */ -#define PF_BRIDGE 7 /* Multiprotocol bridge. */ -#define PF_ATMPVC 8 /* ATM PVCs. */ -#define PF_X25 9 /* Reserved for X.25 project. */ -#define PF_INET6 10 /* IP version 6. */ -#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */ -#define PF_DECnet 12 /* Reserved for DECnet project. */ -#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */ -#define PF_SECURITY 14 /* Security callback pseudo AF. */ -#define PF_KEY 15 /* PF_KEY key management API. */ -#define PF_NETLINK 16 -#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */ -#define PF_PACKET 17 /* Packet family. */ -#define PF_ASH 18 /* Ash. */ -#define PF_ECONET 19 /* Acorn Econet. */ -#define PF_ATMSVC 20 /* ATM SVCs. */ -#define PF_SNA 22 /* Linux SNA Project */ -#define PF_IRDA 23 /* IRDA sockets. */ -#define PF_PPPOX 24 /* PPPoX sockets. */ -#define PF_MAX 32 /* For now.. */ - -/* Address families. */ -#define AF_UNSPEC PF_UNSPEC -#define AF_LOCAL PF_LOCAL -#define AF_UNIX PF_UNIX -#define AF_FILE PF_FILE -#define AF_INET PF_INET -#define AF_AX25 PF_AX25 -#define AF_IPX PF_IPX -#define AF_APPLETALK PF_APPLETALK -#define AF_NETROM PF_NETROM -#define AF_BRIDGE PF_BRIDGE -#define AF_ATMPVC PF_ATMPVC -#define AF_X25 PF_X25 -#define AF_INET6 PF_INET6 -#define AF_ROSE PF_ROSE -#define AF_DECnet PF_DECnet -#define AF_NETBEUI PF_NETBEUI -#define AF_SECURITY PF_SECURITY -#define AF_KEY PF_KEY -#define AF_NETLINK PF_NETLINK -#define AF_ROUTE PF_ROUTE -#define AF_PACKET PF_PACKET -#define AF_ASH PF_ASH -#define AF_ECONET PF_ECONET -#define AF_ATMSVC PF_ATMSVC -#define AF_SNA PF_SNA -#define AF_IRDA PF_IRDA -#define AF_PPPOX PF_PPPOX -#define AF_MAX PF_MAX - -/* Socket level values. Others are defined in the appropriate headers. - - XXX These definitions also should go into the appropriate headers as - far as they are available. */ -#define SOL_RAW 255 -#define SOL_DECNET 261 -#define SOL_X25 262 -#define SOL_PACKET 263 -#define SOL_ATM 264 /* ATM layer (cell level). */ -#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */ -#define SOL_IRDA 266 - -/* Maximum queue length specifiable by listen. */ -#define SOMAXCONN 128 - -/* Get the definition of the macro to define the common sockaddr members. */ -#include - -/* Structure describing a generic socket address. */ -struct sockaddr - { - __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */ - char sa_data[14]; /* Address data. */ - }; - - -/* Structure large enough to hold any socket address (with the historical - exception of AF_UNIX). We reserve 128 bytes. */ -#if ULONG_MAX > 0xffffffff -# define __ss_aligntype __uint64_t -#else -# define __ss_aligntype __uint32_t -#endif -#define _SS_SIZE 128 -#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype))) - -struct sockaddr_storage - { - __SOCKADDR_COMMON (ss_); /* Address family, etc. */ - __ss_aligntype __ss_align; /* Force desired alignment. */ - char __ss_padding[_SS_PADSIZE]; - }; - - -/* Bits in the FLAGS argument to `send', `recv', et al. */ -enum - { - MSG_OOB = 0x01, /* Process out-of-band data. */ -#define MSG_OOB MSG_OOB - MSG_PEEK = 0x02, /* Peek at incoming messages. */ -#define MSG_PEEK MSG_PEEK - MSG_DONTROUTE = 0x04, /* Don't use local routing. */ -#define MSG_DONTROUTE MSG_DONTROUTE -#ifdef __USE_GNU - /* DECnet uses a different name. */ - MSG_TRYHARD = MSG_DONTROUTE, -# define MSG_TRYHARD MSG_DONTROUTE -#endif - MSG_CTRUNC = 0x08, /* Control data lost before delivery. */ -#define MSG_CTRUNC MSG_CTRUNC - MSG_PROXY = 0x10, /* Supply or ask second address. */ -#define MSG_PROXY MSG_PROXY - MSG_TRUNC = 0x20, -#define MSG_TRUNC MSG_TRUNC - MSG_DONTWAIT = 0x40, /* Nonblocking IO. */ -#define MSG_DONTWAIT MSG_DONTWAIT - MSG_EOR = 0x80, /* End of record. */ -#define MSG_EOR MSG_EOR - MSG_WAITALL = 0x100, /* Wait for a full request. */ -#define MSG_WAITALL MSG_WAITALL - MSG_FIN = 0x200, -#define MSG_FIN MSG_FIN - MSG_SYN = 0x400, -#define MSG_SYN MSG_SYN - MSG_CONFIRM = 0x800, /* Confirm path validity. */ -#define MSG_CONFIRM MSG_CONFIRM - MSG_RST = 0x1000, -#define MSG_RST MSG_RST - MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */ -#define MSG_ERRQUEUE MSG_ERRQUEUE - MSG_NOSIGNAL = 0x4000 /* Do not generate SIGPIPE. */ -#define MSG_NOSIGNAL MSG_NOSIGNAL - }; - - -/* Structure describing messages sent by - `sendmsg' and received by `recvmsg'. */ -struct msghdr - { - void *msg_name; /* Address to send to/receive from. */ - socklen_t msg_namelen; /* Length of address data. */ - - struct iovec *msg_iov; /* Vector of data to send/receive into. */ - size_t msg_iovlen; /* Number of elements in the vector. */ - - void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ - size_t msg_controllen; /* Ancillary data buffer length. */ - - int msg_flags; /* Flags on received message. */ - }; - -/* Structure used for storage of ancillary data object information. */ -struct cmsghdr - { - size_t cmsg_len; /* Length of data in cmsg_data plus length - of cmsghdr structure. */ - int cmsg_level; /* Originating protocol. */ - int cmsg_type; /* Protocol specific type. */ - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ - /* XXX Perhaps this should be removed. */ - }; - -/* Ancillary data object manipulation macros. */ -#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2 -# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data) -#else -# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) -#endif -#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg) -#define CMSG_FIRSTHDR(mhdr) \ - ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \ - ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL) -#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \ - & (size_t) ~(sizeof (size_t) - 1)) -#define CMSG_SPACE(len) (CMSG_ALIGN (len) \ - + CMSG_ALIGN (sizeof (struct cmsghdr))) -#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) - -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, - struct cmsghdr *__cmsg) __THROW; -#ifdef __USE_EXTERN_INLINES -# ifndef _EXTERN_INLINE -# define _EXTERN_INLINE extern __inline -# endif -_EXTERN_INLINE struct cmsghdr * -__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW -{ - if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) - /* The kernel header does this so there may be a reason. */ - return 0; - - __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg - + CMSG_ALIGN (__cmsg->cmsg_len)); - if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control - + __mhdr->msg_controllen) - || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) - /* No more entries. */ - return 0; - return __cmsg; -} -#endif /* Use `extern inline'. */ - -/* Socket level message types. This must match the definitions in - . */ -enum - { - SCM_RIGHTS = 0x01, /* Transfer file descriptors. */ -#define SCM_RIGHTS SCM_RIGHTS -#ifdef __USE_BSD - SCM_CREDENTIALS = 0x02, /* Credentials passing. */ -# define SCM_CREDENTIALS SCM_CREDENTIALS -#endif - __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */ - }; - -/* User visible structure for SCM_CREDENTIALS message */ - -struct ucred -{ - pid_t pid; /* PID of sending process. */ - uid_t uid; /* UID of sending process. */ - gid_t gid; /* GID of sending process. */ -}; - -/* Get socket manipulation related informations from kernel headers. */ -#include - - -/* Structure used to manipulate the SO_LINGER option. */ -struct linger - { - int l_onoff; /* Nonzero to linger on close. */ - int l_linger; /* Time to linger. */ - }; - -#endif /* bits/socket.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/statvfs.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/statvfs.h deleted file mode 100644 index 747dc1ba9f..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/statvfs.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 1997, 1998, 2000, 2001 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _SYS_STATVFS_H -# error "Never include directly; use instead." -#endif - -#include /* For __fsblkcnt_t and __fsfilcnt_t. */ - -struct statvfs - { - unsigned long int f_bsize; - unsigned long int f_frsize; -#ifndef __USE_FILE_OFFSET64 - __fsblkcnt_t f_blocks; - __fsblkcnt_t f_bfree; - __fsblkcnt_t f_bavail; - __fsfilcnt_t f_files; - __fsfilcnt_t f_ffree; - __fsfilcnt_t f_favail; -#else - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_bavail; - __fsfilcnt64_t f_files; - __fsfilcnt64_t f_ffree; - __fsfilcnt64_t f_favail; -#endif - unsigned long int f_fsid; - unsigned long int f_flag; - unsigned long int f_namemax; - int __f_spare[6]; - }; - -#ifdef __USE_LARGEFILE64 -struct statvfs64 - { - unsigned long int f_bsize; - unsigned long int f_frsize; - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_bavail; - __fsfilcnt64_t f_files; - __fsfilcnt64_t f_ffree; - __fsfilcnt64_t f_favail; - unsigned long int f_fsid; - unsigned long int f_flag; - unsigned long int f_namemax; - int __f_spare[6]; - }; -#endif - -/* Definitions for the flag in `f_flag'. These definitions should be - kept in sync which the definitions in . */ -enum -{ - ST_RDONLY = 1, /* Mount read-only. */ -#define ST_RDONLY ST_RDONLY - ST_NOSUID = 2, /* Ignore suid and sgid bits. */ -#define ST_NOSUID ST_NOSUID -#ifdef __USE_GNU - ST_NODEV = 4, /* Disallow access to device special files. */ -# define ST_NODEV ST_NODEV - ST_NOEXEC = 8, /* Disallow program execution. */ -# define ST_NOEXEC ST_NOEXEC - ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ -# define ST_SYNCHRONOUS ST_SYNCHRONOUS - ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ -# define ST_MANDLOCK ST_MANDLOCK - ST_WRITE = 128, /* Write on file/directory/symlink. */ -# define ST_WRITE ST_WRITE - ST_APPEND = 256, /* Append-only file. */ -# define ST_APPEND ST_APPEND - ST_IMMUTABLE = 512, /* Immutable file. */ -# define ST_IMMUTABLE ST_IMMUTABLE - ST_NOATIME = 1024, /* Do not update access times. */ -# define ST_NOATIME ST_NOATIME - ST_NODIRATIME /* Do not update directory access times. */ -# define ST_NODIRATIME ST_NODIRATIME -#endif /* Use GNU. */ -}; diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h b/sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h deleted file mode 100644 index 752b0a03f1..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/bits/time.h +++ /dev/null @@ -1,73 +0,0 @@ -/* System-dependent timing definitions. Linux/SPARC64 version. - Copyright (C) 1996, 1997, 1999, 2000, 2001 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* - * Never include this file directly; use instead. - */ - -#ifndef __need_timeval -# ifndef _BITS_TIME_H -# define _BITS_TIME_H 1 - -/* ISO/IEC 9899:1990 7.12.1: - The macro `CLOCKS_PER_SEC' is the number per second of the value - returned by the `clock' function. */ -/* CAE XSH, Issue 4, Version 2: - The value of CLOCKS_PER_SEC is required to be 1 million on all - XSI-conformant systems. */ -# define CLOCKS_PER_SEC 1000000l - -# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K -/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK - presents the real value for clock ticks per second for the system. */ -# include -extern long int __sysconf (int); -# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */ -# endif - -# ifdef __USE_POSIX199309 -/* Identifier for system-wide realtime clock. */ -# define CLOCK_REALTIME 0 -/* High-resolution timer from the CPU. */ -# define CLOCK_PROCESS_CPUTIME_ID 2 -/* Thread-specific CPU-time clock. */ -# define CLOCK_THREAD_CPUTIME_ID 3 - -/* Flag to indicate time is absolute. */ -# define TIMER_ABSTIME 1 -# endif - -# endif /* bits/time.h */ -#endif - -#ifdef __need_timeval -# undef __need_timeval -# ifndef _STRUCT_TIMEVAL -# define _STRUCT_TIMEVAL 1 -# include - -/* A time value that is accurate to the nearest - microsecond but also has a range of years. */ -struct timeval - { - __time_t tv_sec; /* Seconds. */ - __suseconds_t tv_usec; /* Microseconds. */ - }; -# endif /* struct timeval */ -#endif /* need timeval */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c new file mode 100644 index 0000000000..c199163bc2 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c @@ -0,0 +1,240 @@ +/* Get frequency of the system processor. sparc64 version. + Copyright (C) 2001 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static hp_timing_t +__get_clockfreq_via_cpuinfo (void) +{ + hp_timing_t result; + int fd; + + result = 0; + + fd = open ("/proc/cpuinfo", O_RDONLY); + if (fd != -1) + { + char buf[8192]; + ssize_t n; + + n = read (fd, buf, sizeof buf); + if (n > 0) + { + char *mhz = memmem (buf, n, "Cpu0ClkTck", 7); + + if (mhz != NULL) + { + char *endp = buf + n; + + /* Search for the beginning of the string. */ + while (mhz < endp + && (*mhz < '0' || *mhz > '9') + && (*mhz < 'a' || *mhz > 'f') + && *mhz != '\n') + ++mhz; + + while (mhz < endp && *mhz != '\n') + { + if ((*mhz >= '0' && *mhz <= '9') || + (*mhz >= 'a' && *mhz <= 'f')) + { + result <<= 4; + if (*mhz >= '0' && *mhz <= '9') + result += *mhz - '0'; + else + result += (*mhz - 'a') + 10; + } + ++mhz; + } + } + } + + close (fd); + } + + return result; +} + +static hp_timing_t +__get_clockfreq_via_proc_openprom (void) +{ + hp_timing_t result; + int obp_fd; + + result = 0; + + obp_fd = open ("/proc/openprom", O_RDONLY); + if (obp_fd != -1) + { + unsigned long buf[4096 / sizeof (unsigned long)]; + struct dirent *dirp = (struct dirent *) buf; + off_t dbase = (off_t) 0; + int len; + + while ((len = getdirentries (obp_fd, (char *) dirp, + sizeof (buf), &dbase)) > 0) + { + struct dirent *this_dirp = dirp; + + while (len > 0) + { + char node_name[strlen ("/proc/openprom/") + + this_dirp->d_reclen + + strlen ("/clock-frequency")]; + int fd; + + strcpy (node_name, "/proc/openprom/"); + strcat (node_name, this_dirp->d_name); + strcat (node_name, "/device_type"); + fd = open (node_name, O_RDONLY); + if (fd != -1) + { + char type_string[128]; + int ret; + + ret = read (fd, type_string, sizeof (type_string)); + if (ret > 0 && !strncmp (type_string, "'cpu'", 5)) + { + int clkfreq_fd; + + strcpy (node_name, "/proc/openprom/"); + strcat (node_name, this_dirp->d_name); + strcat (node_name, "/clock-frequency"); + clkfreq_fd = open (node_name, O_RDONLY); + if (fd != -1) + { + if (read (clkfreq_fd, type_string, + sizeof (type_string)) > 0) + result = (hp_timing_t) + strtol (type_string, (char **)NULL, 16); + close (clkfreq_fd); + } + } + close (fd); + } + + if (result != 0) + break; + + len -= this_dirp->d_reclen; + this_dirp = (struct dirent *) + ((char *)this_dirp + this_dirp->d_reclen); + } + if (result != 0) + break; + } + close (obp_fd); + } + + return result; +} + +static hp_timing_t +__get_clockfreq_via_dev_openprom (void) +{ + hp_timing_t result; + int obp_dev_fd; + + result = 0; + + obp_dev_fd = open ("/dev/openprom", O_RDONLY); + if (obp_dev_fd != -1) + { + char obp_buf[8192]; + struct openpromio *obp_cmd = (struct openpromio *)obp_buf; + int ret; + + obp_cmd->oprom_size = + sizeof (obp_buf) - sizeof (unsigned int); + *(int *)obp_cmd->oprom_array = 0; + ret = ioctl (obp_dev_fd, OPROMCHILD, (char *) obp_cmd); + if (ret == 0) + { + int cur_node = *(int *)obp_cmd->oprom_array; + + while (cur_node != 0 && cur_node != -1) + { + obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); + strcpy (obp_cmd->oprom_array, "device_type"); + ret = ioctl (obp_dev_fd, OPROMGETPROP, (char *) obp_cmd); + if (ret == 0 + && !strncmp (obp_cmd->oprom_array, "cpu", 3)) + { + obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); + strcpy (obp_cmd->oprom_array, "clock-frequency"); + ret = ioctl (obp_dev_fd, OPROMGETPROP, (char *) obp_cmd); + if (ret == 0) + { + result = (hp_timing_t) + *(unsigned int *)obp_cmd->oprom_array; + } + } + obp_cmd->oprom_size = sizeof (obp_buf) - sizeof (unsigned int); + *(int *)obp_cmd->oprom_array = cur_node; + ret = ioctl (obp_dev_fd, OPROMNEXT, (char *) obp_cmd); + if (ret < 0) + break; + cur_node = *(int *)obp_cmd->oprom_array; + } + } + } + + return result; +} + +hp_timing_t +__get_clockfreq (void) +{ + static hp_timing_t result; + + /* If this function was called before, we know the result. */ + if (result != 0) + return result; + + /* We first read the information from the /proc/cpuinfo file. + It contains at least one line like + Cpu0ClkTick : 000000002cb41780 + We search for this line and convert the number in an integer. */ + + result = __get_clockfreq_via_cpuinfo (); + if (result != 0) + return result; + + /* If that did not work, try to find an OpenPROM node + with device_type equal to 'cpu' using /dev/openprom + and fetch the clock-frequency property from there. */ + + result = __get_clockfreq_via_dev_openprom (); + if (result != 0) + return result; + + /* Finally, try the same lookup as above but using /proc/openprom. */ + + result = __get_clockfreq_via_proc_openprom (); + + return result; +} diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S index 963aa6d89d..a0f9216531 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1997 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2001 Free Software Foundation, Inc. Contributed by Richard Henderson (rth@tamu.edu). The GNU C Library is free software; you can redistribute it and/or @@ -29,7 +29,7 @@ /* void longjmp (sigjmp_buf env, int val) */ -ENTRY(longjmp) +ENTRY(__libc_siglongjmp) /* Modify the context with the value we want to return. */ movre %o1, 1, %o1 @@ -41,10 +41,10 @@ ENTRY(longjmp) /* And bamf back to where we belong! */ ta 0x6f -END(longjmp) +END(__libc_siglongjmp) -strong_alias(longjmp, __longjmp) -strong_alias(longjmp, __libc_longjmp) -strong_alias(longjmp, __libc_siglongjmp) -weak_alias(longjmp, _longjmp) -weak_alias(longjmp, siglongjmp) +strong_alias(__libc_siglongjmp, __longjmp) +strong_alias(__libc_siglongjmp, __libc_longjmp) +weak_alias(__libc_siglongjmp, longjmp) +weak_alias(__libc_siglongjmp, _longjmp) +weak_alias(__libc_siglongjmp, siglongjmp) -- cgit 1.4.1