lkml.org 
[lkml]   [2007]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-04-18 21:11    [W:0.037 / U:0.084 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site