RFC: small syscons and kbd patch

Maksim Yevmenkin maksim.yevmenkin at gmail.com
Thu Dec 4 07:24:42 PST 2008


On Thu, Dec 4, 2008 at 3:24 AM, Garrett Cooper <yanefbsd at gmail.com> wrote:
> On Tue, Dec 2, 2008 at 5:01 PM, Maksim Yevmenkin
> <maksim.yevmenkin at gmail.com> wrote:
>> Dear Hackers,
>>
>> can someone please review the attached small patch for syscons and
>> kbd? it should be a no-op mostly. the patch basically does
>>
>> 1) removes bogus layering in syscons, i.e. basically removes sccngetch();
>> 2) implements advisory lock for kbd (based on atomic(9));
>> 3) implements new POLLED flag for kbd;
>>
>> this is a part of a plan to fix keyboard access races in syscons.
>>
>> thanks,
>> max
>
> Max,
>     Why are you double and triple negating on this line?
>
> +       return (atomic_cmpset_acq_int(&kbd->kb_locked, !!!on, !!on));

the idea was to ensure that kbd->kb_locked variable only takes values
0 (zero) and 1 (one).

thanks,
max


More information about the freebsd-current mailing list