Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
console.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  consw
 
struct  console
 

Macros

#define VT100ID   "\033[?1;2c"
 
#define VT102ID   "\033[?6c"
 
#define SM_UP   (1)
 
#define SM_DOWN   (2)
 
#define CM_DRAW   (1)
 
#define CM_ERASE   (2)
 
#define CM_MOVE   (3)
 
#define CON_PRINTBUFFER   (1)
 
#define CON_CONSDEV   (2) /* Last on the command line */
 
#define CON_ENABLED   (4)
 
#define CON_BOOT   (8)
 
#define CON_ANYTIME   (16) /* Safe to call when cpu is offline */
 
#define CON_BRL   (32) /* Used for a braille device */
 
#define for_each_console(con)   for (con = console_drivers; con != NULL; con = con->next)
 
#define WARN_CONSOLE_UNLOCKED()   WARN_ON(!is_console_locked() && !oops_in_progress)
 
#define VESA_NO_BLANKING   0
 
#define VESA_VSYNC_SUSPEND   1
 
#define VESA_HSYNC_SUSPEND   2
 
#define VESA_POWERDOWN   3
 

Functions

int con_is_bound (const struct consw *csw)
 
int register_con_driver (const struct consw *csw, int first, int last)
 
int unregister_con_driver (const struct consw *csw)
 
int take_over_console (const struct consw *sw, int first, int last, int deflt)
 
void give_up_console (const struct consw *sw)
 
int add_preferred_console (char *name, int idx, char *options)
 
int update_console_cmdline (char *name, int idx, char *name_new, int idx_new, char *options)
 
void register_console (struct console *)
 
int unregister_console (struct console *)
 
void console_lock (void)
 
int console_trylock (void)
 
void console_unlock (void)
 
void console_conditional_schedule (void)
 
void console_unblank (void)
 
struct tty_driverconsole_device (int *)
 
void console_stop (struct console *)
 
void console_start (struct console *)
 
int is_console_locked (void)
 
int braille_register_console (struct console *, int index, char *console_options, char *braille_options)
 
int braille_unregister_console (struct console *)
 
void console_sysfs_notify (void)
 
void suspend_console (void)
 
void resume_console (void)
 
int mda_console_init (void)
 
void prom_con_init (void)
 
void vcs_make_sysfs (int index)
 
void vcs_remove_sysfs (int index)
 

Variables

struct conswconswitchp
 
struct consw dummy_con
 
struct consw vga_con
 
struct consw newport_con
 
struct consw prom_con
 
int console_set_on_cmdline
 
struct consoleconsole_drivers
 
bool console_suspend_enabled
 

Macro Definition Documentation

#define CM_DRAW   (1)

Definition at line 101 of file console.h.

#define CM_ERASE   (2)

Definition at line 102 of file console.h.

#define CM_MOVE   (3)

Definition at line 103 of file console.h.

#define CON_ANYTIME   (16) /* Safe to call when cpu is offline */

Definition at line 117 of file console.h.

#define CON_BOOT   (8)

Definition at line 116 of file console.h.

#define CON_BRL   (32) /* Used for a braille device */

Definition at line 118 of file console.h.

#define CON_CONSDEV   (2) /* Last on the command line */

Definition at line 114 of file console.h.

#define CON_ENABLED   (4)

Definition at line 115 of file console.h.

#define CON_PRINTBUFFER   (1)

Definition at line 113 of file console.h.

#define for_each_console (   con)    for (con = console_drivers; con != NULL; con = con->next)

Definition at line 138 of file console.h.

#define SM_DOWN   (2)

Definition at line 98 of file console.h.

#define SM_UP   (1)

Definition at line 97 of file console.h.

#define VESA_HSYNC_SUSPEND   2

Definition at line 183 of file console.h.

#define VESA_NO_BLANKING   0

Definition at line 181 of file console.h.

#define VESA_POWERDOWN   3

Definition at line 184 of file console.h.

#define VESA_VSYNC_SUSPEND   1

Definition at line 182 of file console.h.

#define VT100ID   "\033[?1;2c"

Definition at line 28 of file console.h.

#define VT102ID   "\033[?6c"

Definition at line 29 of file console.h.

#define WARN_CONSOLE_UNLOCKED ( )    WARN_ON(!is_console_locked() && !oops_in_progress)

Definition at line 175 of file console.h.

Function Documentation

int add_preferred_console ( char name,
int  idx,
char options 
)

Definition at line 1814 of file printk.c.

int braille_register_console ( struct console ,
int  index,
char console_options,
char braille_options 
)

Definition at line 358 of file braille_console.c.

int braille_unregister_console ( struct console )

Definition at line 380 of file braille_console.c.

int con_is_bound ( const struct consw csw)

con_is_bound - checks if driver is bound to the console : console driver

RETURNS: zero if unbound, nonzero if bound

Drivers can call this and if zero, they should release all resources allocated on con_startup()

Definition at line 3390 of file vt.c.

void console_conditional_schedule ( void  )

console_conditional_schedule - yield the CPU if required

If the console code is currently allowed to sleep, and if this CPU should yield the CPU to another task, do so here.

Must be called within console_lock();.

Definition at line 2134 of file printk.c.

struct tty_driver* console_device ( int )
read

Definition at line 2166 of file printk.c.

void console_lock ( void  )

console_lock - lock the console system for exclusive use.

Acquires a lock which guarantees that the caller has exclusive access to the console system and the console_drivers list.

Can sleep, returns nothing.

Definition at line 1909 of file printk.c.

void console_start ( struct console )

Definition at line 2196 of file printk.c.

void console_stop ( struct console )

Definition at line 2188 of file printk.c.

void console_sysfs_notify ( void  )

Definition at line 3480 of file tty_io.c.

int console_trylock ( void  )

console_trylock - try to lock the console system for exclusive use.

Tried to acquire a lock which guarantees that the caller has exclusive access to the console system and the console_drivers list.

returns 1 on success, and 0 on failure to acquire the lock.

Definition at line 1928 of file printk.c.

void console_unblank ( void  )

Definition at line 2141 of file printk.c.

void console_unlock ( void  )

console_unlock - unlock the console system

Releases the console_lock which the caller holds on the console system and the console driver list.

While the console_lock was held, console output may have been buffered by printk(). If this is the case, console_unlock(); emits the output prior to releasing the lock.

If there is output waiting, we wake /dev/kmsg and syslog() users.

console_unlock(); may be called from any context.

Definition at line 2027 of file printk.c.

void give_up_console ( const struct consw sw)

Definition at line 3646 of file vt.c.

int is_console_locked ( void  )

Definition at line 1942 of file printk.c.

int mda_console_init ( void  )

Definition at line 586 of file mdacon.c.

void prom_con_init ( void  )
int register_con_driver ( const struct consw csw,
int  first,
int  last 
)

register_con_driver - register console driver to console layer : console driver : the first console to take over, minimum value is 0 : the last console to take over, maximum value is MAX_NR_CONSOLES -1

DESCRIPTION: This function registers a console driver which can later bind to a range of consoles specified by and . It will also initialize the console driver by calling con_startup().

Definition at line 3502 of file vt.c.

void register_console ( struct console )

Definition at line 2235 of file printk.c.

void resume_console ( void  )

Definition at line 1867 of file printk.c.

void suspend_console ( void  )

suspend_console - suspend the console subsystem

This disables printk() while we go into suspend states

Definition at line 1857 of file printk.c.

int take_over_console ( const struct consw sw,
int  first,
int  last,
int  deflt 
)

Definition at line 3625 of file vt.c.

int unregister_con_driver ( const struct consw csw)

unregister_con_driver - unregister console driver from console layer : console driver

DESCRIPTION: All drivers that registers to the console layer must call this function upon exit, or if the console driver is in a state where it won't be able to handle console services, such as the framebuffer console without loaded framebuffer drivers.

The driver must unbind first prior to unregistration.

Definition at line 3583 of file vt.c.

int unregister_console ( struct console )

Definition at line 2390 of file printk.c.

int update_console_cmdline ( char name,
int  idx,
char name_new,
int  idx_new,
char options 
)

Definition at line 1819 of file printk.c.

void vcs_make_sysfs ( int  index)

Definition at line 639 of file vc_screen.c.

void vcs_remove_sysfs ( int  index)

Definition at line 647 of file vc_screen.c.

Variable Documentation

struct console* console_drivers

Definition at line 87 of file printk.c.

int console_set_on_cmdline

Definition at line 123 of file printk.c.

bool console_suspend_enabled

Definition at line 1838 of file printk.c.

struct consw* conswitchp

Definition at line 123 of file vt.c.

struct consw dummy_con

Definition at line 60 of file dummycon.c.

struct consw newport_con

Definition at line 717 of file newport_con.c.

struct consw prom_con
struct consw vga_con

Definition at line 1403 of file vgacon.c.