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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [armnommu/] [drivers/] [char/] [console-trio.c] - Blame information for rev 1775

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

Line No. Rev Author Line
1 199 simons
/*
2
 * linux/arch/arm/drivers/char/console-dummy.c
3
 *
4
 * Modifications (C) 1996 Russell King
5
 */
6
 
7
/*
8
 * This module exports the console io functions:
9
 *
10
 *  'int           vcd_init (struct vt *vt, int kmallocok, unsigned long *kmem)'
11
 *  'unsigned long vcd_pre_init (unsigned long kmem, struct vt *vt)'
12
 *  'void          vcd_disallocate (struct vt *vt)'
13
 *  'int           vcd_resize (unsigned long lines, unsigned long cols)'
14
 *  'void          vcd_blankscreen (int nopowersave)'
15
 *  'void          vcd_unblankscreen (void)'
16
 *  'void          vcd_savestate (const struct vt *vt, int blanked)'
17
 *  'void          vcd_restorestate (const struct vt *vt)'
18
 *  'void          vcd_setup_graphics (const struct vt *vt)'
19
 *  'int           vcd_write (const struct vt *vt, int from_user, const unsigned char *buf, int count)'
20
 *  'int           vcd_ioctl (const struct vt *vt, int cmd, unsigned long arg)'
21
 *
22
 *
23
 *      'int vc_allocate(unsigned int console)'
24
 *      'int vc_cons_allocated (unsigned int console)'
25
 *      'int vc_resize(unsigned long lines,unsigned long cols)'
26
 *      'void vc_disallocate(unsigned int currcons)'
27
 *
28
 *      'unsigned long con_init(unsigned long)'
29
 * S    'int con_open(struct tty_struct *tty,struct file *filp)'
30
 * S    'void con_write(struct tty_struct *tty)'
31
 * S    'void console_print(const char *b)'
32
 *      'void update_screen(int new_console)'
33
 *
34
 *      'void blank_screen(void)'
35
 *      'void unblank_screen(void)'
36
 *      'void scrollback(int lines)'                    *
37
 *      'void scrollfront(int lines)'                   *
38
 *      'int do_screendump(int arg)'
39
 *
40
 *      'int con_get_font(char *)'
41
 *      'int con_set_font(char *)'
42
 *      'int con_get_trans(char *)'
43
 *      'int con_set_trans(char *)'
44
 *
45
 *      'int mouse_reporting(void)'
46
 */
47
 
48
#include <linux/sched.h>
49
#include <linux/timer.h>
50
#include <linux/interrupt.h>
51
#include <linux/tty.h>
52
#include <linux/tty_flip.h>
53
#include <linux/kernel.h>
54
#include <linux/errno.h>
55
#include <linux/kd.h>
56
#include <linux/major.h>
57
#include <linux/mm.h>
58
#include <linux/malloc.h>
59
 
60
#include <asm/segment.h>
61
#include <asm/irq.h>
62
 
63
#include "kbd_kern.h"
64
#include "consolemap.h"
65
#include "vt_kern.h"
66
#include "selection.h"
67
 
68
extern void register_console(void (*proc)(const char *));
69
static int printable;                           /* Is console ready for printing? */
70
 
71
int bytes_per_char_h;
72
int bytes_per_char_v;
73
 
74
#if 0
75
#define SERIAL_ECHO_PORT        0x2f8
76
#define SERIAL_ECHO_DIVISOR     3
77
 
78
#include "serialecho.c"
79
#endif
80
 
81
/*
82
 * functions to handle /dev/fb
83
 */
84
int con_fb_read(char *buf, unsigned long pos, int count)
85
{
86
        return -EIO;
87
}
88
 
89
int con_fb_write(const char *buf, unsigned long pos, int count)
90
{
91
        return -EIO;
92
}
93
 
94
int con_fb_mmap(unsigned long vma_start, unsigned long vma_offset,
95
                        unsigned long vma_end, pgprot_t prot)
96
{
97
        return -EINVAL;
98
}
99
 
100
void no_scroll (char *str, int *ints)
101
{
102
}
103
 
104
void mouse_report (struct tty_struct *tty, int butt, int mrx, int mry)
105
{
106
}
107
 
108
int mouse_reporting (void)
109
{
110
    return 0;
111
}
112
 
113
static inline unsigned long *bufferpos (const struct vt * const vt, int offset)
114
{
115
    return NULL;
116
}
117
 
118
void invert_screen (const struct vt * const vt, unsigned int offset, unsigned int count)
119
{
120
}
121
 
122
void complement_pos (const struct vt * const vt, unsigned int offset)
123
{
124
}
125
 
126
unsigned long screen_word (const struct vt * const vt, unsigned int offset)
127
{
128
    return 0;
129
}
130
 
131
int scrw2glyph (unsigned long scr_word)
132
{
133
    return 0;
134
}
135
 
136
unsigned long *screen_pos (const struct vt * const vt, unsigned int offset)
137
{
138
    return NULL;
139
}
140
 
141
void getconsxy (const struct vt * const vt, char *p)
142
{
143
    p[0] = p[1] = 0;
144
}
145
 
146
void putconsxy (const struct vt * const vt, char *p)
147
{
148
}
149
 
150
void console_print(const char *b)
151
{
152
    static int printing = 0;
153
 
154
    if (!printable || printing)
155
        return;  /* console not yet initialized */
156
 
157
    printing = 1;
158
#if 0
159
    serial_echo_print (b);
160
#endif
161
    printing = 0;
162
}
163
 
164
void update_scrmem (const struct vt * const vt, int start, int length)
165
{
166
}
167
 
168
void set_scrmem (const struct vt * const vt, long offset)
169
{
170
}
171
 
172
int con_set_font (char *arg)
173
{
174
    return -EINVAL;
175
}
176
 
177
int con_get_font (char *arg)
178
{
179
    return -EINVAL;
180
}
181
 
182
void con_reset_palette (const struct vt * const vt)
183
{
184
}
185
 
186
void con_set_palette (const struct vt * const vt)
187
{
188
}
189
 
190
/* == arm specific console code ============================================================== */
191
 
192
int do_screendump(int arg)
193
{
194
    return -EINVAL;
195
}
196
 
197
/*===============================================================================================*/
198
 
199
int vcd_init (struct vt *vt, int kmallocok, unsigned long *kmem)
200
{
201
    return 0;
202
}
203
 
204
unsigned long vcd_pre_init (unsigned long kmem, struct vt *vt)
205
{
206
#if 0   
207
    serial_echo_init (SERIAL_ECHO_PORT);
208
#endif
209
    printable = 1;
210
 
211
    printk ("Console: dummy console driver\n");
212
    register_console (console_print);
213
    return kmem;
214
}
215
 
216
void vcd_disallocate (struct vt *vt)
217
{
218
}
219
 
220
int vcd_resize(unsigned long lines, unsigned long cols)
221
{/* TODO */
222
        return -ENOMEM;
223
}
224
 
225
void vcd_blankscreen(int nopowersave)
226
{
227
}
228
 
229
void vcd_unblankscreen (void)
230
{
231
}
232
 
233
void vcd_savestate (const struct vt *vt, int blanked)
234
{
235
}
236
 
237
void vcd_restorestate (const struct vt *vt)
238
{
239
}
240
 
241
void vcd_setup_graphics (const struct vt *vt)
242
{
243
}
244
 
245
static char vcd_buffer[128];
246
int vcd_write (const struct vt *vt, int from_user, const unsigned char *buf, int count)
247
{
248
    int tmp = count;
249
    while (tmp) {
250
        int i;
251
 
252
        i = tmp < 127 ? tmp : 127;
253
 
254
        tmp -= i;
255
        memcpy (vcd_buffer, buf, i);
256
        buf += i;
257
 
258
        vcd_buffer[i] = 0;
259
#if 0
260
        serial_echo_print(vcd_buffer);
261
#endif
262
    }
263
    return count;
264
}
265
 
266
int vcd_ioctl (const struct vt *vt, int cmd, unsigned long arg)
267
{
268
    switch (cmd) {
269
    case PIO_FONT:
270
    case GIO_FONT:
271
    case PIO_SCRNMAP:
272
    case GIO_SCRNMAP:
273
    case PIO_UNISCRNMAP:
274
    case GIO_UNISCRNMAP:
275
    case PIO_UNIMAPCLR:
276
    case PIO_UNIMAP:
277
    case GIO_UNIMAP:
278
        return -EINVAL;
279
 
280
    default:
281
        return -ENOIOCTLCMD;
282
    }
283
}
284
 
285
void console_map_init (void)
286
{
287
}
288
 
289
/*
290
 * Report the current status of the vc. This is exported to modules (ARub)
291
 */
292
int con_get_info(int *mode, int *shift, int *col, int *row,
293
                        struct tty_struct **tty)
294
{
295
    if (mode) *mode = 0;
296
    if (shift) *shift = 0;
297
    if (col) *col = 0;
298
    if (row) *row = 0;
299
    if (tty) *tty = NULL;
300
    return 0;
301
}

powered by: WebSVN 2.1.0

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