From owner-freebsd-current@FreeBSD.ORG Thu Dec 4 15:24:42 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 825601065676 for ; Thu, 4 Dec 2008 15:24:42 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.226]) by mx1.freebsd.org (Postfix) with ESMTP id 378F48FC23 for ; Thu, 4 Dec 2008 15:24:42 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so3933163rvf.43 for ; Thu, 04 Dec 2008 07:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=P9+FSBEuwritj6oHJDoVmtl7Aa9qHHxQeDCzOUHYTts=; b=I+pwStEpCAy/u7aGJeE2NrTMTi+hjhAZxFciRxE7VlG6vMKTcyhSyfB1qj1HzrIHKf tmrKROwG8nhcZNvus+I6mY92yUCGm3vNuuhS/Ft3POzxgUXWdUbFei8TOyGqbR5hWgYQ mn8k7mCUwvFCyRawyn6EeSqm8+jXLclfEgMbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=gLdno5Q//sWHIpMkdjY9bE4ee1U51KvI73FfxYpU8DGjfRcQMqtlPOURBaNL4esbS7 7EFA0AyDiBjpQNYDMIcEGdAD7hmVGEy23/qp9JyF506/yCxQSdOGqy8TkFRd3lU2QvYA g4Y/BhwlCi0uyDVjWtXc6ZXBz8pzVWYGNEUVM= Received: by 10.141.155.15 with SMTP id h15mr3514463rvo.158.1228404281906; Thu, 04 Dec 2008 07:24:41 -0800 (PST) Received: by 10.140.177.21 with HTTP; Thu, 4 Dec 2008 07:24:41 -0800 (PST) Message-ID: Date: Thu, 4 Dec 2008 07:24:41 -0800 From: "Maksim Yevmenkin" To: "Garrett Cooper" In-Reply-To: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> Cc: "current@freebsd.org" Subject: Re: RFC: small syscons and kbd patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2008 15:24:42 -0000 On Thu, Dec 4, 2008 at 3:24 AM, Garrett Cooper wrote: > On Tue, Dec 2, 2008 at 5:01 PM, Maksim Yevmenkin > 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