OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [char/] [sysrq.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*****************************************************************************/
2
 
3
/*
4
 *      linux/drivers/char/sysrq.c
5
 *
6
 *      Copyright (C) 1999, Greg Ungerer (gerg@moreton.com.au)
7
 *
8
 *      Process System Request Magic Keys. Used for debugging...
9
 */
10
 
11
/*****************************************************************************/
12
 
13
/*
14
 *      Key that marks start of magic key sequence.
15
 *      Default is CTRL-X. When using magic system request key mode,
16
 *      any of these characters will disappear from the data stream.
17
 *      So choose carefully!
18
 */
19
int magic_sysrq_master = 24;
20
 
21
/*
22
 *      Mode we are in. Is next char expected to be a command.
23
 */
24
int magic_sysrq_mode = 0;
25
 
26
/*****************************************************************************/
27
 
28
int magic_sysrq_key(int ch)
29
{
30
        if (magic_sysrq_mode == 0) {
31
                if (ch == magic_sysrq_master) {
32
                        magic_sysrq_mode++;
33
                        return(1);
34
                }
35
                return(0);
36
        }
37
 
38
        switch (ch) {
39
        case 'a':
40
                printk("Show Free Areas:\n");
41
                show_free_areas();
42
                break;
43
        case 'b':
44
                printk("Show Buffers:\n");
45
                show_buffers();
46
                break;
47
#if 0
48
        case 'r':
49
                printk("Show Registers:\n");
50
                if (pt_regs)
51
                        show_regs(pt_regs);
52
                break;
53
#endif
54
        case 't':
55
                printk("Show State:\n");
56
                show_state();
57
                break;
58
        case 'm':
59
                printk("Show Memory:\n");
60
                show_mem();
61
                break;
62
        case 'n':
63
                printk("Show Net Buffers:\n");
64
                show_net_buffers();
65
                break;
66
        default:
67
                /* Unkown command?? */
68
                break;
69
        }
70
 
71
        magic_sysrq_mode = 0;
72
        return(1);
73
}
74
 
75
/*****************************************************************************/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.