aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty.h
diff options
context:
space:
mode:
authorJoe Millenbach <jmillenbach@gmail.com>2013-01-18 01:44:22 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-18 19:15:27 -0500
commit4f73bc4dd3e8563ef4109f293a092820dff66d92 (patch)
tree8ebd5d01abaceb70da1932db1a5e7219630b0fd3 /include/linux/tty.h
parenta1bf9584429d61b7096f93ae09325e1ba538e9e8 (diff)
tty: Added a CONFIG_TTY option to allow removal of TTY
The option allows you to remove TTY and compile without errors. This saves space on systems that won't support TTY interfaces anyway. bloat-o-meter output is below. The bulk of this patch consists of Kconfig changes adding "depends on TTY" to various serial devices and similar drivers that require the TTY layer. Ideally, these dependencies would occur on a common intermediate symbol such as SERIO, but most drivers "select SERIO" rather than "depends on SERIO", and "select" does not respect dependencies. bloat-o-meter output comparing our previous minimal to new minimal by removing TTY. The list is filtered to not show removed entries with awk '$3 != "-"' as the list was very long. add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350) function old new delta chr_dev_init 166 170 +4 allow_signal 80 82 +2 static.__warned 143 142 -1 disallow_signal 63 62 -1 __set_special_pids 95 94 -1 unregister_console 126 121 -5 start_kernel 546 541 -5 register_console 593 588 -5 copy_from_user 45 40 -5 sys_setsid 128 120 -8 sys_vhangup 32 19 -13 do_exit 1543 1526 -17 bitmap_zero 60 40 -20 arch_local_irq_save 137 117 -20 release_task 674 652 -22 static.spin_unlock_irqrestore 308 260 -48 Signed-off-by: Joe Millenbach <jmillenbach@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty.h')
-rw-r--r--include/linux/tty.h44
1 files changed, 33 insertions, 11 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f89acd1ed6d3..c75d886b0307 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -318,11 +318,43 @@ struct tty_file_private {
318 318
319#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 319#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
320 320
321#ifdef CONFIG_TTY
322extern void console_init(void);
323extern void tty_kref_put(struct tty_struct *tty);
324extern struct pid *tty_get_pgrp(struct tty_struct *tty);
325extern void tty_vhangup_self(void);
326extern void disassociate_ctty(int priv);
327extern dev_t tty_devnum(struct tty_struct *tty);
328extern void proc_clear_tty(struct task_struct *p);
329extern struct tty_struct *get_current_tty(void);
330/* tty_io.c */
331extern int __init tty_init(void);
332#else
333static inline void console_init(void)
334{ }
335static inline void tty_kref_put(struct tty_struct *tty)
336{ }
337static inline struct pid *tty_get_pgrp(struct tty_struct *tty)
338{ return NULL; }
339static inline void tty_vhangup_self(void)
340{ }
341static inline void disassociate_ctty(int priv)
342{ }
343static inline dev_t tty_devnum(struct tty_struct *tty)
344{ return 0; }
345static inline void proc_clear_tty(struct task_struct *p)
346{ }
347static inline struct tty_struct *get_current_tty(void)
348{ return NULL; }
349/* tty_io.c */
350static inline int __init tty_init(void)
351{ return 0; }
352#endif
353
321extern void tty_write_flush(struct tty_struct *); 354extern void tty_write_flush(struct tty_struct *);
322 355
323extern struct ktermios tty_std_termios; 356extern struct ktermios tty_std_termios;
324 357
325extern void console_init(void);
326extern int vcs_init(void); 358extern int vcs_init(void);
327 359
328extern struct class *tty_class; 360extern struct class *tty_class;
@@ -342,7 +374,6 @@ static inline struct tty_struct *tty_kref_get(struct tty_struct *tty)
342 kref_get(&tty->kref); 374 kref_get(&tty->kref);
343 return tty; 375 return tty;
344} 376}
345extern void tty_kref_put(struct tty_struct *tty);
346 377
347extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, 378extern int tty_paranoia_check(struct tty_struct *tty, struct inode *inode,
348 const char *routine); 379 const char *routine);
@@ -374,18 +405,15 @@ extern void tty_driver_remove_tty(struct tty_driver *driver,
374 struct tty_struct *tty); 405 struct tty_struct *tty);
375extern void tty_free_termios(struct tty_struct *tty); 406extern void tty_free_termios(struct tty_struct *tty);
376extern int is_current_pgrp_orphaned(void); 407extern int is_current_pgrp_orphaned(void);
377extern struct pid *tty_get_pgrp(struct tty_struct *tty);
378extern int is_ignored(int sig); 408extern int is_ignored(int sig);
379extern int tty_signal(int sig, struct tty_struct *tty); 409extern int tty_signal(int sig, struct tty_struct *tty);
380extern void tty_hangup(struct tty_struct *tty); 410extern void tty_hangup(struct tty_struct *tty);
381extern void tty_vhangup(struct tty_struct *tty); 411extern void tty_vhangup(struct tty_struct *tty);
382extern void tty_vhangup_locked(struct tty_struct *tty); 412extern void tty_vhangup_locked(struct tty_struct *tty);
383extern void tty_vhangup_self(void);
384extern void tty_unhangup(struct file *filp); 413extern void tty_unhangup(struct file *filp);
385extern int tty_hung_up_p(struct file *filp); 414extern int tty_hung_up_p(struct file *filp);
386extern void do_SAK(struct tty_struct *tty); 415extern void do_SAK(struct tty_struct *tty);
387extern void __do_SAK(struct tty_struct *tty); 416extern void __do_SAK(struct tty_struct *tty);
388extern void disassociate_ctty(int priv);
389extern void no_tty(void); 417extern void no_tty(void);
390extern void tty_flush_to_ldisc(struct tty_struct *tty); 418extern void tty_flush_to_ldisc(struct tty_struct *tty);
391extern void tty_buffer_free_all(struct tty_port *port); 419extern void tty_buffer_free_all(struct tty_port *port);
@@ -415,9 +443,6 @@ extern long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
415extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, 443extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
416 unsigned int cmd, unsigned long arg); 444 unsigned int cmd, unsigned long arg);
417extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); 445extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg);
418extern dev_t tty_devnum(struct tty_struct *tty);
419extern void proc_clear_tty(struct task_struct *p);
420extern struct tty_struct *get_current_tty(void);
421extern void tty_default_fops(struct file_operations *fops); 446extern void tty_default_fops(struct file_operations *fops);
422extern struct tty_struct *alloc_tty_struct(void); 447extern struct tty_struct *alloc_tty_struct(void);
423extern int tty_alloc_file(struct file *file); 448extern int tty_alloc_file(struct file *file);
@@ -543,9 +568,6 @@ static inline int tty_audit_push_task(struct task_struct *tsk,
543} 568}
544#endif 569#endif
545 570
546/* tty_io.c */
547extern int __init tty_init(void);
548
549/* tty_ioctl.c */ 571/* tty_ioctl.c */
550extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, 572extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
551 unsigned int cmd, unsigned long arg); 573 unsigned int cmd, unsigned long arg);