[RFC][PATCH] discontiguous vterms

Hollis Blanchard hollisb at us.ibm.com
Wed Nov 5 07:46:02 EST 2003


Paul Mackerras wrote:
> Hollis Blanchard writes:
>
>>In practice, for us, they probably are contiguous. However,
>>transforming a list of vty at N nodes (from find_devices()) into [base,
>>number] in hvc_count() is a bit awkward at best, and could end up
>>making some assumptions about the order in which OF presents device
>>nodes to us. Also, this discontiguous functionality might be useful in
>>other environments (e.g. PPC simulators). So hvc_get_vterms() replaces
>>hvc_count() to communicate the vterm numbers.
>
> Any chance of these things appearing and disappearing at runtime?
> Perhaps we should have the arch code calling some hvc_console routine
> to tell it about consoles, rather than having hvc_console calling arch
> code to discover the consoles as at present. The only thing is that
> getting the `add_console' routine called at the right time in the boot
> sequence might be interesting.

This patch (vs 2.4 bk) does what you suggest. Overall description:

- Breaks out struct hvc_struct into include/linux/hvconsole.h . It can
be include/asm-ppc64/hvconsole.h if you like, but there's nothing
arch-specific about it.
- Breaks out the arch-specific code from
arch/ppc64/kernel/pSeries_lpar.c to arch/ppc64/kernel/hvconsole.c

(Note that I'm not quite sure what to do about the copyrights for those
new files; the code is mostly Anton's and Paul's, and I'm just moving it.)

- Have arch code call hvc_instantiate to notify the driver of a new
console. Right now this discovery is triggered from hvc_console_init(),
which is called from drivers/char/tty_io.c relatively early at boot.
(Right now hvc_instantiate is pretty dumb, but right now we're not doing
any hotplugging either.)
- Make the transport code (hvc_put/get_chars) per-hvc rather than
per-arch. This is to handle the case where one console uses the Host
Virtual Serial Interface (which I'm about to implement) but others use
the normal vty console. An ioctl call has also been added, which will be
needed for HVSI support.
- Supports discontiguous vterm numbers.

This code has been tested.

I'd like to get this committed to the 2.4 bk very soon so that I can
implement HVSI while developers in other organizations are working on it
too (which is now).

-Hollis
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hvc.diff
Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20031104/083ea55e/attachment.txt 


More information about the Linuxppc64-dev mailing list