From: Guillermo J. Rozas Date: Sun, 18 Jul 1993 22:25:57 +0000 (+0000) Subject: Allow DOS and NT to share bands. X-Git-Tag: 20090517-FFI~8188 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e7fd2fb6d27fccddd791145192d3725578813791;p=mit-scheme.git Allow DOS and NT to share bands. --- diff --git a/v7/src/microcode/dosconio.c b/v7/src/microcode/dosconio.c index bbe554814..d75f08b37 100644 --- a/v7/src/microcode/dosconio.c +++ b/v7/src/microcode/dosconio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: dosconio.c,v 1.10 1993/07/16 20:56:45 gjr Exp $ +$Id: dosconio.c,v 1.11 1993/07/18 22:25:57 gjr Exp $ Copyright (c) 1992-1993 Massachusetts Institute of Technology @@ -262,20 +262,35 @@ DEFUN_VOID (DOS_initialize_conio) extern void EXFUN (DOS_initialize_fov, (SCHEME_OBJECT)); +/* This sets up the interrupt handlers for both DOS and NT, + so that bands can be shared. + */ + void DEFUN (DOS_initialize_fov, (fov), SCHEME_OBJECT fov) { - int in; - SCHEME_OBJECT iv, imv, prim; + int ctr, in; + SCHEME_OBJECT iv, imv, prim, mask; extern SCHEME_OBJECT EXFUN (make_primitive, (char *)); + static int interrupt_numbers[] = { + Global_GC_Level, + Global_1_Level + }; + static long interrupt_masks[] = { + 0, /* No interrupts allowed */ + (INT_Stack_Overflow | INT_Global_GC | INT_GC) + }; - in = Global_GC_Level; - prim = (make_primitive ("DOS-HIGH-PRIORITY-TIMER-INTERRUPT")); iv = (FAST_VECTOR_REF (fov, System_Interrupt_Vector)); - VECTOR_SET (iv, in, prim); imv = (FAST_VECTOR_REF (fov, FIXOBJ_INTERRUPT_MASK_VECTOR)); - /* No interrupts allowed while processing this interrupt. */ - VECTOR_SET (imv, in, (long_to_integer (0))); + prim = (make_primitive ("MICROCODE-POLL-INTERRUPT-HANDLER")); + + for (ctr = 0; ctr < ((sizeof (interrupt_numbers)) / (sizeof (int))); ctr++) + { + in = interrupt_numbers[ctr]; + VECTOR_SET (iv, in, prim); + VECTOR_SET (imv, in, (long_to_integer (interrupt_masks[ctr]))); + } return; } @@ -359,8 +374,8 @@ DEFUN (console_read, (buffer, nbytes, buffered_p, blocking_p, intrpt_p), return (0); } -DEFINE_PRIMITIVE ("DOS-HIGH-PRIORITY-TIMER-INTERRUPT", Prim_dos_high_priority_timer, 2, 2, - "DOS High-priority timer interrupt handler.") +DEFINE_PRIMITIVE ("MICROCODE-POLL-INTERRUPT-HANDLER", Prim_dos_high_priority_timer, 2, 2, + "DOS Polling interrupt handler---timer and keyboard.") { extern void EXFUN (dos_process_timer_interrupt, (void)); PRIMITIVE_HEADER (2); diff --git a/v7/src/microcode/ntgui.c b/v7/src/microcode/ntgui.c index 8fc041419..93d7e5dfd 100644 --- a/v7/src/microcode/ntgui.c +++ b/v7/src/microcode/ntgui.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ntgui.c,v 1.2 1993/06/24 02:02:05 gjr Exp $ +$Id: ntgui.c,v 1.3 1993/07/18 22:25:50 gjr Exp $ Copyright (c) 1993 Massachusetts Institute of Technology @@ -184,7 +184,7 @@ DEFUN_VOID (nt_gui_default_poll) } -DEFINE_PRIMITIVE ("NT-DEFAULT-POLL-GUI-INTERRUPT", +DEFINE_PRIMITIVE ("MICROCODE-POLL-INTERRUPT-HANDLER", Prim_nt_default_poll_gui_interrupt, 2, 2, "NT High-priority timer interrupt handler for Windows I/O.") { diff --git a/v7/src/microcode/ntsig.c b/v7/src/microcode/ntsig.c index 360e6c480..ff7753ac3 100644 --- a/v7/src/microcode/ntsig.c +++ b/v7/src/microcode/ntsig.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: ntsig.c,v 1.3 1993/06/24 02:08:32 gjr Exp $ +$Id: ntsig.c,v 1.4 1993/07/18 22:25:44 gjr Exp $ Copyright (c) 1992-1993 Massachusetts Institute of Technology @@ -1282,22 +1282,37 @@ DEFUN_VOID (install_timer) return 0; } - +/* This sets up the interrupt handlers for both DOS and NT, + so that bands can be shared. + */ void DEFUN (NT_initialize_fov, (fov), SCHEME_OBJECT fov) { + int ctr, in; + SCHEME_OBJECT iv, imv, prim, mask; extern SCHEME_OBJECT EXFUN (make_primitive, (char *)); - SCHEME_OBJECT iv, prim; - - prim = make_primitive ("NT-DEFAULT-POLL-GUI-INTERRUPT"); - iv = FAST_VECTOR_REF (fov, System_Interrupt_Vector); -// VECTOR_SET (iv, Global_GC_Level, prim); - VECTOR_SET (iv, Global_1_Level, prim); + static int interrupt_numbers[] = { + Global_GC_Level, + Global_1_Level + }; + static long interrupt_masks[] = { + 0, /* No interrupts allowed */ + (INT_Stack_Overflow | INT_Global_GC | INT_GC) + }; + + iv = (FAST_VECTOR_REF (fov, System_Interrupt_Vector)); + imv = (FAST_VECTOR_REF (fov, FIXOBJ_INTERRUPT_MASK_VECTOR)); + prim = (make_primitive ("MICROCODE-POLL-INTERRUPT-HANDLER")); + + for (ctr = 0; ctr < ((sizeof (interrupt_numbers)) / (sizeof (int))); ctr++) + { + in = interrupt_numbers[ctr]; + VECTOR_SET (iv, in, prim); + VECTOR_SET (imv, in, (long_to_integer (interrupt_masks[ctr]))); + } return; } - - void DEFUN_VOID (NT_initialize_signals) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 0beb1ac75..c2f483073 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.184 1993/07/07 20:01:39 gjr Exp $ +$Id: runtime.pkg,v 14.185 1993/07/18 22:25:37 gjr Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -1508,17 +1508,19 @@ MIT in each case. |# (else)) (initialization (initialize-package!))) +;; DOS and NT pathanme packages present in both to allow band sharing. + (define-package (runtime pathname dos) (parent (runtime pathname)) (file-case os-type - ((dos) "dospth") + ((dos nt) "dospth") (else)) (initialization (initialize-package!))) (define-package (runtime pathname nt) (parent (runtime pathname)) (file-case os-type - ((nt) "ntpth") + ((nt dos) "ntpth") (else)) (initialization (initialize-package!))) diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index 0beb1ac75..c2f483073 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.184 1993/07/07 20:01:39 gjr Exp $ +$Id: runtime.pkg,v 14.185 1993/07/18 22:25:37 gjr Exp $ Copyright (c) 1988-1993 Massachusetts Institute of Technology @@ -1508,17 +1508,19 @@ MIT in each case. |# (else)) (initialization (initialize-package!))) +;; DOS and NT pathanme packages present in both to allow band sharing. + (define-package (runtime pathname dos) (parent (runtime pathname)) (file-case os-type - ((dos) "dospth") + ((dos nt) "dospth") (else)) (initialization (initialize-package!))) (define-package (runtime pathname nt) (parent (runtime pathname)) (file-case os-type - ((nt) "ntpth") + ((nt dos) "ntpth") (else)) (initialization (initialize-package!)))