From owner-freebsd-i386@FreeBSD.ORG Sat Jan 17 08:50:29 2004 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7725E16A4CE for ; Sat, 17 Jan 2004 08:50:29 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FAF743D4C for ; Sat, 17 Jan 2004 08:50:22 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0HGoMFR095605 for ; Sat, 17 Jan 2004 08:50:22 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0HGoMAl095604; Sat, 17 Jan 2004 08:50:22 -0800 (PST) (envelope-from gnats) Resent-Date: Sat, 17 Jan 2004 08:50:22 -0800 (PST) Resent-Message-Id: <200401171650.i0HGoMAl095604@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Norbert Koch Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACD3A16A4CF for ; Sat, 17 Jan 2004 08:41:40 -0800 (PST) Received: from mx2.ngi.de (mx2.ngi.de [213.191.74.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 910AA43D2F for ; Sat, 17 Jan 2004 08:41:37 -0800 (PST) (envelope-from nkoch@gmx.com) Received: (qmail 16230 invoked from network); 17 Jan 2004 16:34:02 -0000 Received: from unknown (HELO k62300.koch) ([195.71.52.55]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 17 Jan 2004 16:34:02 -0000 Received: from k62300.koch (localhost [127.0.0.1]) by k62300.koch (8.12.3/8.12.6) with ESMTP id i0HGg5mA000617 for ; Sat, 17 Jan 2004 17:42:05 +0100 (CET) (envelope-from nk@k62300.koch) Received: (from nk@localhost) by k62300.koch (8.12.3/8.12.10/Submit) id i0HGg0wp000615; Sat, 17 Jan 2004 17:42:00 +0100 (CET) (envelope-from nk) Message-Id: <200401171642.i0HGg0wp000615@k62300.koch> Date: Sat, 17 Jan 2004 17:42:00 +0100 (CET) From: Norbert Koch To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: i386/61481: a mechanism to wire io-channel-check to userland X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Norbert Koch List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2004 16:50:29 -0000 >Number: 61481 >Category: i386 >Synopsis: a mechanism to wire io-channel-check to userland >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Jan 17 08:50:21 PST 2004 >Closed-Date: >Last-Modified: >Originator: Norbert Koch >Release: FreeBSD 4.9-STABLE i386 >Organization: >Environment: System: FreeBSD k62300.koch 4.9-STABLE FreeBSD 4.9-STABLE #0: Thu Jan 1 18:47:59 CET 2004 root@k62300.koch:/usr/src/sys/compile/K62300IOCHK i386 >Description: I am using FreeBSD in an embedded product. Most of our disk activity goes to a static ram disk. As power failures are a normal operating condition we need some way to ensure that the filesystem on our ram disk is not corrupted. Our power supply's power fail signal is wired to our cpu board's io-channel-check signal which triggers an nmi. I made a small modification to i386/i386/trap.c to allow this condition to be signaled to userland via a selectable signal. I added a sysctl and mis-used an (hopefully) unused syscall. The syscall expects a signal number (or -1 for uninstalling). Only processes with uid=0 are allowed to do this. When power fails my application logs the powerfail to a file on the sram disk, calls sync() and then idles until power goes off. >How-To-Repeat: >Fix: See enclosed patches against 4.9-stable. >Release-Note: >Audit-Trail: >Unformatted: