From e75154a665018d5756196275634704c95476ea6b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 2 Aug 1996 05:27:50 +0000 Subject: Remade for alpha-1.93 --- sysdeps/generic/ioctl-types.h | 6 +++ sysdeps/generic/sysdep.h | 37 ++++++++++++++ sysdeps/gnu/utmpbits.h | 5 +- sysdeps/i386/dl-machine.h | 8 +-- sysdeps/i386/sysdep.h | 91 +++++++++++++++++++++++++++++++++ sysdeps/stub/_exit.c | 8 +-- sysdeps/stub/socket.c | 4 +- sysdeps/stub/socketpair.c | 4 +- sysdeps/stub/stdio_lim.h | 2 - sysdeps/unix/i386/sysdep.h | 68 +----------------------- sysdeps/unix/mk-local_lim.c | 9 +++- sysdeps/unix/sysdep.h | 19 ++----- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/sys/sysmacros.h | 31 +++++++++++ 14 files changed, 193 insertions(+), 101 deletions(-) create mode 100644 sysdeps/generic/sysdep.h create mode 100644 sysdeps/i386/sysdep.h create mode 100644 sysdeps/unix/sysv/linux/sys/sysmacros.h (limited to 'sysdeps') diff --git a/sysdeps/generic/ioctl-types.h b/sysdeps/generic/ioctl-types.h index 0fc0cd40e1..1116d52e33 100644 --- a/sysdeps/generic/ioctl-types.h +++ b/sysdeps/generic/ioctl-types.h @@ -83,6 +83,11 @@ struct winsize #endif #if defined (TIOCGSIZE) || defined (TIOCSSIZE) +/* The BSD-style ioctl constructor macros use `sizeof', which can't be used + in a preprocessor conditional. Since the commands are always unique + regardless of the size bits, we can safely define away `sizeof' for the + purpose of the conditional. */ +# define sizeof(type) 0 # if defined (TIOCGWINSZ) && TIOCGSIZE == TIOCGWINSZ /* Many systems that have TIOCGWINSZ define TIOCGSIZE for source compatibility with Sun; they define `struct ttysize' to have identical @@ -105,6 +110,7 @@ struct ttysize int ts_lines, ts_cols; /* Lines and columns, in characters. */ }; # endif +# undef sizeof /* See above. */ #endif diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h new file mode 100644 index 0000000000..def2d18dc2 --- /dev/null +++ b/sysdeps/generic/sysdep.h @@ -0,0 +1,37 @@ +/* Generic asm macros used on many machines. +Copyright (C) 1991, 92, 93, 96 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. */ + +#ifndef C_LABEL + +/* Define a macro we can use to construct the asm name for a C symbol. */ +#ifdef NO_UNDERSCORES +#ifdef __STDC__ +#define C_LABEL(name) name##: +#else +#define C_LABEL(name) name/**/: +#endif +#else +#ifdef __STDC__ +#define C_LABEL(name) _##name##: +#else +#define C_LABEL(name) _/**/name/**/: +#endif +#endif + +#endif diff --git a/sysdeps/gnu/utmpbits.h b/sysdeps/gnu/utmpbits.h index 4749fdd3fe..0dd55b59fa 100644 --- a/sysdeps/gnu/utmpbits.h +++ b/sysdeps/gnu/utmpbits.h @@ -71,9 +71,10 @@ struct utmp #define ut_time ut_tv.tv_sec /* Backwards compatibility. */ -/* Tell the user that we have a modern system with UT_HOST, UT_TYPE, UT_ID - and UT_TV fields. */ +/* Tell the user that we have a modern system with UT_HOST, UT_PID, + UT_TYPE, UT_ID and UT_TV fields. */ #define _HAVE_UT_TYPE 1 +#define _HAVE_UT_PID 1 #define _HAVE_UT_ID 1 #define _HAVE_UT_TV 1 #define _HAVE_UT_HOST 1 diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index dc88b043ea..111122e437 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ #include /* Return nonzero iff E_MACHINE is compatible with the running host. */ -static inline int +static inline int __attribute__ ((unused)) elf_machine_matches_host (Elf32_Half e_machine) { switch (e_machine) @@ -41,7 +41,7 @@ elf_machine_matches_host (Elf32_Half e_machine) /* Return the run-time address of the _GLOBAL_OFFSET_TABLE_. Must be inlined in a function which uses global data. */ -static inline Elf32_Addr * +static inline Elf32_Addr * __attribute__ ((unused)) elf_machine_got (void) { register Elf32_Addr *got asm ("%ebx"); @@ -50,7 +50,7 @@ elf_machine_got (void) /* Return the run-time load address of the shared object. */ -static inline Elf32_Addr +static inline Elf32_Addr __attribute__ ((unused)) elf_machine_load_address (void) { Elf32_Addr addr; @@ -72,7 +72,7 @@ elf_machine_load_address (void) /* Set up the loaded object described by L so its unrelocated PLT entries will jump to the on-demand fixup code in dl-runtime.c. */ -static inline void +static inline void __attribute__ ((unused)) elf_machine_runtime_setup (struct link_map *l, int lazy) { Elf32_Addr *got; diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h new file mode 100644 index 0000000000..9c312b0d0c --- /dev/null +++ b/sysdeps/i386/sysdep.h @@ -0,0 +1,91 @@ +/* Assembler macros for i386. +Copyright (C) 1991, 92, 93, 95, 96 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. */ + +#include + +#ifdef ASSEMBLER + +/* Syntactic details of assembler. */ + +#ifdef HAVE_ELF + +/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ +#define ALIGNARG(log2) 1< +#include #ifdef ASSEMBLER -/* Syntactic details of assembler. */ - -#ifdef HAVE_ELF - -/* ELF uses byte-counts for .align, most others use log2 of count of bytes. */ -#define ALIGNARG(log2) 1< + #include #define HAVE_SYSCALLS @@ -34,21 +36,6 @@ Cambridge, MA 02139, USA. */ an instruction such that "MOVE(r1, r0)" works. ret should be defined as the return instruction. */ -/* Define a macro we can use to construct the asm name for a C symbol. */ -#ifdef NO_UNDERSCORES -#ifdef __STDC__ -#define C_LABEL(name) name##: -#else -#define C_LABEL(name) name/**/: -#endif -#else -#ifdef __STDC__ -#define C_LABEL(name) _##name##: -#else -#define C_LABEL(name) _/**/name/**/: -#endif -#endif - #ifdef __STDC__ #define SYS_ify(syscall_name) SYS_##syscall_name #else diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 8c7f26dc81..85bab92635 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -3,7 +3,7 @@ sysdep_routines += sysctl sysdep_headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h \ sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \ - sys/user.h syscall-list.h + sys/user.h syscall-list.h sys/sysmacros.h # Generate the list of SYS_* macros for the system calls (__NR_* macros). $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/syscall.h diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h new file mode 100644 index 0000000000..61e55e3a8c --- /dev/null +++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h @@ -0,0 +1,31 @@ +/* Definitions of macros to access `dev_t' values. +Copyright (C) 1996 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_SYSMACROS_H +#define _SYS_SYSMACROS_H 1 + +/* Get definition from kernel header. */ +#include + +/* For compatibility we provide alternative names. */ +#define major(dev) MAJOR ((unsigned int) (dev)) +#define minor(dev) MINOR ((unsigned int) (dev)) +#define makedev(major, minor) MKDEV (major, minor) + +#endif /* sys/sysmacros.h */ -- cgit v1.2.3-70-g09d2