From: Chris Hanson Date: Tue, 4 Feb 1992 04:37:26 +0000 (+0000) Subject: This microcode cannot be used with Edwin versions prior to 3.65. X-Git-Tag: 20090517-FFI~9874 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fa6e15d559eda20485b19d241b6456633bff1692;p=mit-scheme.git This microcode cannot be used with Edwin versions prior to 3.65. The implementation of UX_select has been changed to return to the caller when a Scheme interrupt needs servicing, rather than just servicing the interrupt and going back into the select. This gives Scheme code a chance to run and do something useful. In addition, the primitives CHANNEL-SELECT-THEN-READ and X-DISPLAY-PROCESS-EVENTS have been changed to return different event codes for the "other output" and "process status change" events. This allows the event-handling code to go directly to the handler, rather than trying to figure out which one occurred. --- diff --git a/v7/src/microcode/prosio.c b/v7/src/microcode/prosio.c index c5e4b55d8..5547a905a 100644 --- a/v7/src/microcode/prosio.c +++ b/v7/src/microcode/prosio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosio.c,v 1.6 1991/03/14 04:22:45 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prosio.c,v 1.7 1992/02/04 04:36:56 cph Exp $ -Copyright (c) 1987-91 Massachusetts Institute of Technology +Copyright (c) 1987-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -233,8 +233,10 @@ DEFINE_PRIMITIVE ("CHANNEL-UNREGISTER", Prim_channel_unregister, 1, 1, DEFINE_PRIMITIVE ("CHANNEL-SELECT-THEN-READ", Prim_channel_select_then_read, 4, 4, "Like CHANNEL-READ, but also watches registered input channels.\n\ -If there is no input on CHANNEL, but there is input on some other registered\n\ -channel or some subprocess status changes, this procedure returns #T.") +If there is no input on CHANNEL, returns #F.\n\ +If there is input on some other registered channel, returns -2.\n\ +If the status of some subprocess changes, returns -3.\n\ +If an interrupt occurs during the read, returns -4.") { PRIMITIVE_HEADER (4); CHECK_ARG (2, STRING_P); @@ -247,11 +249,6 @@ channel or some subprocess status changes, this procedure returns #T.") (OS_channel_select_then_read ((arg_channel (1)), (STRING_LOC (buffer, start)), (end - start))); - PRIMITIVE_RETURN - ((nread == -2) - ? SHARP_T - : (nread < 0) - ? SHARP_F - : (long_to_integer (nread))); + PRIMITIVE_RETURN ((nread == (-1)) ? SHARP_F : (long_to_integer (nread))); } } diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index 011b38e59..51fcd75fc 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.17 1992/01/20 18:52:26 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.18 1992/02/04 04:37:03 cph Exp $ -Copyright (c) 1990-1992 Massachusetts Institute of Technology +Copyright (c) 1990-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -406,9 +406,11 @@ DEFUN (UX_select_input, (fd, blockp), int fd AND int blockp) error_system_call (errno, syscall_select); else if (status_change_p) return (select_input_process_status); - deliver_pending_interrupts (); + if (pending_interrupts_p ()) + return (select_input_interrupt); } #else + error_system_call (ENOSYS, syscall_select); return (select_input_argument); #endif } @@ -419,16 +421,17 @@ DEFUN (OS_channel_select_then_read, (channel, buffer, nbytes), PTR buffer AND size_t nbytes) { -#ifdef HAVE_SELECT switch (UX_select_input ((CHANNEL_DESCRIPTOR (channel)), (! (CHANNEL_NONBLOCKING (channel))))) { case select_input_none: return (-1); case select_input_other: - case select_input_process_status: return (-2); + case select_input_process_status: + return (-3); + case select_input_interrupt: + return (-4); } -#endif return (OS_channel_read (channel, buffer, nbytes)); } diff --git a/v7/src/microcode/uxselect.h b/v7/src/microcode/uxselect.h index 5c6f5a235..121a8cbfb 100644 --- a/v7/src/microcode/uxselect.h +++ b/v7/src/microcode/uxselect.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxselect.h,v 1.1 1991/06/22 19:09:15 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxselect.h,v 1.2 1992/02/04 04:37:11 cph Exp $ -Copyright (c) 1991 Massachusetts Institute of Technology +Copyright (c) 1991-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -40,7 +40,8 @@ enum select_input select_input_argument, select_input_other, select_input_none, - select_input_process_status + select_input_process_status, + select_input_interrupt }; extern CONST int UX_have_select_p; diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index f89649000..7fe476a2e 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.106 1992/02/04 00:43:55 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.107 1992/02/04 04:37:16 cph Exp $ Copyright (c) 1988-92 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 106 +#define SUBVERSION 107 #endif diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index 00f191afe..1e0426838 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.30 1992/01/22 23:13:31 arthur Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.31 1992/02/04 04:37:26 cph Exp $ -Copyright (c) 1989-91 Massachusetts Institute of Technology +Copyright (c) 1989-92 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -779,8 +779,11 @@ DEFUN (xd_process_events, (xd, non_block_p), case select_input_none: return (SHARP_F); case select_input_other: + return (LONG_TO_FIXNUM (-2)); case select_input_process_status: - return (SHARP_T); + return (LONG_TO_FIXNUM (-3)); + case select_input_interrupt: + return (LONG_TO_FIXNUM (-4)); case select_input_argument: events_queued = (XEventsQueued (display, QueuedAfterReading)); continue; diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index ec4d44ee7..4b65a0af5 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.106 1992/02/04 00:43:55 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.107 1992/02/04 04:37:16 cph Exp $ Copyright (c) 1988-92 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 106 +#define SUBVERSION 107 #endif