X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Flinux%2Ftty.h;h=f13f49afe198cc0d59e998fe3a6e721d70fca6b4;hb=2a69bf428e49c229f8b735ba3de0a91ebd5d7f33;hp=a7bd3b4558d26efaa3ed8dae0b5bb53f0d184cab;hpb=d1ffa5669cd834f901141756e63195f48c1bfbf9;p=powerpc.git diff --git a/include/linux/tty.h b/include/linux/tty.h index a7bd3b4558..04827ca657 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -5,25 +5,14 @@ * 'tty.h' defines some structures used by tty_io.c and some defines. */ -/* - * These constants are also useful for user-level apps (e.g., VC - * resizing). - */ -#define MIN_NR_CONSOLES 1 /* must be at least 1 */ -#define MAX_NR_CONSOLES 63 /* serial lines start at 64 */ -#define MAX_NR_USER_CONSOLES 63 /* must be root to allocate above this */ - /* Note: the ioctl VT_GETSTATE does not work for - consoles 16 and higher (since it returns a short) */ - #ifdef __KERNEL__ -#include #include #include #include #include #include #include -#include +#include #include @@ -57,7 +46,8 @@ struct tty_buffer { unsigned char *flag_buf_ptr; int used; int size; - int active; + int commit; + int read; /* Data points here */ unsigned long data[0]; }; @@ -69,6 +59,7 @@ struct tty_bufhead { struct tty_buffer *head; /* Queue head */ struct tty_buffer *tail; /* Active buffer */ struct tty_buffer *free; /* Free queue head */ + int memory_used; /* Buffer space used excluding free queue */ }; /* * The pty uses char_buf and flag_buf as a contiguous buffer @@ -229,8 +220,8 @@ struct tty_struct { int canon_data; unsigned long canon_head; unsigned int canon_column; - struct semaphore atomic_read; - struct semaphore atomic_write; + struct mutex atomic_read_lock; + struct mutex atomic_write_lock; unsigned char *write_buf; int write_cnt; spinlock_t read_lock; @@ -257,7 +248,6 @@ struct tty_struct { #define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ #define TTY_PUSH 6 /* n_tty private */ #define TTY_CLOSING 7 /* ->close() in progress */ -#define TTY_DONT_FLIP 8 /* Defer buffer flip */ #define TTY_LDISC 9 /* Line discipline attached */ #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ @@ -270,7 +260,6 @@ struct tty_struct { extern void tty_write_flush(struct tty_struct *); extern struct termios tty_std_termios; -extern int fg_console, last_console, want_console; extern int kmsg_redirect; @@ -288,7 +277,9 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); extern int tty_unregister_ldisc(int disc); extern int tty_register_driver(struct tty_driver *driver); extern int tty_unregister_driver(struct tty_driver *driver); -extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); +extern struct class_device *tty_register_device(struct tty_driver *driver, + unsigned index, + struct device *dev); extern void tty_unregister_device(struct tty_driver *driver, unsigned index); extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, int buflen); @@ -317,8 +308,7 @@ extern void tty_ldisc_put(int); extern void tty_wakeup(struct tty_struct *tty); extern void tty_ldisc_flush(struct tty_struct *tty); -struct semaphore; -extern struct semaphore tty_sem; +extern struct mutex tty_mutex; /* n_tty.c */ extern struct tty_ldisc tty_ldisc_N_TTY;