1995-02-18 01:27:10 +00:00
|
|
|
/* Set thread_state for sighandler, and sigcontext to recover. i386 version.
|
2008-03-08 21:39:00 +00:00
|
|
|
Copyright (C) 1994,1995,1996,1997,1998,1999,2005,2008
|
2005-12-21 22:16:34 +00:00
|
|
|
Free Software Foundation, Inc.
|
1997-06-23 21:55:26 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-06-23 21:55:26 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
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.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1997-06-23 21:55:26 +00:00
|
|
|
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
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
#include <hurd/signal.h>
|
1995-04-02 22:08:59 +00:00
|
|
|
#include <hurd/userlink.h>
|
2005-12-21 22:16:34 +00:00
|
|
|
#include <thread_state.h>
|
2008-03-08 21:39:00 +00:00
|
|
|
#include <mach/machine/eflags.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include "hurdfault.h"
|
2005-12-21 22:16:34 +00:00
|
|
|
#include <intr-msg.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-01-04 17:00:45 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
struct sigcontext *
|
|
|
|
_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
int signo, struct hurd_signal_detail *detail,
|
1995-02-18 01:27:10 +00:00
|
|
|
volatile int rpc_wait,
|
|
|
|
struct machine_thread_all_state *state)
|
|
|
|
{
|
1999-07-28 18:19:47 +00:00
|
|
|
void trampoline (void);
|
|
|
|
void rpc_wait_trampoline (void);
|
|
|
|
void firewall (void);
|
1995-08-17 22:55:22 +00:00
|
|
|
extern const void _hurd_intr_rpc_msg_in_trap;
|
|
|
|
extern const void _hurd_intr_rpc_msg_cx_sp;
|
|
|
|
extern const void _hurd_intr_rpc_msg_sp_restored;
|
1995-02-18 01:27:10 +00:00
|
|
|
void *volatile sigsp;
|
|
|
|
struct sigcontext *scp;
|
1996-01-04 17:00:45 +00:00
|
|
|
struct
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
|
|
|
int signo;
|
|
|
|
long int sigcode;
|
|
|
|
struct sigcontext *scp; /* Points to ctx, below. */
|
Thu Mar 16 00:04:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/C-ctype.c: New correct data generated by drepper.
* Rules: Don't use $(libc.a).
Parsing of grouped numbers contributed by Ulrich Drepper.
* stdlib/strtol.c (__strtol_internal): Renamed from strtol. Take
new flag arg; if nonzero, parse locale-dependent thousands
grouping and interpret only the prefix that is correctly grouped.
(strtol): Define this to call _strtol_internal with zero for the flag.
Use a weak symbol for the definition.
* stdlib/strtod.c (strtod, __strtod_internal): Likewise.
Check for the exponent of the number overflowing the float format.
* stdlib/stdlib.h (__strtof, __strtold): Declarations removed.
(__strto{f,d,ld,l,ul,q,uq}_internal): Declare these functions.
[__OPTIMIZE__]: Define inline functions calling those.
* stdlib/grouping.h: New file, written by drepper.
* stdlib/Makefile (distribute): Add grouping.h.
* stdio/vfscanf.c: Grok %' modifier to numeric conversions. Call
__strtoX_internal with the grouping flag set iff the modifier is
present.
Wed Mar 15 00:40:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/generic/memchr.c: Fix typos: limit.h -> limits.h.
* mach/Machrules: Produce static deps for all object flavors.
[interface-library]: Remove all these variables and rules.
($(interface-library)-routines): Define this variable.
(extra-libs): Append $(interface-library) to this.
* mach/Makefile (interface-library): Omit .a suffix.
* hurd/Makefile: Likewise.
Tue Mar 14 23:40:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* stdio/internals.c (flushbuf): If !FLUSH_ONLY, don't skip out
early if no new data in buffer after priming.
* Makerules (object-suffixes, libtypes): Move all these variables
to Makeconfig.
* Makeconfig (object-suffixes, libtypes): Moved here from Makerules.
* Makerules (build-extra-lib): New canned sequence.
* sysdeps/mach/hurd/euidaccess.c: Include fcntl.h. Declare ERR;
fix uses of FILE and PORT. Remove bogus weak alias for `access'.
* sysdeps/mach/hurd/dirfd.c: Include hurd/fd.h and errno.h.
Add missing semicolon.
* sysdeps/mach/hurd/opendir.c: Include hurd/fd.h. Use a `struct
hurd_fd *' temp var, since DIRP->__fd is a `void *'.
* sysdeps/mach/hurd/readdir.c: Include hurd/fd.h.
* stdlib/wcstombs.c: #if 0 out code for non-ASCII chars until the
locale data format is implemented.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Pass &__sigreturn on the stack to the trampoline code, so it is
not position-dependent.
* stdio/printf_fp.c (NDEBUG): Define this to disable assert.
Don't include <stdarg.h>.
(__printf_fp): Last arg ARGS is now `const void **const';
dereference ARGS[0] instead of using va_arg.
* locale/setlocale.c: In LC_ALL case, initialize CATEGORY before
loop to install data.
* locale/loadlocale.c (_nl_category_num_items): Use _NL_ITEM_INDEX
to extract number from item code.
(_nl_load_locale): Close the descriptor when finished.
* malloc/realloc.c (_realloc_internal): Call _malloc_internal in
place of malloc.
* time/tzfile.c (__tzfile_default): Initialize RULE_STDOFF to zero.
1995-03-16 05:32:45 +00:00
|
|
|
void *sigreturn_addr;
|
|
|
|
void *sigreturn_returns_here;
|
1995-02-18 01:27:10 +00:00
|
|
|
struct sigcontext *return_scp; /* Same; arg to sigreturn. */
|
|
|
|
struct sigcontext ctx;
|
1995-04-02 22:08:59 +00:00
|
|
|
struct hurd_userlink link;
|
1995-02-18 01:27:10 +00:00
|
|
|
} *stackframe;
|
|
|
|
|
|
|
|
if (ss->context)
|
|
|
|
{
|
|
|
|
/* We have a previous sigcontext that sigreturn was about
|
|
|
|
to restore when another signal arrived. We will just base
|
|
|
|
our setup on that. */
|
1996-01-04 17:00:45 +00:00
|
|
|
if (! _hurdsig_catch_memory_fault (ss->context))
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
|
|
|
memcpy (&state->basic, &ss->context->sc_i386_thread_state,
|
|
|
|
sizeof (state->basic));
|
|
|
|
memcpy (&state->fpu, &ss->context->sc_i386_float_state,
|
|
|
|
sizeof (state->fpu));
|
1995-05-08 09:11:25 +00:00
|
|
|
state->set |= (1 << i386_THREAD_STATE) | (1 << i386_FLOAT_STATE);
|
1995-02-18 01:27:10 +00:00
|
|
|
}
|
|
|
|
}
|
1995-05-08 09:11:25 +00:00
|
|
|
|
|
|
|
if (! machine_get_basic_state (ss->thread, state))
|
1995-02-18 01:27:10 +00:00
|
|
|
return NULL;
|
|
|
|
|
1995-08-17 22:55:22 +00:00
|
|
|
/* Save the original SP in the gratuitous `esp' slot.
|
|
|
|
We may need to reset the SP (the `uesp' slot) to avoid clobbering an
|
|
|
|
interrupted RPC frame. */
|
|
|
|
state->basic.esp = state->basic.uesp;
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
if ((ss->actions[signo].sa_flags & SA_ONSTACK) &&
|
1998-08-08 20:02:34 +00:00
|
|
|
!(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK)))
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
|
|
|
sigsp = ss->sigaltstack.ss_sp + ss->sigaltstack.ss_size;
|
1998-08-08 20:02:34 +00:00
|
|
|
ss->sigaltstack.ss_flags |= SS_ONSTACK;
|
1995-02-18 01:27:10 +00:00
|
|
|
/* XXX need to set up base of new stack for
|
|
|
|
per-thread variables, cthreads. */
|
|
|
|
}
|
1995-08-17 22:55:22 +00:00
|
|
|
/* This code has intimate knowledge of the special mach_msg system call
|
1996-02-08 02:10:15 +00:00
|
|
|
done in intr-msg.c; that code does (see intr-msg.h):
|
1995-08-17 22:55:22 +00:00
|
|
|
movl %esp, %ecx
|
|
|
|
leal ARGS, %esp
|
|
|
|
_hurd_intr_rpc_msg_cx_sp: movl $-25, %eax
|
|
|
|
_hurd_intr_rpc_msg_do_trap: lcall $7, $0
|
|
|
|
_hurd_intr_rpc_msg_in_trap: movl %ecx, %esp
|
1997-06-23 21:55:26 +00:00
|
|
|
_hurd_intr_rpc_msg_sp_restored:
|
1995-08-17 22:55:22 +00:00
|
|
|
We must check for the window during which %esp points at the
|
|
|
|
mach_msg arguments. The space below until %ecx is used by
|
|
|
|
the _hurd_intr_rpc_mach_msg frame, and must not be clobbered. */
|
1996-01-04 17:00:45 +00:00
|
|
|
else if (state->basic.eip >= (int) &_hurd_intr_rpc_msg_cx_sp &&
|
1995-08-17 22:55:22 +00:00
|
|
|
state->basic.eip < (int) &_hurd_intr_rpc_msg_sp_restored)
|
|
|
|
/* The SP now points at the mach_msg args, but there is more stack
|
|
|
|
space used below it. The real SP is saved in %ecx; we must push the
|
|
|
|
new frame below there, and restore that value as the SP on
|
|
|
|
sigreturn. */
|
|
|
|
sigsp = (char *) (state->basic.uesp = state->basic.ecx);
|
1995-02-18 01:27:10 +00:00
|
|
|
else
|
|
|
|
sigsp = (char *) state->basic.uesp;
|
|
|
|
|
|
|
|
/* Push the arguments to call `trampoline' on the stack. */
|
|
|
|
sigsp -= sizeof (*stackframe);
|
|
|
|
stackframe = sigsp;
|
|
|
|
|
1996-01-04 17:00:45 +00:00
|
|
|
if (_hurdsig_catch_memory_fault (stackframe))
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
|
|
|
/* We got a fault trying to write the stack frame.
|
|
|
|
We cannot set up the signal handler.
|
|
|
|
Returning NULL tells our caller, who will nuke us with a SIGILL. */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int ok;
|
|
|
|
|
1995-04-02 22:08:59 +00:00
|
|
|
extern void _hurdsig_longjmp_from_handler (void *, jmp_buf, int);
|
|
|
|
|
|
|
|
/* Add a link to the thread's active-resources list. We mark this as
|
|
|
|
the only user of the "resource", so the cleanup function will be
|
|
|
|
called by any longjmp which is unwinding past the signal frame.
|
|
|
|
The cleanup function (in sigunwind.c) will make sure that all the
|
|
|
|
appropriate cleanups done by sigreturn are taken care of. */
|
|
|
|
stackframe->link.cleanup = &_hurdsig_longjmp_from_handler;
|
|
|
|
stackframe->link.cleanup_data = &stackframe->ctx;
|
|
|
|
stackframe->link.resource.next = NULL;
|
|
|
|
stackframe->link.resource.prevp = NULL;
|
|
|
|
stackframe->link.thread.next = ss->active_resources;
|
|
|
|
stackframe->link.thread.prevp = &ss->active_resources;
|
|
|
|
if (stackframe->link.thread.next)
|
|
|
|
stackframe->link.thread.next->thread.prevp
|
|
|
|
= &stackframe->link.thread.next;
|
|
|
|
ss->active_resources = &stackframe->link;
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Set up the arguments for the signal handler. */
|
|
|
|
stackframe->signo = signo;
|
Tue May 7 19:00:01 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* string/argz-extract.c: Remove const from decl.
* string/argz.h: Here too.
* Makeconfig (version.mk): Fix regexp in sed cmd.
Depend on $(..)Makeconfig.
* GMP code updated from gmp-2.0 release.
* stdlib/Makefile (mpn-routines): Removed add_1, added inlines.
* sysdeps/generic/add_1.c: File removed.
* stdlib/strtod.c: mp_limb is now mp_limb_t.
* stdlib/fpioconst.c, stdlib/fpioconst.h: Likewise.
* stdio-common/_itoa.c: Likewise.
* stdio-common/printf_fp.c: Likewise.
Don't include ansidecl.h.
* sysdeps/mach/hurd/getcwd.c: Use io_identity instead of io_stat.
* shlib-versions: New file.
* Makerules (soversions.mk): New target, include file generated from
shlib-versions. Moved shared library rules before installation rules.
Rewrote shared library installation rules for versioned libraries.
* math/Makefile (libm.so-version): Variable removed.
* sysdeps/mach/hurd/i386/exc2signal.c: Use struct hurd_signal_detail.
* hurd/report-wait.c (_S_msg_describe_ports): New function.
* configure.in: Add AC_PROG_LN_S check.
* config.make.in (LN_S): New variable.
Sun May 5 03:10:44 1996 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt_r.c (ecvt_r): Work aroung gcc bug. gcc does
not know about weak aliases now and optimizes necessary `if'
statement away.
* posix/unistd.h: Add swapoff prototype.
* sysdeps/generic/confname.h: Add even more POSIX.4 symbols.
* sysdeps/posix/fpathconf.c (__fpathconf): Get information
for _PC_PATH_MAX from fstatfs function if available.
* sysdeps/posix/sysconf.c: Add code to handle _SC_AIO_LISTIO_MAX,
_SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, and
_SC_TIMER_MAX.
* sysdeps/unix/sysv/sysv4/sysconf.c: Ditto.
* sysdeps/stub/swapoff.c: New file. Stub version for swapoff
function.
* sysdeps/unix/syscalls.list: Add swapoff.
* sysdeps/unix/sysv/linux/Dist: Add sys/acct.h.
* sysdeps/unix/sysv/linux/Makefile [$(subdir) == misc]
(sysdep_routines): Add mount, umount, llseek, setfsgid, setfsuid,
sysinfo, and uselib.
(headers): Add sys/sysinfo.h.
* sysdeps/unix/sysv/linux/gethostid.c: Prevent warning.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) == misc]
(sysdep_routines): Add ioperm, iopl, and vm86.
(headers): Add sys/perm.h and sys/vm86.h.
* sysdeps/unix/sysv/linux/i386/sys/perm.h: New file. Contains
prototypes for iopl and ioperm.
* sysdeps/unix/sysv/linux/i386/sys/vm86.h: New file. Contains
prototype for vm86.
* sysdeps/unix/sysv/linux/i386/syscalls.list: New file. Add
vm86 system call.
* sysdeps/unix/sysv/linux/sys/acct.h: New file. Contains
prototypes for acct function.
* sysdeps/unix/sysv/linux/sys/socket.h: Provide real header
file with prototypes.
* sysdeps/unix/sysv/linux/sys/sysinfo.h: New file. Contains
prototype for sysinfo function.
* sysdeps/unix/sysv/linux/syscalls.list: Add flock, ioperm, iopl,
llseek, setfsgid, setfsuid, sysinfo, and uselib.
* sysdeps/unix/sysv/linux/sysconf.c: Instead of duplicating
posix/sysconf.c now only handle cases different to that
implementation.
Tue May 7 15:08:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (__line_wrap_output): Renamed from lwoutput
(all references changed). Now exported.
* stdio/linewrap.c (struct data): Type deleted (moved to linewrap.h).
(wrap_stream, unwrap_stream, lwclose, lwfileno, lwoutput,
line_wrap_stream, line_unwrap_stream): Use struct line_wrap_data
instead of struct data.
(lwoutput, line_wrap_stream, line_unwrap_stream): Rename various
occurences of `wrap' and `wrapmargin' to `wmargin'.
(line_wrapped, line_wrap_lmargin, line_wrap_set_lmargin,
line_wrap_rmargin, line_wrap_set_rmargin, line_wrap_wmargin,
line_wrap_set_wmargin, line_wrap_point): New functions.
* stdio/linewrap.h: New file.
* stdio/Makefile (headers): Add linewrap.h.
Tue May 7 14:19:12 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* sysdeps/unix/sysv/linux/i386/Makefile: File removed.
* stdio/stdio.h: Remove line_wrap_stream, line_unwap_stream decls.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
Tue May 7 13:47:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
* stdio/linewrap.c (struct data): Make margin fields not-pointers.
(lwoutput): Adjust uses acordingly.
* sysdeps/mach/hurd/fdatasync.c: New file.
* sysdeps/mach/hurd/fsync.c: Pass new flag to file_sync.
* sysdeps/mach/hurd/xmknod.c: Pass new flag to dir_link.
* sysdeps/mach/hurd/symlink.c: Likewise.
* sysdeps/mach/hurd/link.c: Likewise.
* sysdeps/mach/hurd/bind.c: Likewise.
* hurd/hurdsig.c (write_corefile): Likewise.
* hurd/hurdsig.c (write_corefile): Pass cttyid port to crash server.
* sysdeps/mach/hurd/fpathconf.c: RPC takes int pointer, not long int.
* sysdeps/mach/hurd/_exit.c (_hurd_exit): Pass sigcode arg to
proc_mark_exit.
* sysdeps/mach/hurd/dl-sysdep.c (_exit): Likewise.
* sysdeps/mach/hurd/wait4.c: Pass sigcode arg to proc_wait.
* sysdeps/mach/hurd/rename.c: Pass new flag to dir_rename.
* hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Use struct
hurd_signal_detail.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/hurd-raise.c (_hurd_raise_signal): Likewise.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Likewise.
* sysdeps/mach/hurd/setitimer.c (restart_itimer): Likewise.
* hurd/hurd/signal.h: Fix _hurd_exception2signal prototype.
* hurd/hurdsig.c (write_corefile): Take const struct
hurd_signal_detail * arg. Pass all details to crash_dump_task.
(_hurd_internal_post_signal): Pass DETAIL to write_corefile.
(_hurd_internal_post_signal: suspend): Pass code and error to
proc_mark_stop.
* hurd/hurdprio.c (_hurd_priority_which_map): Pass flags arg to
proc_getprocinfo by reference.
1996-05-08 02:07:47 +00:00
|
|
|
stackframe->sigcode = detail->code;
|
1995-02-18 01:27:10 +00:00
|
|
|
stackframe->scp = stackframe->return_scp = scp = &stackframe->ctx;
|
Thu Mar 16 00:04:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/C-ctype.c: New correct data generated by drepper.
* Rules: Don't use $(libc.a).
Parsing of grouped numbers contributed by Ulrich Drepper.
* stdlib/strtol.c (__strtol_internal): Renamed from strtol. Take
new flag arg; if nonzero, parse locale-dependent thousands
grouping and interpret only the prefix that is correctly grouped.
(strtol): Define this to call _strtol_internal with zero for the flag.
Use a weak symbol for the definition.
* stdlib/strtod.c (strtod, __strtod_internal): Likewise.
Check for the exponent of the number overflowing the float format.
* stdlib/stdlib.h (__strtof, __strtold): Declarations removed.
(__strto{f,d,ld,l,ul,q,uq}_internal): Declare these functions.
[__OPTIMIZE__]: Define inline functions calling those.
* stdlib/grouping.h: New file, written by drepper.
* stdlib/Makefile (distribute): Add grouping.h.
* stdio/vfscanf.c: Grok %' modifier to numeric conversions. Call
__strtoX_internal with the grouping flag set iff the modifier is
present.
Wed Mar 15 00:40:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/generic/memchr.c: Fix typos: limit.h -> limits.h.
* mach/Machrules: Produce static deps for all object flavors.
[interface-library]: Remove all these variables and rules.
($(interface-library)-routines): Define this variable.
(extra-libs): Append $(interface-library) to this.
* mach/Makefile (interface-library): Omit .a suffix.
* hurd/Makefile: Likewise.
Tue Mar 14 23:40:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* stdio/internals.c (flushbuf): If !FLUSH_ONLY, don't skip out
early if no new data in buffer after priming.
* Makerules (object-suffixes, libtypes): Move all these variables
to Makeconfig.
* Makeconfig (object-suffixes, libtypes): Moved here from Makerules.
* Makerules (build-extra-lib): New canned sequence.
* sysdeps/mach/hurd/euidaccess.c: Include fcntl.h. Declare ERR;
fix uses of FILE and PORT. Remove bogus weak alias for `access'.
* sysdeps/mach/hurd/dirfd.c: Include hurd/fd.h and errno.h.
Add missing semicolon.
* sysdeps/mach/hurd/opendir.c: Include hurd/fd.h. Use a `struct
hurd_fd *' temp var, since DIRP->__fd is a `void *'.
* sysdeps/mach/hurd/readdir.c: Include hurd/fd.h.
* stdlib/wcstombs.c: #if 0 out code for non-ASCII chars until the
locale data format is implemented.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Pass &__sigreturn on the stack to the trampoline code, so it is
not position-dependent.
* stdio/printf_fp.c (NDEBUG): Define this to disable assert.
Don't include <stdarg.h>.
(__printf_fp): Last arg ARGS is now `const void **const';
dereference ARGS[0] instead of using va_arg.
* locale/setlocale.c: In LC_ALL case, initialize CATEGORY before
loop to install data.
* locale/loadlocale.c (_nl_category_num_items): Use _NL_ITEM_INDEX
to extract number from item code.
(_nl_load_locale): Close the descriptor when finished.
* malloc/realloc.c (_realloc_internal): Call _malloc_internal in
place of malloc.
* time/tzfile.c (__tzfile_default): Initialize RULE_STDOFF to zero.
1995-03-16 05:32:45 +00:00
|
|
|
stackframe->sigreturn_addr = &__sigreturn;
|
1999-07-28 18:19:47 +00:00
|
|
|
stackframe->sigreturn_returns_here = firewall; /* Crash on return. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* Set up the sigcontext from the current state of the thread. */
|
|
|
|
|
1998-08-08 20:02:34 +00:00
|
|
|
scp->sc_onstack = ss->sigaltstack.ss_flags & SS_ONSTACK ? 1 : 0;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* struct sigcontext is laid out so that starting at sc_gs mimics a
|
|
|
|
struct i386_thread_state. */
|
|
|
|
memcpy (&scp->sc_i386_thread_state,
|
|
|
|
&state->basic, sizeof (state->basic));
|
|
|
|
|
|
|
|
/* struct sigcontext is laid out so that starting at sc_fpkind mimics
|
|
|
|
a struct i386_float_state. */
|
|
|
|
ok = machine_get_state (ss->thread, state, i386_FLOAT_STATE,
|
|
|
|
&state->fpu, &scp->sc_i386_float_state,
|
|
|
|
sizeof (state->fpu));
|
|
|
|
|
|
|
|
_hurdsig_end_catch_fault ();
|
|
|
|
|
|
|
|
if (! ok)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Modify the thread state to call the trampoline code on the new stack. */
|
|
|
|
if (rpc_wait)
|
|
|
|
{
|
|
|
|
/* The signalee thread was blocked in a mach_msg_trap system call,
|
|
|
|
still waiting for a reply. We will have it run the special
|
|
|
|
trampoline code which retries the message receive before running
|
|
|
|
the signal handler.
|
1996-01-04 17:00:45 +00:00
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
To do this we change the OPTION argument on its stack to enable only
|
|
|
|
message reception, since the request message has already been
|
|
|
|
sent. */
|
|
|
|
|
1995-08-17 22:55:22 +00:00
|
|
|
struct mach_msg_trap_args *args = (void *) state->basic.esp;
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-01-04 17:00:45 +00:00
|
|
|
if (_hurdsig_catch_memory_fault (args))
|
1995-02-18 01:27:10 +00:00
|
|
|
{
|
|
|
|
/* Faulted accessing ARGS. Bomb. */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
assert (args->option & MACH_RCV_MSG);
|
|
|
|
/* Disable the message-send, since it has already completed. The
|
|
|
|
calls we retry need only wait to receive the reply message. */
|
|
|
|
args->option &= ~MACH_SEND_MSG;
|
|
|
|
|
1995-08-14 22:49:23 +00:00
|
|
|
/* Limit the time to receive the reply message, in case the server
|
|
|
|
claimed that `interrupt_operation' succeeded but in fact the RPC
|
|
|
|
is hung. */
|
|
|
|
args->option |= MACH_RCV_TIMEOUT;
|
|
|
|
args->timeout = _hurd_interrupted_rpc_timeout;
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
_hurdsig_end_catch_fault ();
|
|
|
|
|
1999-07-28 18:19:47 +00:00
|
|
|
state->basic.eip = (int) rpc_wait_trampoline;
|
1995-02-18 01:27:10 +00:00
|
|
|
/* The reply-receiving trampoline code runs initially on the original
|
|
|
|
user stack. We pass it the signal stack pointer in %ebx. */
|
1995-08-17 22:55:22 +00:00
|
|
|
state->basic.uesp = state->basic.esp; /* Restore mach_msg syscall SP. */
|
1995-02-18 01:27:10 +00:00
|
|
|
state->basic.ebx = (int) sigsp;
|
|
|
|
/* After doing the message receive, the trampoline code will need to
|
|
|
|
update the %eax value to be restored by sigreturn. To simplify
|
|
|
|
the assembly code, we pass the address of its slot in SCP to the
|
|
|
|
trampoline code in %ecx. */
|
|
|
|
state->basic.ecx = (int) &scp->sc_eax;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-07-28 18:19:47 +00:00
|
|
|
state->basic.eip = (int) trampoline;
|
1995-02-18 01:27:10 +00:00
|
|
|
state->basic.uesp = (int) sigsp;
|
|
|
|
}
|
|
|
|
/* We pass the handler function to the trampoline code in %edx. */
|
|
|
|
state->basic.edx = (int) handler;
|
|
|
|
|
2008-03-08 21:39:00 +00:00
|
|
|
/* The x86 ABI says the DF bit is clear on entry to any function. */
|
|
|
|
state->basic.efl &= ~EFL_DF;
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
return scp;
|
1999-07-28 18:19:47 +00:00
|
|
|
}
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-07-28 18:19:47 +00:00
|
|
|
/* The trampoline code follows. This used to be located inside
|
|
|
|
_hurd_setup_sighandler, but was optimized away by gcc 2.95. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-07-28 18:19:47 +00:00
|
|
|
asm ("rpc_wait_trampoline:\n");
|
1995-02-18 01:27:10 +00:00
|
|
|
/* This is the entry point when we have an RPC reply message to receive
|
|
|
|
before running the handler. The MACH_MSG_SEND bit has already been
|
|
|
|
cleared in the OPTION argument on our stack. The interrupted user
|
|
|
|
stack pointer has not been changed, so the system call can find its
|
|
|
|
arguments; the signal stack pointer is in %ebx. For our convenience,
|
|
|
|
%ecx points to the sc_eax member of the sigcontext. */
|
1999-07-28 18:19:47 +00:00
|
|
|
asm (/* Retry the interrupted mach_msg system call. */
|
1995-02-18 01:27:10 +00:00
|
|
|
"movl $-25, %eax\n" /* mach_msg_trap */
|
|
|
|
"lcall $7, $0\n"
|
|
|
|
/* When the sigcontext was saved, %eax was MACH_RCV_INTERRUPTED. But
|
|
|
|
now the message receive has completed and the original caller of
|
|
|
|
the RPC (i.e. the code running when the signal arrived) needs to
|
|
|
|
see the final return value of the message receive in %eax. So
|
|
|
|
store the new %eax value into the sc_eax member of the sigcontext
|
|
|
|
(whose address is in %ecx to make this code simpler). */
|
|
|
|
"movl %eax, (%ecx)\n"
|
|
|
|
/* Switch to the signal stack. */
|
|
|
|
"movl %ebx, %esp\n");
|
|
|
|
|
1999-07-28 18:19:47 +00:00
|
|
|
asm ("trampoline:\n");
|
1995-02-18 01:27:10 +00:00
|
|
|
/* Entry point for running the handler normally. The arguments to the
|
|
|
|
handler function are already on the top of the stack:
|
|
|
|
|
|
|
|
0(%esp) SIGNO
|
|
|
|
4(%esp) SIGCODE
|
|
|
|
8(%esp) SCP
|
|
|
|
*/
|
1999-07-28 18:19:47 +00:00
|
|
|
asm ("call *%edx\n" /* Call the handler function. */
|
Thu Mar 16 00:04:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/C-ctype.c: New correct data generated by drepper.
* Rules: Don't use $(libc.a).
Parsing of grouped numbers contributed by Ulrich Drepper.
* stdlib/strtol.c (__strtol_internal): Renamed from strtol. Take
new flag arg; if nonzero, parse locale-dependent thousands
grouping and interpret only the prefix that is correctly grouped.
(strtol): Define this to call _strtol_internal with zero for the flag.
Use a weak symbol for the definition.
* stdlib/strtod.c (strtod, __strtod_internal): Likewise.
Check for the exponent of the number overflowing the float format.
* stdlib/stdlib.h (__strtof, __strtold): Declarations removed.
(__strto{f,d,ld,l,ul,q,uq}_internal): Declare these functions.
[__OPTIMIZE__]: Define inline functions calling those.
* stdlib/grouping.h: New file, written by drepper.
* stdlib/Makefile (distribute): Add grouping.h.
* stdio/vfscanf.c: Grok %' modifier to numeric conversions. Call
__strtoX_internal with the grouping flag set iff the modifier is
present.
Wed Mar 15 00:40:54 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/generic/memchr.c: Fix typos: limit.h -> limits.h.
* mach/Machrules: Produce static deps for all object flavors.
[interface-library]: Remove all these variables and rules.
($(interface-library)-routines): Define this variable.
(extra-libs): Append $(interface-library) to this.
* mach/Makefile (interface-library): Omit .a suffix.
* hurd/Makefile: Likewise.
Tue Mar 14 23:40:31 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* stdio/internals.c (flushbuf): If !FLUSH_ONLY, don't skip out
early if no new data in buffer after priming.
* Makerules (object-suffixes, libtypes): Move all these variables
to Makeconfig.
* Makeconfig (object-suffixes, libtypes): Moved here from Makerules.
* Makerules (build-extra-lib): New canned sequence.
* sysdeps/mach/hurd/euidaccess.c: Include fcntl.h. Declare ERR;
fix uses of FILE and PORT. Remove bogus weak alias for `access'.
* sysdeps/mach/hurd/dirfd.c: Include hurd/fd.h and errno.h.
Add missing semicolon.
* sysdeps/mach/hurd/opendir.c: Include hurd/fd.h. Use a `struct
hurd_fd *' temp var, since DIRP->__fd is a `void *'.
* sysdeps/mach/hurd/readdir.c: Include hurd/fd.h.
* stdlib/wcstombs.c: #if 0 out code for non-ASCII chars until the
locale data format is implemented.
* sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler):
Pass &__sigreturn on the stack to the trampoline code, so it is
not position-dependent.
* stdio/printf_fp.c (NDEBUG): Define this to disable assert.
Don't include <stdarg.h>.
(__printf_fp): Last arg ARGS is now `const void **const';
dereference ARGS[0] instead of using va_arg.
* locale/setlocale.c: In LC_ALL case, initialize CATEGORY before
loop to install data.
* locale/loadlocale.c (_nl_category_num_items): Use _NL_ITEM_INDEX
to extract number from item code.
(_nl_load_locale): Close the descriptor when finished.
* malloc/realloc.c (_realloc_internal): Call _malloc_internal in
place of malloc.
* time/tzfile.c (__tzfile_default): Initialize RULE_STDOFF to zero.
1995-03-16 05:32:45 +00:00
|
|
|
"addl $12, %esp\n" /* Pop its args. */
|
|
|
|
/* The word at the top of stack is &__sigreturn; following are a dummy
|
|
|
|
word to fill the slot for the address for __sigreturn to return to,
|
|
|
|
and a copy of SCP for __sigreturn's argument. "Return" to calling
|
|
|
|
__sigreturn (SCP); this call never returns. */
|
|
|
|
"ret");
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1999-07-28 18:19:47 +00:00
|
|
|
asm ("firewall:\n"
|
|
|
|
"hlt");
|