Subversion Repositories HelenOS-historic

Rev

Rev 575 | Rev 590 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 575 Rev 577
Line 31... Line 31...
31
#include <arch/drivers/serial.h>
31
#include <arch/drivers/serial.h>
32
#include <console/chardev.h>
32
#include <console/chardev.h>
33
#include <console/console.h>
33
#include <console/console.h>
34
 
34
 
35
static chardev_t console;
35
static chardev_t console;
36
 
-
 
37
static serial_t sconf[SERIAL_MAX];
36
static serial_t sconf[SERIAL_MAX];
-
 
37
static bool kb_enabled;
38
 
38
 
39
static void serial_write(chardev_t *d, const char ch)
39
static void serial_write(chardev_t *d, const char ch)
40
{
40
{
41
    int i;
41
    int i;
42
    serial_t *sd = (serial_t *)d->data;
42
    serial_t *sd = (serial_t *)d->data;
Line 49... Line 49...
49
    SERIAL_WRITE(sd->port, ch);
49
    SERIAL_WRITE(sd->port, ch);
50
}
50
}
51
 
51
 
52
static void serial_enable(chardev_t *d)
52
static void serial_enable(chardev_t *d)
53
{
53
{
-
 
54
    kb_enabled = true;
54
}
55
}
55
 
56
 
56
static void serial_disable(chardev_t *d)
57
static void serial_disable(chardev_t *d)
57
{
58
{
-
 
59
    kb_enabled = false;
58
}
60
}
59
 
61
 
60
int serial_init(void)
62
int serial_init(void)
61
{
63
{
62
    int i = 0;
64
    int i = 0;
Line 105... Line 107...
105
    serial_t *sd = &sconf[0];
107
    serial_t *sd = &sconf[0];
106
 
108
 
107
 
109
 
108
    chardev_initialize("serial_console", &console, &serial_ops);
110
    chardev_initialize("serial_console", &console, &serial_ops);
109
    console.data = sd;
111
    console.data = sd;
-
 
112
    kb_enabled = true;
110
 
113
 
111
//  exc_register(2, "serial_drvr", serial_interrupt);
114
//  exc_register(2, "serial_drvr", serial_interrupt);
112
    /* I don't know why, but the serial interrupts simply
115
    /* I don't know why, but the serial interrupts simply
113
     * don't work on simics
116
     * don't work on simics
114
     */
117
     */