changeset 238:ee09240e2d36

Disable interrupts on all but the console port.
author gthomas
date Thu, 11 Jul 2002 16:39:47 +0000
parents 2b28abd155c7
children 8e901b135fea
files packages/redboot/current/ChangeLog packages/redboot/current/src/io.c
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/redboot/current/ChangeLog
+++ b/packages/redboot/current/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-11  Gary Thomas  <gary@chez-thomas.org>
+
+	* src/io.c (mon_read_char_with_timeout): Ensure interrupts are
+	disabled on all I/O channels, except for the current console.
+	This is done when selecting a console, as this process causes
+	the interrupt state to be inherited from the current console.
+
 2002-07-09  Gary Thomas  <gary@chez-thomas.org>
 2002-07-09  Grant Edwards <grante@visi.com>
 
--- a/packages/redboot/current/src/io.c
+++ b/packages/redboot/current/src/io.c
@@ -172,7 +172,7 @@ mon_read_char_with_timeout(char *c)
 #ifdef CYGPKG_REDBOOT_ANY_CONSOLE
     if (!console_selected) {
         int cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
-        int i, tot;
+        int i, j, tot;
         // Try input from all channels
         tot = 0;
         while (tot < _mon_timeout) {
@@ -186,6 +186,15 @@ mon_read_char_with_timeout(char *c)
                         // Don't chose this unless real data have arrived
                         console_selected = true;
                         CYGACC_CALL_IF_SET_DEBUG_COMM(i);
+                        // Disable interrupts on all channels but this one
+                        for (j = 0;  j < CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS;  j++) {
+                            if (i != j) {
+                                CYGACC_CALL_IF_SET_CONSOLE_COMM(j);
+                                __chan = CYGACC_CALL_IF_CONSOLE_PROCS();
+                                CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_IRQ_DISABLE);
+                            }
+                        }
+                        CYGACC_CALL_IF_SET_CONSOLE_COMM(i);
                         return res;
                     }
                 }