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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [drivers/] [s390/] [char/] [hwc_con.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *  drivers/s390/char/hwc_con.c
3
 *    HWC line mode console driver
4
 *
5
 *  S390 version
6
 *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
7
 *    Author(s): Martin Peschke <mpeschke@de.ibm.com>
8
 */
9
 
10
#include <linux/config.h>
11
#include <linux/kernel.h>
12
#include <linux/major.h>
13
#include <linux/errno.h>
14
#include <linux/kdev_t.h>
15
#include <linux/string.h>
16
#include <linux/console.h>
17
#include <linux/fs.h>
18
#include <linux/init.h>
19
 
20
#include "hwc_rw.h"
21
 
22
#ifdef CONFIG_HWC_CONSOLE
23
 
24
#define  hwc_console_major 4
25
#define  hwc_console_minor 64
26
#define  hwc_console_name  "console"
27
 
28
void hwc_console_write (struct console *, const char *, unsigned int);
29
kdev_t hwc_console_device (struct console *);
30
void hwc_console_unblank (void);
31
 
32
#define  HWC_CON_PRINT_HEADER "hwc console driver: "
33
 
34
struct console hwc_console = {
35
        name:   hwc_console_name,
36
        write:  hwc_console_write,
37
        device: hwc_console_device,
38
        unblank:hwc_console_unblank,
39
        flags:  CON_PRINTBUFFER,
40
};
41
 
42
void
43
hwc_console_write (
44
                          struct console *console,
45
                          const char *message,
46
                          unsigned int count)
47
{
48
 
49
        if (console->device (console) != hwc_console.device (&hwc_console)) {
50
 
51
                hwc_printk (KERN_WARNING HWC_CON_PRINT_HEADER
52
                            "hwc_console_write() called with wrong "
53
                            "device number");
54
                return;
55
        }
56
        hwc_write (0, message, count);
57
}
58
 
59
kdev_t
60
hwc_console_device (struct console * c)
61
{
62
        return MKDEV (hwc_console_major, hwc_console_minor);
63
}
64
 
65
void
66
hwc_console_unblank (void)
67
{
68
        hwc_unblank ();
69
}
70
 
71
#endif
72
 
73
void __init
74
hwc_console_init (void)
75
{
76
        if (!MACHINE_HAS_HWC)
77
                return;
78
 
79
        if (hwc_init () == 0) {
80
#ifdef CONFIG_HWC_CONSOLE
81
 
82
                if (CONSOLE_IS_HWC)
83
                        register_console (&hwc_console);
84
#endif
85
        } else
86
                panic (HWC_CON_PRINT_HEADER "hwc initialisation failed !");
87
 
88
        return;
89
}

powered by: WebSVN 2.1.0

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