File: dummycon.c

package info (click to toggle)
kernel-image-2.4.17-hppa 32.4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 156,356 kB
  • ctags: 442,585
  • sloc: ansic: 2,542,442; asm: 144,771; makefile: 8,468; sh: 3,097; perl: 2,578; yacc: 1,177; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (80 lines) | stat: -rw-r--r-- 2,022 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 *  linux/drivers/video/dummycon.c -- A dummy console driver
 *
 *  To be used if there's no other console driver (e.g. for plain VGA text)
 *  available, usually until fbcon takes console over.
 */

#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/tty.h>
#include <linux/console.h>
#include <linux/console_struct.h>
#include <linux/vt_kern.h>
#include <linux/init.h>

/*
 *  Dummy console driver
 */

#if defined(__arm__)
#define DUMMY_COLUMNS	ORIG_VIDEO_COLS
#define DUMMY_ROWS	ORIG_VIDEO_LINES
#elif defined(__hppa__)
#warning "FIXME: vc_resize() in console.c seems to have problems downsampling a console"
/* until this is fixed or I have more clue about it you may enter here the columns/rows 
 * for your screen or you will loose most of the bootup-messages on a STI console 
 * (which isn't really a serious problem).
 * Values: 160x64 for a 1280x1024, 200x150 for a 1600x1200 screen.
 */
#define DUMMY_COLUMNS	160	/* Maximum initial screensize */
#define DUMMY_ROWS      64	/* FIXME: 1280x1024 -> 160x64, 1600x1200 -> 200x150,  */
#else
#define DUMMY_COLUMNS	80
#define DUMMY_ROWS	25
#endif

static const char *dummycon_startup(void)
{
    return "dummy device";
}

static void dummycon_init(struct vc_data *conp, int init)
{
    conp->vc_can_do_color = 1;
    if (init) {
	conp->vc_cols = DUMMY_COLUMNS;
	conp->vc_rows = DUMMY_ROWS;
    } else
	vc_resize_con(DUMMY_ROWS, DUMMY_COLUMNS, conp->vc_num);
}

static int dummycon_dummy(void)
{
    return 0;
}

#define DUMMY	(void *)dummycon_dummy

/*
 *  The console `switch' structure for the dummy console
 *
 *  Most of the operations are dummies.
 */

const struct consw dummy_con = {
    con_startup:	dummycon_startup,
    con_init:		dummycon_init,
    con_deinit:		DUMMY,
    con_clear:		DUMMY,
    con_putc:		DUMMY,
    con_putcs:		DUMMY,
    con_cursor:		DUMMY,
    con_scroll:		DUMMY,
    con_bmove:		DUMMY,
    con_switch:		DUMMY,
    con_blank:		DUMMY,
    con_font_op:	DUMMY,
    con_set_palette:	DUMMY,
    con_scrolldelta:	DUMMY,
};