Re: [Kgdb-bugreport] [KGDB PATCH][3/7] SysRq-G

Amit S. Kale
2004-03-01T10:05:58Z

On Saturday 28 Feb 2004 4:19 am, George Anzinger wrote:
> There may be a need to change the keyboard driver for this. I have had
> trouble with it in the past. Seems it doesn't like to not get control back
> for a very long time. I am not sure what the problem is but, be warned.

Let's put it in core instead of core-lite, then,

-Amit

>
> -g
>
> Tom Rini wrote:
> > Hello. The following adds SysRq-G. This is always configured in on
> > CONFIG_KGDB && CONFIG_SYSRQ.
> >
> > diff -zrupN linux-2.6.3+config+serial/drivers/char/sysrq.c
> > linux-2.6.3+config+serial+sysrq+arch_hooks/drivers/char/sysrq.c ---
> > linux-2.6.3+config+serial/drivers/char/sysrq.c 2004-02-27
> > 12:06:22.000000000 -0700 +++
> > linux-2.6.3+config+serial+sysrq+arch_hooks/drivers/char/sysrq.c 2004-02-2
> >7 12:16:14.000000000 -0700 @@ -31,6 +31,7 @@
> > #include <linux/suspend.h>
> > #include <linux/writeback.h>
> > #include <linux/buffer_head.h> /* for fsync_bdev() */
> > +#include <linux/kgdb.h> /* for breakpoint() */
> >
> > #include <linux/spinlock.h>
> >
> > @@ -44,6 +45,25 @@ int sysrq_enabled = 1;
> > /* Machine specific power off function */
> > void (*sysrq_power_off)(void);
> >
> > +/* Make a breakpoint() right now. */
> > +#ifdef CONFIG_KGDB
> > +#define GDB_OP &kgdb_op
> > +static void kgdb_sysrq(int key, struct pt_regs *pt_regs, struct
> > tty_struct *tty) +{
> > + printk("kgdb sysrq\n");
> > + breakpoint();
> > +}
> > +
> > +static struct sysrq_key_op kgdb_op = {
> > + .handler = kgdb_sysrq,
> > + .help_msg = "kGdb|Fgdb",
> > + .action_msg = "Debug breakpoint\n",
> > +};
> > +
> > +#else
> > +#define GDB_OP NULL
> > +#endif
> > +
> > /* Loglevel sysrq handler */
> > static void sysrq_handle_loglevel(int key, struct pt_regs *pt_regs,
> > struct tty_struct *tty)
> > @@ -239,7 +259,7 @@ static struct sysrq_key_op *sysrq_key_ta
> > /* d */ NULL,
> > /* e */ &sysrq_term_op,
> > /* f */ NULL,
> > -/* g */ NULL,
> > +/* g */ GDB_OP,
> > /* h */ NULL,
> > /* i */ &sysrq_kill_op,
> > /* j */ NULL,