* environ.cc: Eliminate oldstack CYGWIN option.

* exceptions.cc (sfta): Eliminate obsolete function.
(sgmb): Eliminate obsolete function.
(class stack_info): Remove MS method for walking the stack.
(stack_info::init): Just initialize required fields.
(stack_info::brute_force): Rename to stack_info::walk.
(handle_exceptions): Pass derived frame pointer to sig_send.
(interrupt_setup): Clear saved frame pointer here.
(interrupt_on_return): thestack is no longer a pointer.
(call_handler): Accept a flag to indicate when a signal was sent from other
than the main thread.  Use saved frame pointer for determining where to place
signal handler call.
(sig_handle): Accept "nonmain" argument.  Pass it to call_handler.
* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Change
debugging output slightly.
* (fhandler_tty_common::__release_output_mutex): Ditto.
(fhandler_tty_slave::read): Fix a comment, remove a goto.
* sigproc.cc (sig_send): Accept an optional frame pointer argument for use when
suspending the main process.  sigcomplete_main is an autoreset event now.  Save
frame pointer for non-main operation.
(wait_sig): Make sigcomplete_main an autoreset event.  Eliminate NOSIGQUEUE.
Pass rc to sig_handle to signify if this was a nonmain process.
* sigproc.h: Reflect change to sig_send argument.
* syscalls.cc (swab): Eliminate swab function since it is now available in
newlib.
* winsup.h (signal_dispatch): Change CONTEXT cx to DWORD ebp.
This commit is contained in:
Christopher Faylor
2000-03-09 21:04:05 +00:00
parent 3072163c0f
commit af1dc7ccea
8 changed files with 132 additions and 181 deletions

View File

@@ -110,7 +110,10 @@ fhandler_tty_common::__acquire_output_mutex (const char *fn, int ln,
DWORD res = WaitForSingleObject (output_mutex, ms);
if (res == WAIT_OBJECT_0)
{
#ifdef DEBUGGING
#ifndef DEBUGGING
if (strace.active)
strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex: acquired", fn, ln, res);
#else
ostack[osi].fn = fn;
ostack[osi].ln = ln;
ostack[osi].tname = threadname (0, 0);
@@ -118,8 +121,6 @@ fhandler_tty_common::__acquire_output_mutex (const char *fn, int ln,
osi++;
#endif
}
if (strace.active)
strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex: acquired", fn, ln, res);
return res;
}
@@ -128,7 +129,10 @@ fhandler_tty_common::__release_output_mutex (const char *fn, int ln)
{
if (ReleaseMutex (output_mutex))
{
#ifdef DEBUGGING
#ifndef DEBUGGING
if (strace.active)
strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex released", fn, ln);
#else
if (osi > 0)
osi--;
termios_printf ("released at %s:%d, osi %d", fn, ln, osi);
@@ -136,8 +140,6 @@ fhandler_tty_common::__release_output_mutex (const char *fn, int ln)
ostack[osi].ln = -ln;
#endif
}
if (strace.active)
strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex released", fn, ln);
}
#define acquire_output_mutex(ms) \
@@ -288,7 +290,10 @@ again:
}
if (get_ttyp ()->OutputStopped)
WaitForSingleObject (restart_output_event, INFINITE);
{
termios_printf ("waiting for restart_output_event");
WaitForSingleObject (restart_output_event, INFINITE);
}
if (get_ttyp ()->ti.c_oflag & OPOST) // post-process output
{
@@ -575,7 +580,6 @@ fhandler_tty_slave::read (void *ptr, size_t len)
while (len)
{
wait:
termios_printf ("reading %d bytes (vtime %d)",
min ((unsigned) vmin, min (len, sizeof (buf))), vtime);
if (ReadFile (get_handle (), (unsigned *) buf,
@@ -614,7 +618,7 @@ fhandler_tty_slave::read (void *ptr, size_t len)
if (get_flags () & (O_NONBLOCK | O_NDELAY))
break;
/* We can't enter to blocking Readfile - signals will be lost!
/* We can't enter the blocking Readfile as signals will be lost.
* So, poll the pipe for data.
* FIXME: try to avoid polling...
* FIXME: Current EINTR scheme does not take vmin/vtime into account.
@@ -625,7 +629,7 @@ fhandler_tty_slave::read (void *ptr, size_t len)
if (vmin == 0 && vtime == 0)
return 0; // min = 0, time = 0
if (vtime == 0)
goto wait; // min > 0, time = 0
continue; // min > 0, time = 0
while (vtime--)
{
PeekNamedPipe (get_handle (), NULL, 0, NULL, &n, NULL);