1.\" $OpenBSD: power.4,v 1.5 2007/05/31 19:19:54 jmc Exp $ 2.\" 3.\" Copyright (c) 2003 Michael Shalayeff 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF MIND, 21.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd $Mdocdate: May 31 2007 $ 27.Dt POWER 4 hppa 28.Os 29.Sh NAME 30.Nm power 31.Nd power button and power fail support 32.Sh SYNOPSIS 33.Cd "power0 at mainbus?" 34.Sh DESCRIPTION 35.Tn HP PA-RISC 36machines support power failure detection in different forms: 37.Pp 38.Bl -bullet -offset indent -compact 39.It 40.Dq soft 41power button 42.It 43power failure interrupt 44.El 45.Pp 46The 47.Nm 48driver tries its best to determine the power failure condition 49that is a result of a power button being depressed or a power supply 50system failure or a similar condition. 51Upon detection of any of the aforementioned conditions, it tries to gracefully 52.Pq if possible 53shutdown the system through a call to the 54.Xr boot 9 55function. 56.Pp 57On systems equipped with the 58.Xr lasi 4 59bus adapter, we find a 60.Dq soft 61power button which upon depression gives us a signal in the 62.Dq power register 63and thus polling periodically we detect the event. 64Since that bit comes directly from the power button without any dampening, 65we perform a second long delay; 66thus quick transitions off and on will 67.Em not 68result in a shutdown. 69.Pp 70On modern systems, an interruption is signalled upon the power 71button depression and thus this avoids polling and does not require 72.Pq as does being implemented in hardware 73dampening. 74.Sh SEE ALSO 75.Xr intro 4 , 76.Xr lasi 4 , 77.Xr pdc 4 , 78.Xr boot 9 79.Sh HISTORY 80The 81.Nm 82driver 83appeared in 84.Ox 3.4 . 85