From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 17 19:51:06 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28B1E106566C for ; Wed, 17 Mar 2010 19:51:06 +0000 (UTC) (envelope-from gonzo@launchpad.bluezbox.com) Received: from launchpad.bluezbox.com (launchpad.bluezbox.com [195.137.202.161]) by mx1.freebsd.org (Postfix) with ESMTP id C1D768FC16 for ; Wed, 17 Mar 2010 19:51:05 +0000 (UTC) Received: from [76.77.86.2] (helo=[192.168.100.164]) by launchpad.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NryiA-0006VW-LW; Wed, 17 Mar 2010 19:15:26 +0000 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Oleksandr Tymoshenko In-Reply-To: Date: Wed, 17 Mar 2010 12:14:49 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alex RAY X-Mailer: Apple Mail (2.1077) Sender: gonzo@launchpad.bluezbox.com X-Spam-Level: ---- X-Spam-Report: -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.2 SUBJECT_FUZZY_TION Attempt to obfuscate words in Subject: -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] -0.2 AWL AWL: From: address is in the auto white-list Cc: hackers@freebsd.org Subject: Re: GPIO button and userspace X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 19:51:06 -0000 On 2010-03-17, at 12:04 PM, Alex RAY wrote: > Hackers > help find the correct answer, in what way I can send interrupt on GPIO = to > the userspace script. > I know that I can make the device, and open it in program, but it is > cumbersome. > I know what I can run the script from the kernel, as in Linux, but I = think > this is not the right way? IMHO the best way to implement it is to run scripts through devd. = e.g. create use subsystem "GPIO" and few event types: "BUTTON_DOWN", "BUTTON_UP", /add yours here/. =46rom the kernel side it's just a matter of calling = devctl_notify if I got it right. --=20 gonzo