[RFC PATCH 3/3] add hvc backend for rtas

Milton Miller miltonm at bga.com
Sat Dec 17 15:44:16 EST 2005


On Dec 16, 2005, at 6:57 PM, Benjamin Herrenschmidt wrote:

>
>> +#define hvc_rtas_cookie 0x67781e15
>
> What is the point of these "cookies" ? Magic numbers are evil !
>
> Ben.

The cookie is actually the hypervisor defined vterm number retrieved 
from the device tree for the case of multiple vterm devices managed by 
the hardware.  This is used to correlate the console selected by device 
tree scan with the tty instantiated by vio device scanning in the hvc 
driver.

While the cookie could be zero, defining it non-zero per driver means 
that if two console drivers both register with the core, we will 
guarantee that /dev/console output is sent to the same driver as the 
kernel printks.  The other driver will get assigned a minor number 
above the last minor requested during the first scan.

So while not strictly necessary in these single-channel drivers, it is 
very necessary for multi-channel drivers like the hvc vio driver.

milton




More information about the Linuxppc64-dev mailing list