Exemplo n.º 1
0
static void ulite_console_write(struct console *co, const char *s,
                                unsigned int count)
{
    struct uart_port *port = &ulite_ports[co->index];
    unsigned long flags;
    unsigned int ier;
    int locked = 1;

    if (oops_in_progress) {
        locked = spin_trylock_irqsave(&port->lock, flags);
    } else
        spin_lock_irqsave(&port->lock, flags);

    /* save and disable interrupt */
    ier = uart_in32(ULITE_STATUS, port) & ULITE_STATUS_IE;
    uart_out32(0, ULITE_CONTROL, port);

    uart_console_write(port, s, count, ulite_console_putchar);

    ulite_console_wait_tx(port);

    /* restore interrupt state */
    if (ier)
        uart_out32(ULITE_CONTROL_IE, ULITE_CONTROL, port);

    if (locked)
        spin_unlock_irqrestore(&port->lock, flags);
}
Exemplo n.º 2
0
static void ulite_console_write(struct console *co, const char *s,
				unsigned int count)
{
	struct uart_port *port = &ulite_ports[co->index];
	unsigned long flags;
	unsigned int ier;
	int locked = 1;

	if (oops_in_progress) {
		locked = spin_trylock_irqsave(&port->lock, flags);
	} else
		spin_lock_irqsave(&port->lock, flags);

	
	ier = readb(port->membase + ULITE_STATUS) & ULITE_STATUS_IE;
	writeb(0, port->membase + ULITE_CONTROL);

	uart_console_write(port, s, count, ulite_console_putchar);

	ulite_console_wait_tx(port);

	
	if (ier)
		writeb(ULITE_CONTROL_IE, port->membase + ULITE_CONTROL);

	if (locked)
		spin_unlock_irqrestore(&port->lock, flags);
}
Exemplo n.º 3
0
static void ulite_console_putchar(struct uart_port *port, int ch)
{
    ulite_console_wait_tx(port);
    uart_out32(ch, ULITE_TX, port);
}
Exemplo n.º 4
0
static void ulite_console_putchar(struct uart_port *port, int ch)
{
	ulite_console_wait_tx(port);
	writeb(ch, port->membase + ULITE_TX);
}