Commit 484f2a9c authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linuxconsole.bkbits.net:8080/dev

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 866aa8f7 e57e9f5f
......@@ -923,7 +923,7 @@ static void apm_power_off(void)
*/
static void handle_poweroff (int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty)
struct tty_struct *tty)
{
apm_power_off();
}
......
......@@ -98,7 +98,7 @@ static unsigned long chrp_find_phys_io_base(void)
#ifdef CONFIG_MAGIC_SYSRQ
static void sysrq_handle_xmon(int key, struct pt_regs *regs,
struct kbd_struct *kbd, struct tty_struct *tty)
struct tty_struct *tty)
{
xmon(regs);
}
......
......@@ -52,7 +52,7 @@ void buf_access(void)
}
#endif
static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, struct kbd_struct *kbd, struct tty_struct *tty)
static void sysrq_handle_xmon(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
{
xmon(pt_regs);
}
......
......@@ -1165,7 +1165,7 @@ acpi_system_remove_fs (
/* Simple wrapper calling power down function. */
static void acpi_sysrq_power_off(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty)
struct tty_struct *tty)
{
acpi_power_off();
}
......
......@@ -126,6 +126,7 @@ const struct consw *conswitchp;
#define DEFAULT_BELL_DURATION (HZ/8)
extern void vcs_make_devfs (unsigned int index, int unregister);
extern void console_map_init(void);
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
......@@ -2381,6 +2382,7 @@ static int con_open(struct tty_struct *tty, struct file * filp)
vt_cons[currcons]->vc_num = currcons;
tty->driver_data = vt_cons[currcons];
vc_cons[currcons].d->vc_tty = tty;
if (!tty->winsize.ws_row && !tty->winsize.ws_col) {
tty->winsize.ws_row = video_num_lines;
......@@ -2445,42 +2447,6 @@ void __init con_init(void)
return;
}
memset(&console_driver, 0, sizeof(struct tty_driver));
console_driver.magic = TTY_DRIVER_MAGIC;
console_driver.name = "vc/%d";
console_driver.name_base = 1;
console_driver.major = TTY_MAJOR;
console_driver.minor_start = 1;
console_driver.num = MAX_NR_CONSOLES;
console_driver.type = TTY_DRIVER_TYPE_CONSOLE;
console_driver.init_termios = tty_std_termios;
console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
/* Tell tty_register_driver() to skip consoles because they are
* registered before kmalloc() is ready. We'll patch them in later.
* See comments at console_init(); see also con_init_devfs().
*/
console_driver.flags |= TTY_DRIVER_NO_DEVFS;
console_driver.refcount = &console_refcount;
console_driver.table = console_table;
console_driver.termios = console_termios;
console_driver.termios_locked = console_termios_locked;
console_driver.open = con_open;
console_driver.close = con_close;
console_driver.write = con_write;
console_driver.write_room = con_write_room;
console_driver.put_char = con_put_char;
console_driver.flush_chars = con_flush_chars;
console_driver.chars_in_buffer = con_chars_in_buffer;
console_driver.ioctl = vt_ioctl;
console_driver.stop = con_stop;
console_driver.start = con_start;
console_driver.throttle = con_throttle;
console_driver.unthrottle = con_unthrottle;
if (tty_register_driver(&console_driver))
panic("Couldn't register console driver\n");
init_timer(&console_timer);
console_timer.function = blank_screen;
if (blankinterval) {
......@@ -2519,6 +2485,50 @@ void __init con_init(void)
#endif
}
int __init vty_init(void)
{
memset(&console_driver, 0, sizeof(struct tty_driver));
console_driver.magic = TTY_DRIVER_MAGIC;
console_driver.name = "vc/%d";
console_driver.name_base = 1;
console_driver.major = TTY_MAJOR;
console_driver.minor_start = 1;
console_driver.num = MAX_NR_CONSOLES;
console_driver.type = TTY_DRIVER_TYPE_CONSOLE;
console_driver.init_termios = tty_std_termios;
console_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
/* Tell tty_register_driver() to skip consoles because they are
* registered before kmalloc() is ready. We'll patch them in later.
* See comments at console_init(); see also con_init_devfs().
*/
console_driver.flags |= TTY_DRIVER_NO_DEVFS;
console_driver.refcount = &console_refcount;
console_driver.table = console_table;
console_driver.termios = console_termios;
console_driver.termios_locked = console_termios_locked;
console_driver.open = con_open;
console_driver.close = con_close;
console_driver.write = con_write;
console_driver.write_room = con_write_room;
console_driver.put_char = con_put_char;
console_driver.flush_chars = con_flush_chars;
console_driver.chars_in_buffer = con_chars_in_buffer;
console_driver.ioctl = vt_ioctl;
console_driver.stop = con_stop;
console_driver.start = con_start;
console_driver.throttle = con_throttle;
console_driver.unthrottle = con_unthrottle;
if (tty_register_driver(&console_driver))
panic("Couldn't register console driver\n");
kbd_init();
console_map_init();
vcs_init();
return 0;
}
#ifndef VT_SINGLE_DRIVER
static void clear_buffer_attributes(int currcons)
......
This diff is collapsed.
......@@ -45,7 +45,8 @@ void (*sysrq_power_off)(void);
/* Loglevel sysrq handler */
static void sysrq_handle_loglevel(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
int i;
i = key - '0';
console_loglevel = 7;
......@@ -62,7 +63,8 @@ static struct sysrq_key_op sysrq_loglevel_op = {
/* SAK sysrq handler */
#ifdef CONFIG_VT
static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
if (tty)
do_SAK(tty);
reset_vc(fg_console);
......@@ -77,7 +79,10 @@ static struct sysrq_key_op sysrq_SAK_op = {
/* unraw sysrq handler */
static void sysrq_handle_unraw(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
struct kbd_struct *kbd = &kbd_table[fg_console];
if (kbd)
kbd->kbdmode = VC_XLATE;
}
......@@ -90,7 +95,8 @@ static struct sysrq_key_op sysrq_unraw_op = {
/* reboot sysrq handler */
static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
machine_restart(NULL);
}
static struct sysrq_key_op sysrq_reboot_op = {
......@@ -218,7 +224,8 @@ void do_emergency_sync(void) {
}
static void sysrq_handle_sync(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
emergency_sync_scheduled = EMERG_SYNC;
wakeup_bdflush();
}
......@@ -229,7 +236,8 @@ static struct sysrq_key_op sysrq_sync_op = {
};
static void sysrq_handle_mountro(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
emergency_sync_scheduled = EMERG_REMOUNT;
wakeup_bdflush();
}
......@@ -245,7 +253,8 @@ static struct sysrq_key_op sysrq_mountro_op = {
/* SHOW SYSRQ HANDLERS BLOCK */
static void sysrq_handle_showregs(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
if (pt_regs)
show_regs(pt_regs);
}
......@@ -257,7 +266,8 @@ static struct sysrq_key_op sysrq_showregs_op = {
static void sysrq_handle_showstate(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
show_state();
}
static struct sysrq_key_op sysrq_showstate_op = {
......@@ -268,7 +278,8 @@ static struct sysrq_key_op sysrq_showstate_op = {
static void sysrq_handle_showmem(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
show_mem();
}
static struct sysrq_key_op sysrq_showmem_op = {
......@@ -296,7 +307,8 @@ static void send_sig_all(int sig)
}
static void sysrq_handle_term(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
send_sig_all(SIGTERM);
console_loglevel = 8;
}
......@@ -307,7 +319,8 @@ static struct sysrq_key_op sysrq_term_op = {
};
static void sysrq_handle_kill(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
send_sig_all(SIGKILL);
console_loglevel = 8;
}
......@@ -416,13 +429,13 @@ void __sysrq_put_key_op (int key, struct sysrq_key_op *op_p) {
* and any other keycode arrives.
*/
void handle_sysrq(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
{
if (!sysrq_enabled)
return;
__sysrq_lock_table();
__handle_sysrq_nolock(key, pt_regs, kbd, tty);
__handle_sysrq_nolock(key, pt_regs, tty);
__sysrq_unlock_table();
}
......@@ -433,7 +446,8 @@ void handle_sysrq(int key, struct pt_regs *pt_regs,
*/
void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
struct kbd_struct *kbd, struct tty_struct *tty) {
struct tty_struct *tty)
{
struct sysrq_key_op *op_p;
int orig_log_level;
int i, j;
......@@ -449,7 +463,7 @@ void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
if (op_p) {
printk ("%s\n", op_p->action_msg);
console_loglevel = orig_log_level;
op_p->handler(key, pt_regs, kbd, tty);
op_p->handler(key, pt_regs, tty);
} else {
printk("HELP : ");
/* Only print the help msg once per handler */
......
......@@ -2245,9 +2245,8 @@ static struct tty_driver dev_tty_driver, dev_syscons_driver;
static struct tty_driver dev_ptmx_driver;
#endif
#ifdef CONFIG_VT
extern void con_init_devfs (void);
extern void console_map_init(void);
static struct tty_driver dev_console_driver;
extern int vty_init(void);
#endif
/*
......@@ -2287,13 +2286,6 @@ void __init tty_init(void)
if (tty_register_driver(&dev_syscons_driver))
panic("Couldn't register /dev/console driver\n");
/* console calls tty_register_driver() before kmalloc() works.
* Thus, we can't devfs_register() then. Do so now, instead.
*/
#ifdef CONFIG_VT
con_init_devfs();
#endif
#ifdef CONFIG_UNIX98_PTYS
dev_ptmx_driver = dev_tty_driver;
dev_ptmx_driver.driver_name = "/dev/ptmx";
......@@ -2317,10 +2309,7 @@ void __init tty_init(void)
if (tty_register_driver(&dev_console_driver))
panic("Couldn't register /dev/tty0 driver\n");
vcs_init();
kbd_init();
console_map_init();
vty_init();
#endif
#ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */
......
......@@ -33,6 +33,7 @@ struct vc_data {
unsigned int vc_top, vc_bottom; /* Scrolling region */
unsigned int vc_state; /* Escape sequence parser state */
unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
struct tty_struct *vc_tty; /* TTY we are attached to */
unsigned long vc_origin; /* [!] Start of real screen */
unsigned long vc_scr_end; /* [!] End of real screen */
unsigned long vc_visible_origin; /* [!] Top of visible window */
......
......@@ -14,12 +14,10 @@
#include <linux/config.h>
struct pt_regs;
struct kbd_struct;
struct tty_struct;
struct sysrq_key_op {
void (*handler)(int, struct pt_regs *,
struct kbd_struct *, struct tty_struct *);
void (*handler)(int, struct pt_regs *, struct tty_struct *);
char *help_msg;
char *action_msg;
};
......@@ -31,19 +29,14 @@ struct sysrq_key_op {
* are available -- else NULL's).
*/
void handle_sysrq(int, struct pt_regs *,
struct kbd_struct *, struct tty_struct *);
void handle_sysrq(int, struct pt_regs *, struct tty_struct *);
/*
* Nonlocking version of handle sysrq, used by sysrq handlers that need to
* call sysrq handlers
*/
void __handle_sysrq_nolock(int, struct pt_regs *,
struct kbd_struct *, struct tty_struct *);
void __handle_sysrq_nolock(int, struct pt_regs *, struct tty_struct *);
/*
* Sysrq registration manipulation functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment