From owner-freebsd-current@FreeBSD.ORG Fri Oct 9 10:58:28 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D8B51065672 for ; Fri, 9 Oct 2009 10:58:28 +0000 (UTC) (envelope-from syso.fml@ext.no-route.org) Received: from core.kel1.no-route.org (core.kel1.no-route.org [217.70.192.207]) by mx1.freebsd.org (Postfix) with ESMTP id C78EB8FC0C for ; Fri, 9 Oct 2009 10:58:27 +0000 (UTC) Received: from [0.0.0.0] (isis.kel.no-route.org [217.70.197.44]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by core.kel1.no-route.org (Postfix) with ESMTPSA id EDF9B13F6DC for ; Fri, 9 Oct 2009 10:38:48 +0000 (UTC) Message-ID: <4ACF131C.1060201@ext.no-route.org> Date: Fri, 09 Oct 2009 12:40:28 +0200 From: Sylwester Sosnowski User-Agent: some piece of software MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Support for PC Engines ALIX2 reset pushbutton. 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: Fri, 09 Oct 2009 10:58:28 -0000 Hello, I've just written an user-space utility for handling the PC Enginges ALIX' reset-pushbutton. It's a quick-and-dirty prototype and does the same what "shutdown -h now" does. I'll do a clean rewrite later. Any comments or suggestions appreciated. Here is the prototype: ----- BEGIN ----- /* * User-space reset-button support for PC Engines ALIX boards. * This is a prototype. * * Usage: * Use from rc(8). */ #include #include #include #include #include #include #include #include #include #include #include #include // MY_NAME is the process name used in syslog. #define MY_NAME "resetguard" // GPIO_RESET u_int32_t switchAddr = 0x61b0; int switchBit = 8; // GPIO_LED3 u_int32_t ledAddr = 0x6180; int ledBit = 11; // Blink GPIO_LED3. void blinkLed(int times) { int i; for (i=0; i