Linux-kernel mailing list archive 2000-32,: [patch] 2.4.0-test5: Magic SysRq fixes for no VT

# [patch] 2.4.0-test5: Magic SysRq fixes for no VT

Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Mon, 7 Aug 2000 18:03:56 +0200 (MET DST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jeff V. Merkey: "Re: 64 bit divide/mod in 2.4.0-test5"
- Previous message: Karl-Heinz Herrmann: "Re: fsck & fstab"

Hi,

The magic SysRq hack cannot be compiled-in when the virtual terminal
driver is not build. If such a configuration is made (e.g. a serial
console only), there is a linking error. This is due to the sysrq_enabled
variable being defined in a wrong file.

The following patch fixes this issue. It also fixes a small problem for
the 8250-based serial console which ignores the setting of sysrq_enabled.
I believe this fix should go into 2.4.0 -- a linking error is certainly
fatal and changes involved are obviously harmless to Linux's stability.

Maciej

    --
    +  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
    +--------------------------------------------------------------+
    +        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

    diff -u --recursive --new-file linux-mips-2.4.0-test5-20000731.macro/drivers/char/keyboard.c linux-mips-2.4.0-test5-20000731/drivers/char/keyboard.c
    --- linux-mips-2.4.0-test5-20000731.macro/drivers/char/keyboard.c	Thu Feb 24 05:26:36 2000
    +++ linux-mips-2.4.0-test5-20000731/drivers/char/keyboard.c	Sun Aug  6 09:15:46 2000
    @@ -158,7 +158,6 @@

     #ifdef CONFIG_MAGIC_SYSRQ
     static int sysrq_pressed;
    -int sysrq_enabled = 1;
     #endif

     static struct pm_dev *pm_kbd = NULL;
    diff -u --recursive --new-file linux-mips-2.4.0-test5-20000731.macro/drivers/char/serial.c linux-mips-2.4.0-test5-20000731/drivers/char/serial.c
    --- linux-mips-2.4.0-test5-20000731.macro/drivers/char/serial.c	Mon Jul 24 04:26:06 2000
    +++ linux-mips-2.4.0-test5-20000731/drivers/char/serial.c	Sun Aug  6 09:21:03 2000
    @@ -597,7 +597,8 @@
     				printk("handling break....");
     #endif
     #if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) && !defined(MODULE)
    -				if (info->line == sercons.index) {
    +				if (info->line == sercons.index
    +				    && sysrq_enabled) {
     					if (!break_pressed) {
     						break_pressed = jiffies;
     						goto ignore_char;
    diff -u --recursive --new-file linux-mips-2.4.0-test5-20000731.macro/drivers/char/sysrq.c linux-mips-2.4.0-test5-20000731/drivers/char/sysrq.c
    --- linux-mips-2.4.0-test5-20000731.macro/drivers/char/sysrq.c	Tue Mar 28 04:26:29 2000
    +++ linux-mips-2.4.0-test5-20000731/drivers/char/sysrq.c	Sun Aug  6 09:17:58 2000
    @@ -33,6 +33,8 @@
     /* Machine specific power off function */
     void (*sysrq_power_off)(void) = NULL;

    +int sysrq_enabled = 1;
    +
     EXPORT_SYMBOL(sysrq_power_off);

     /* Send a signal to all user processes */
    diff -u --recursive --new-file linux-mips-2.4.0-test5-20000731.macro/drivers/sbus/char/sunkbd.c linux-mips-2.4.0-test5-20000731/drivers/sbus/char/sunkbd.c
    --- linux-mips-2.4.0-test5-20000731.macro/drivers/sbus/char/sunkbd.c	Sat Jul 15 04:26:34 2000
    +++ linux-mips-2.4.0-test5-20000731/drivers/sbus/char/sunkbd.c	Sun Aug  6 09:16:21 2000
    @@ -177,9 +177,6 @@
     static struct pt_regs * pt_regs;

     #ifdef CONFIG_MAGIC_SYSRQ
    -#ifndef CONFIG_PCI
    -int sysrq_enabled = 1;
    -#endif
     unsigned char sun_sysrq_xlate[128] =
     	"\0\0\0\0\0\201\202\212\203\213\204\214\205\0\206\0"	/* 0x00 - 0x0f */
     	"\207\210\211\0\0\0\0\0\0\0\0\0\0\03312"		/* 0x10 - 0x1f */

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

- Next message: Jeff V. Merkey: "Re: 64 bit divide/mod in 2.4.0-test5"
- Previous message: Karl-Heinz Herrmann: "Re: fsck & fstab"