[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070418201205.60afc606@the-village.bc.nu>
Date: Wed, 18 Apr 2007 20:12:05 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Corey Minyard <minyard@....org>
Cc: Linux Kernel <linux-kernel@...r.kernel.org>,
linux-serial@...r.kernel.org
Subject: Re: [PATCH] Provide better abstraction for the serial drivers to
xmit buf and tty
> Currently the uart_info structure is allocated on an open, so it's not
> available until that point in time. The trouble is that console_init() is
> called before memory is set up, so you can't allocate the uart_info
> until it's too late for the console or a debugger that wants to work
> early, though it's ok for IPMI.
A debugger can provide a pre-existing uart_info and buffer. The
initialisation is only done if the uart_state->info pointer is NULL.
> The uart_info struct is not very big, maybe it would be best to pull that
> into uart_port? But the circ buffer might still be a problem, since it
> would need to be dynamically allocated and it might need to be
> checked instead.
How about this (untested idea in the finest Linux tradition)
Add
uart_console_prepare(struct uart_port *port, struct uart_info
*info, void *buffer)
{
port->info = info;
info->xmit.buf = buffer;
... etc ...
info->flags |= UPF_BOOTALLOCATED;
}
in uart_shutdown() check UPF_BOOTALLOCATED and don't free xmit.buf if so.
ditto in uart_remove_one_port for info itself
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists