OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [armnommu/] [drivers/] [char/] [vt_kern.h] - Blame information for rev 1622

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1622 jcastillo
/*
2
 * linux/arch/arm/drivers/char/vt.h
3
 *
4
 * Virtual Terminal bits...
5
 */
6
 
7
#ifndef _VT_KERN_H
8
#define _VT_KERN_H
9
 
10
#include <linux/vt.h>
11
 
12
#define NPAR 16
13
#define SEL_BUFFER_SIZE 4096
14
 
15
struct vc_state {
16
    unsigned char       forecol;                /* foreground                   */
17
    unsigned char       backcol;                /* background                   */
18
    unsigned char       x;                      /* x position                   */
19
    unsigned char       y;                      /* y position                   */
20
#define FLG_BOLD        0x01
21
#define FLG_ITALIC      0x02
22
#define FLG_UNDERLINE   0x04
23
#define FLG_FLASH       0x08
24
#define FLG_INVERSE     0x10
25
#define FLG_CHRSET      0x20
26
    unsigned char       flags;                  /* special flags                */
27
    unsigned char       G0_charset;             /* G0 character set             */
28
    unsigned char       G1_charset;             /* G1 character set             */
29
    unsigned char       __unused;               /* unused                       */
30
};
31
 
32
extern struct con_struct *___GCC_HACK_TO_STOP_ITS_SILLY_COMPLAINTS___;
33
 
34
struct console_driver {
35
    void (*gotoxy)(struct con_struct *vcd);
36
    void (*scroll_up)(struct con_struct *vcd,unsigned int,unsigned int,unsigned int);
37
    void (*scroll_down)(struct con_struct *vcd,unsigned int,unsigned int,unsigned int);
38
    unsigned long *(*buffer_pos)(struct con_struct *vcd,unsigned int offset);
39
    void (*delete_char)(struct con_struct *vcd,unsigned int);
40
    void (*insert_char)(struct con_struct *vcd,unsigned int);
41
    void (*put_char)(struct con_struct *vcd,unsigned long);
42
    void (*write_char)(struct con_struct *vcd,unsigned long);
43
    void (*erase)(struct con_struct *vcd,unsigned char,unsigned char,unsigned char,unsigned char);
44
};
45
 
46
struct con_struct {
47
    struct {
48
        unsigned int    origin;                 /* address of top-left          */
49
        unsigned int    pos;                    /* current position into screen */
50
        unsigned long   *palette_entries;       /* Current palette              */
51
        unsigned int    cursoron;               /* Cursor on count              */
52
    } screen;
53
 
54
    struct {
55
        unsigned long   *buffer;                /* pointer to actual buffer     */
56
        unsigned int    size;                   /* size of buffer               */
57
        unsigned int    pos;                    /* current position into buffer */
58
        unsigned char   kmalloced       : 1;    /* buffer kmalloced             */
59
    } buffer;
60
 
61
    struct console_driver driver;
62
    /*
63
     * State
64
     */
65
    struct vc_state     curstate;               /* current state                */
66
    struct vc_state     savedstate;             /* saved state                  */
67
    unsigned long       combined_state;         /* combined state               */
68
    unsigned long       cached_backcolwrd;      /* cached background colour     */
69
    unsigned long       tab_stop[5];            /* tab stops                    */
70
    unsigned short      *translate;             /* translation table            */
71
 
72
    unsigned char       top;                    /* top of scrollable region     */
73
    unsigned char       bottom;                 /* bottom of scrollable region  */
74
    unsigned char       def_forecol;            /* default foreground           */
75
    unsigned char       def_backcol;            /* default background           */
76
 
77
     unsigned char      cursor_count;           /* on/off cursor count (int)    */
78
 
79
      unsigned char     disp_ctrl       : 1;    /* display control characters   */
80
      unsigned char     toggle_meta     : 1;    /* toggle high bit              */
81
      unsigned char     decscnm         : 1;    /* screen mode                  */
82
      unsigned char     decom           : 1;    /* origin mode                  */
83
      unsigned char     decawm          : 1;    /* autowrap mode                */
84
      unsigned char     deccm           : 1;    /* cursor visible               */
85
      unsigned char     decim           : 1;    /* insert mode                  */
86
      unsigned char     deccolm         : 1;    /* 80/132 col mode              */
87
 
88
      unsigned char     report_mouse    : 2;    /* mouse reporting?             */
89
      unsigned char     need_wrap       : 1;    /* need to wrap                 */
90
      unsigned char     ques            : 1;
91
    /*
92
     * UTF
93
     */
94
      unsigned char     utf             : 1;    /* Unicode UTF-8 encoding       */
95
 
96
     unsigned char      utf_count;              /* UTF character count          */
97
    unsigned long       utf_char;               /* UTF character built          */
98
    unsigned long       npar;                   /* number of params             */
99
    unsigned long       par[NPAR];              /* params                       */
100
    unsigned int        bell_pitch;             /* console bell pitch           */
101
    unsigned int        bell_duration;          /* console bell duration        */
102
    unsigned char       state;                  /* Current escape state         */
103
 
104
};
105
 
106
struct vt_data {
107
    unsigned char       numcolumns;             /* number of columns            */
108
    unsigned char       numrows;                /* number of rows               */
109
    unsigned char       __unused[2];
110
    struct vt           *fgconsole;             /* displayed VC                 */
111
    struct vt           *blanked;               /* blanked VC                   */
112
    struct {
113
        unsigned char   bitsperpix;             /* bits per pixel               */
114
        unsigned char   bytespercharh;          /* horiz. bytes a char takes    */
115
        unsigned char   bytespercharv;          /* vert. bytes a char takes     */
116
        unsigned char   __unused[1];
117
        unsigned long   sizerow;                /* size of a row of chars       */
118
        unsigned long   totsize;                /* total character size         */
119
        unsigned long   memstart;               /* video mem start              */
120
        unsigned long   memsize;                /* video mem size               */
121
        unsigned long   memend;                 /* video mem end                */
122
        unsigned long   blankinterval;          /* blank interval               */
123
    } screen;
124
    struct {
125
        unsigned long   *buffer;                /* address of screen buffer     */
126
        unsigned long   totsize;                /* total buffer size            */
127
        unsigned long   lastorigin;             /* last origin address          */
128
        unsigned long   origin;                 /* current origin               */
129
        unsigned long   sizerow;                /* size of a row of chars       */
130
    } buffer;
131
    struct {
132
        struct vt       *vt;                    /* selected VC                  */
133
        int             start;                  /* start offset                 */
134
        int             end;                    /* end offset                   */
135
        int             length;                 /* buffer length                */
136
        char            *buffer;                /* buffer                       */
137
    } select;
138
};
139
 
140
extern struct vt_data vtdata;
141
extern struct tty_driver console_driver;
142
 
143
struct vt_struct {
144
    unsigned char       vc_mode;                /* hmm...                       */
145
    unsigned char       vc_kbdraw;
146
    unsigned char       vc_kbde0;
147
    unsigned char       vc_kbdleds;
148
    struct vt_mode      vt_mode;
149
    pid_t               vt_pid;
150
    struct vt           *vt_newvt;              /* VT to switch to..            */
151
    struct wait_queue   *paste_wait;
152
    unsigned char *     xmit_buf;
153
    unsigned int        xmit_cnt;
154
    unsigned int        xmit_out;
155
    unsigned int        xmit_in;
156
    unsigned int        xmitting;
157
};
158
 
159
struct vt {
160
    /*
161
     * Per-console data
162
     */
163
    struct con_struct *vcd;
164
    /*
165
     * Keyboard stuff
166
     */
167
    struct kbd_struct *kbd;
168
    /*
169
     * VT stuff
170
     */
171
    struct vt_struct *vtd;
172
    /*
173
     * tty that this VT is connected to
174
     */
175
    struct tty_struct **tty;
176
    /*
177
     * tty number of this vt struct
178
     */
179
    unsigned char num;
180
    /*
181
     * is this vt allocated and initialised?
182
     */
183
    unsigned char allocinit;
184
    /*
185
     * might add  scrmem at some time, to have everything
186
     * in one place - the disadvantage would be that
187
     * vc_cons etc can no longer be static
188
     */
189
};
190
 
191
extern struct vt vt_con_data[];
192
 
193
#define VT_IS_IN_USE(i) (vt_driver.table[i] && vt_driver.table[i]->count)
194
#define VT_BUSY(i) (VT_IS_IN_USE(i) || vt_con_data + i == vtdata.fgconsole || vt_con_data + i == vtdata.select.vt)
195
 
196
extern inline int vt_allocated (const struct vt * const vt)
197
{
198
    return vt->allocinit != 0;
199
}
200
 
201
extern void             vt_reset (const struct vt *vt);
202
extern void             vt_completechangeconsole (const struct vt *vt);
203
extern void             vt_changeconsole (struct vt *newvt);
204
extern void             vt_mksound (unsigned int count, unsigned int vol, unsigned int ticks);
205
extern int              vt_deallocate (int arg);
206
extern int              vt_resize (int cols, int rows);
207
 
208
/*
209
 * Blanking ...
210
 */
211
extern void             vt_pokeblankedconsole (void);
212
extern void             vt_do_unblankscreen (void);
213
extern void             vt_do_blankscreen (int nopowersave);
214
 
215
/*
216
 * Screen switching...
217
 */
218
extern void             vt_updatescreen (const struct vt *newvt);
219
 
220
/*
221
 * Initialisation ...
222
 */
223
extern unsigned long    vt_pre_init (unsigned long kmem);
224
extern void             vt_post_init (void);
225
 
226
#endif /* _VT_KERN_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.