On Fri, 27 Feb 2004 00:41:40 -0800 (PST), 
Shantanu Gogate <[EMAIL PROTECTED]> wrote:
>putting debug messages around 'kdb_local_arch_setup' revealed that the function never 
>returned !
>why ???

kdb_local_arch_setup and kdba_local_arch_cleanup try to reset the
keyboard to reduce a problem of frozen keyboards.  They assume a
standard keyboard, I am guessing that your headless board does not have
a standard keyboard controller.  In later versions of kdb (v4.0 is
pretty old), those functions only reset the keyboard if CONFIG_VT is
defined.  v4.3 code looks like this.

/* 
 * On some Compaq Deskpro's, there is a keyboard freeze many times after
 * exiting from the kdb. As kdb's keyboard handler is not interrupt-driven and 
 * uses a polled interface, it makes more sense to disable motherboard keyboard
 * controller's OBF interrupts during kdb's polling.In case, of interrupts 
 * remaining enabled during kdb's polling, it may cause un-necessary 
 * interrupts being signalled during keypresses, which are also sometimes seen
 * as spurious interrupts after exiting from kdb. This hack to disable OBF
 * interrupts before entry to kdb and re-enabling them at kdb exit point also 
 * solves the keyboard freeze issue. These functions are called from
 * kdb_local(), hence these are arch. specific setup and cleanup functions
 * executing only on the local processor - [EMAIL PROTECTED] 
 */

void kdba_local_arch_setup(void)
{
#ifdef  CONFIG_VT_CONSOLE
        unsigned char c;

        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_command(KBD_CCMD_READ_MODE);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        while ( !(kbd_read_status() & KBD_STAT_OBF) );
        c = kbd_read_input();
        c &= ~KBD_MODE_KBD_INT;
        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_command(KBD_CCMD_WRITE_MODE);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_output(c);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        mdelay(1);
#endif  /* CONFIG_VT_CONSOLE */
}

void kdba_local_arch_cleanup(void)
{
#ifdef  CONFIG_VT_CONSOLE
        unsigned char c;

        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_command(KBD_CCMD_READ_MODE);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        while ( !(kbd_read_status() & KBD_STAT_OBF) );
        c = kbd_read_input();
        c |= KBD_MODE_KBD_INT;
        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_command(KBD_CCMD_WRITE_MODE);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        kbd_write_output(c);
        mdelay(1);
        while (kbd_read_status() & KBD_STAT_IBF);
        mdelay(1);
#endif  /* CONFIG_VT_CONSOLE */
}

---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.

Reply via email to