diff options
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/hurd/Makefile | 9 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 34 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/intr-msg.h | 90 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/sigreturn.c | 3 | ||||
-rw-r--r-- | sysdeps/mach/hurd/opendir.c | 3 | ||||
-rw-r--r-- | sysdeps/mach/hurd/sysd-stdio.c | 11 | ||||
-rw-r--r-- | sysdeps/mach/i386/machine-sp.h | 3 |
7 files changed, 94 insertions, 59 deletions
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile index 05bf1d222d..007016dabc 100644 --- a/sysdeps/mach/hurd/Makefile +++ b/sysdeps/mach/hurd/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc. +# Copyright (C) 1993,94,95,96,97,98,99,2000,01 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 @@ -149,7 +149,12 @@ lib-noranlib: $(common-objpfx)hurd/libhurduser-link.so endif $(link-rpcuserlibs): %-link.so: %_pic.a - $(build-module) -nostdlib -Wl,-soname=$(*F).so$($(*F).so-version) +# The $(build-module) variable now contains a sequence of several commands, +# so we can't tweak the ld command just by adding text to this command line. + $(build-module) +LDFLAGS-link-rpcuserlibs = -nostdlib -Wl,-soname=$(*F).so$($(*F).so-version) +LDFLAGS-libmachuser-link.so = $(LDFLAGS-link-rpcuserlibs) +LDFLAGS-libhurduser-link.so = $(LDFLAGS-link-rpcuserlibs) # And get them into the libc.so ldscript. $(inst_libdir)/libc.so: $(rpcuserlibs) diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 3e0531b10b..25ae5bbc68 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -1,5 +1,5 @@ /* Operating system support for run-time dynamic linker. Hurd version. - Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,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 @@ -36,6 +36,7 @@ #include <stdarg.h> #include <ctype.h> #include <sys/stat.h> +#include <sys/uio.h> #include <entry.h> #include <dl-machine.h> @@ -554,6 +555,37 @@ __libc_write (int fd, const void *buf, size_t nbytes) return nwrote; } +/* This is only used for printing messages (see dl-misc.c). */ +__ssize_t weak_function +__writev (int fd, const struct iovec *iov, int niov) +{ + int i; + size_t total = 0; + for (i = 0; i < niov; ++i) + total += iov[i].iov_len; + + assert (fd < _hurd_init_dtablesize); + + if (total != 0) + { + char buf[total], *bufp = buf; + error_t err; + mach_msg_type_number_t nwrote; + + for (i = 0; i < niov; ++i) + bufp = (memcpy (bufp, iov[i].iov_base, iov[i].iov_len) + + iov[i].iov_len); + + err = __io_write (_hurd_init_dtable[fd], buf, total, -1, &nwrote); + if (err) + return __hurd_fail (err); + + return nwrote; + } + return 0; +} + + off_t weak_function __lseek (int fd, off_t offset, int whence) { diff --git a/sysdeps/mach/hurd/i386/intr-msg.h b/sysdeps/mach/hurd/i386/intr-msg.h index d862d5842a..dcfc5d4e4d 100644 --- a/sysdeps/mach/hurd/i386/intr-msg.h +++ b/sysdeps/mach/hurd/i386/intr-msg.h @@ -1,5 +1,5 @@ /* Machine-dependent details of interruptible RPC messaging. i386 version. - Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,99,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 @@ -53,20 +53,20 @@ INTR_MSG_BACK_OUT (struct i386_thread_state *state) #include "hurdfault.h" -static inline int -SYSCALL_EXAMINE (struct i386_thread_state *state, int *callno) -{ - struct { unsigned int c[2]; } *p = (void *) (state->eip - 7); - int result; - if (_hurdsig_catch_memory_fault (p)) - return 0; - if (result = p->c[0] == 0x0000009a && (p->c[1] & 0x00ffffff) == 0x00000700) - /* The PC is just after an `lcall $7,$0' instruction. - This is a system call in progress; %eax holds the call number. */ - *callno = state->eax; - _hurdsig_end_catch_fault (); - return result; -} +/* This cannot be an inline function because it calls setjmp. */ +#define SYSCALL_EXAMINE(state, callno) \ +({ \ + struct { unsigned int c[2]; } *p = (void *) ((state)->eip - 7); \ + int result; \ + if (_hurdsig_catch_memory_fault (p)) \ + return 0; \ + if (result = p->c[0] == 0x0000009a && (p->c[1] & 0x00ffffff) == 0x00000700) \ + /* The PC is just after an `lcall $7,$0' instruction. \ + This is a system call in progress; %eax holds the call number. */ \ + *(callno) = (state)->eax; \ + _hurdsig_end_catch_fault (); \ + result; \ +}) struct mach_msg_trap_args @@ -83,35 +83,31 @@ struct mach_msg_trap_args }; -static inline int -MSG_EXAMINE (struct i386_thread_state *state, int *msgid, - mach_port_t *rcv_name, mach_port_t *send_name, - mach_msg_option_t *option, mach_msg_timeout_t *timeout) -{ - const struct mach_msg_trap_args *args = (const void *) state->uesp; - mach_msg_header_t *msg; - - if (_hurdsig_catch_memory_fault (args)) - return -1; - msg = args->msg; - *option = args->option; - *timeout = args->timeout; - *rcv_name = args->rcv_name; - _hurdsig_end_catch_fault (); - - if (msg == 0) - { - *send_name = MACH_PORT_NULL; - *msgid = 0; - } - else - { - if (_hurdsig_catch_memory_fault (msg)) - return -1; - *send_name = msg->msgh_remote_port; - *msgid = msg->msgh_id; - _hurdsig_end_catch_fault (); - } - - return 0; -} +/* This cannot be an inline function because it calls setjmp. */ +#define MSG_EXAMINE(state, msgid, rcvname, send_name, opt, tmout) \ +({ \ + const struct mach_msg_trap_args *args = (const void *) (state)->uesp; \ + mach_msg_header_t *msg; \ + _hurdsig_catch_memory_fault (args) ? -1 : \ + ({ \ + msg = args->msg; \ + *(opt) = args->option; \ + *(tmout) = args->timeout; \ + *(rcvname) = args->rcv_name; \ + _hurdsig_end_catch_fault (); \ + if (msg == 0) \ + { \ + *(send_name) = MACH_PORT_NULL; \ + *(msgid) = 0; \ + } \ + else \ + { \ + if (_hurdsig_catch_memory_fault (msg)) \ + return -1; \ + *(send_name) = msg->msgh_remote_port; \ + *(msgid) = msg->msgh_id; \ + _hurdsig_end_catch_fault (); \ + } \ + 0; \ + }); \ +}) diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c index 334351d285..c7ee9e2b62 100644 --- a/sysdeps/mach/hurd/i386/sigreturn.c +++ b/sysdeps/mach/hurd/i386/sigreturn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,94,95,96,97,98,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 @@ -23,6 +23,7 @@ register int *sp asm ("%esp"); #include <hurd/threadvar.h> #include <hurd/msg.h> #include <stdlib.h> +#include <string.h> int __sigreturn (struct sigcontext *scp) diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c index ae92fd9043..a0e0567a12 100644 --- a/sysdeps/mach/hurd/opendir.c +++ b/sysdeps/mach/hurd/opendir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1993,94,95,96,97,98,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 @@ -20,6 +20,7 @@ #include <limits.h> #include <stddef.h> #include <stdlib.h> +#include <string.h> #include <dirent.h> #include <fcntl.h> #include <sys/types.h> diff --git a/sysdeps/mach/hurd/sysd-stdio.c b/sysdeps/mach/hurd/sysd-stdio.c index fea9b56a96..0ba751d217 100644 --- a/sysdeps/mach/hurd/sysd-stdio.c +++ b/sysdeps/mach/hurd/sysd-stdio.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1994,95,96,97,98,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 @@ -175,11 +175,10 @@ __stdio_open (filename, m, cookieptr) /* Open FILENAME with the mode in M. Use the same magic cookie already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN. */ int -__stdio_reopen (filename, m, cookieptr, closefn) - const char *filename; - __io_mode m; - void **cookieptr; - __io_close_fn closefn; +__stdio_reopen (const char *filename, + __io_mode m, + void **cookieptr, + __io_close_fn closefn) { int flags; file_t port; diff --git a/sysdeps/mach/i386/machine-sp.h b/sysdeps/mach/i386/machine-sp.h index da616974f1..985ce878dc 100644 --- a/sysdeps/mach/i386/machine-sp.h +++ b/sysdeps/mach/i386/machine-sp.h @@ -1,5 +1,5 @@ /* Machine-specific function to return the stack pointer. i386 version. - Copyright (C) 1994, 1997 Free Software Foundation, Inc. + Copyright (C) 1994,97,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 @@ -26,6 +26,7 @@ #define _EXTERN_INLINE extern __inline #endif +extern void *__thread_stack_pointer (void); _EXTERN_INLINE void * __thread_stack_pointer (void) { |