Subject: Re: Fixing {get,put}wschar functions
To: Michael Lorenz <macallan@NetBSD.org>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 04/12/2006 08:57:48
Michael Lorenz wrote:
> Hello,
>
>   
>> I was improving the changes to make the get/putwschar functions not
>> use void pointers as suggested by drochner@ when I noticed an ugly
>> issue.
>>
>> With the previous code, you could only get/put characters from the
>> screen you owned.  I.e., if you opened /dev/ttyE0, you could only
>> get/set its characters, no matter if it was active or not.
>>     
>
> The ioctl() and mmap() methods should really, really know which device
> node they're being called from. Stuff like colour maps, read/write
> characters and so on should work on individual screens, not the whole
> thing.
>
> have fun
> Michael
>   

I'll test this today.  I've got a test program which does various ioctls
and also mmaps the buffer.  It will be easy to see.  I sort of think
that the mmap logic probably doesn't respect which screen is *visible*
at the time, and that would represent a gross error.   The error in this
case may be in my own radeonfb driver, but I want to examine the
wsdisplay and vcons code to see if they have any logic associated with
it.  It seems like they could and maybe should, guard against this kind
of behavior.

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191