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/] [console-dummy.c] - 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/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
#define SERIAL_ECHO_PORT        0x2f8
72
#define SERIAL_ECHO_DIVISOR     3
73
 
74
#include "serialecho.c"
75
 
76
/*
77
 * functions to handle /dev/fb
78
 */
79
int con_fb_read(char *buf, unsigned long pos, int count)
80
{
81
        return -EIO;
82
}
83
 
84
int con_fb_write(const char *buf, unsigned long pos, int count)
85
{
86
        return -EIO;
87
}
88
 
89
int con_fb_mmap(unsigned long vma_start, unsigned long vma_offset,
90
                        unsigned long vma_end, pgprot_t prot)
91
{
92
        return -EINVAL;
93
}
94
 
95
void no_scroll (char *str, int *ints)
96
{
97
}
98
 
99
void mouse_report (struct tty_struct *tty, int butt, int mrx, int mry)
100
{
101
}
102
 
103
int mouse_reporting (void)
104
{
105
    return 0;
106
}
107
 
108
static inline unsigned long *bufferpos (const struct vt * const vt, int offset)
109
{
110
    return NULL;
111
}
112
 
113
void invert_screen (const struct vt * const vt, unsigned int offset, unsigned int count)
114
{
115
}
116
 
117
void complement_pos (const struct vt * const vt, unsigned int offset)
118
{
119
}
120
 
121
unsigned long screen_word (const struct vt * const vt, unsigned int offset)
122
{
123
    return 0;
124
}
125
 
126
int scrw2glyph (unsigned long scr_word)
127
{
128
    return 0;
129
}
130
 
131
unsigned long *screen_pos (const struct vt * const vt, unsigned int offset)
132
{
133
    return NULL;
134
}
135
 
136
void getconsxy (const struct vt * const vt, char *p)
137
{
138
    p[0] = p[1] = 0;
139
}
140
 
141
void putconsxy (const struct vt * const vt, char *p)
142
{
143
}
144
 
145
void console_print(const char *b)
146
{
147
    static int printing = 0;
148
 
149
    if (!printable || printing)
150
        return;  /* console not yet initialized */
151
 
152
    printing = 1;
153
    serial_echo_print (b);
154
    printing = 0;
155
}
156
 
157
void update_scrmem (const struct vt * const vt, int start, int length)
158
{
159
}
160
 
161
void set_scrmem (const struct vt * const vt, long offset)
162
{
163
}
164
 
165
int con_set_font (char *arg)
166
{
167
    return -EINVAL;
168
}
169
 
170
int con_get_font (char *arg)
171
{
172
    return -EINVAL;
173
}
174
 
175
void con_reset_palette (const struct vt * const vt)
176
{
177
}
178
 
179
void con_set_palette (const struct vt * const vt)
180
{
181
}
182
 
183
/* == arm specific console code ============================================================== */
184
 
185
int do_screendump(int arg)
186
{
187
    return -EINVAL;
188
}
189
 
190
/*===============================================================================================*/
191
 
192
int vcd_init (struct vt *vt, int kmallocok, unsigned long *kmem)
193
{
194
    return 0;
195
}
196
 
197
unsigned long vcd_pre_init (unsigned long kmem, struct vt *vt)
198
{
199
    serial_echo_init (SERIAL_ECHO_PORT);
200
    printable = 1;
201
 
202
    printk ("Console: dummy console driver\n");
203
    register_console (console_print);
204
    return kmem;
205
}
206
 
207
void vcd_disallocate (struct vt *vt)
208
{
209
}
210
 
211
int vcd_resize(unsigned long lines, unsigned long cols)
212
{/* TODO */
213
        return -ENOMEM;
214
}
215
 
216
void vcd_blankscreen(int nopowersave)
217
{
218
}
219
 
220
void vcd_unblankscreen (void)
221
{
222
}
223
 
224
void vcd_savestate (const struct vt *vt, int blanked)
225
{
226
}
227
 
228
void vcd_restorestate (const struct vt *vt)
229
{
230
}
231
 
232
void vcd_setup_graphics (const struct vt *vt)
233
{
234
}
235
 
236
static char vcd_buffer[128];
237
int vcd_write (const struct vt *vt, int from_user, const unsigned char *buf, int count)
238
{
239
    int tmp = count;
240
    while (tmp) {
241
        int i;
242
 
243
        i = tmp < 127 ? tmp : 127;
244
 
245
        tmp -= i;
246
        memcpy (vcd_buffer, buf, i);
247
        buf += i;
248
 
249
        vcd_buffer[i] = 0;
250
        serial_echo_print(vcd_buffer);
251
    }
252
    return count;
253
}
254
 
255
int vcd_ioctl (const struct vt *vt, int cmd, unsigned long arg)
256
{
257
    switch (cmd) {
258
    case PIO_FONT:
259
    case GIO_FONT:
260
    case PIO_SCRNMAP:
261
    case GIO_SCRNMAP:
262
    case PIO_UNISCRNMAP:
263
    case GIO_UNISCRNMAP:
264
    case PIO_UNIMAPCLR:
265
    case PIO_UNIMAP:
266
    case GIO_UNIMAP:
267
        return -EINVAL;
268
 
269
    default:
270
        return -ENOIOCTLCMD;
271
    }
272
}
273
 
274
void console_map_init (void)
275
{
276
}
277
 
278
/*
279
 * Report the current status of the vc. This is exported to modules (ARub)
280
 */
281
int con_get_info(int *mode, int *shift, int *col, int *row,
282
                        struct tty_struct **tty)
283
{
284
    if (mode) *mode = 0;
285
    if (shift) *shift = 0;
286
    if (col) *col = 0;
287
    if (row) *row = 0;
288
    if (tty) *tty = NULL;
289
    return 0;
290
}

powered by: WebSVN 2.1.0

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