1*ab9bcecdSsnj.\" $NetBSD: pmf.9lua,v 1.3 2016/02/15 20:33:18 snj Exp $ 24ef07b4fSmbalmer.\" 34ef07b4fSmbalmer.\" Copyright (c) 2013 Marc Balmer <mbalmer@NetBSD.org>. All rights reserved. 44ef07b4fSmbalmer.\" 54ef07b4fSmbalmer.\" Redistribution and use in source and binary forms, with or without 64ef07b4fSmbalmer.\" modification, are permitted provided that the following conditions 74ef07b4fSmbalmer.\" are met: 84ef07b4fSmbalmer.\" 1. Redistributions of source code must retain the above copyright 94ef07b4fSmbalmer.\" notice, this list of conditions and the following disclaimer. 104ef07b4fSmbalmer.\" 2. Redistributions in binary form must reproduce the above copyright 114ef07b4fSmbalmer.\" notice, this list of conditions and the following disclaimer in the 124ef07b4fSmbalmer.\" documentation and/or other materials provided with the distribution. 134ef07b4fSmbalmer.\" 3. Neither the name of the University nor the names of its contributors 144ef07b4fSmbalmer.\" may be used to endorse or promote products derived from this software 154ef07b4fSmbalmer.\" without specific prior written permission. 164ef07b4fSmbalmer.\" 174ef07b4fSmbalmer.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 184ef07b4fSmbalmer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 194ef07b4fSmbalmer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 204ef07b4fSmbalmer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 214ef07b4fSmbalmer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 224ef07b4fSmbalmer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 234ef07b4fSmbalmer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 244ef07b4fSmbalmer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 254ef07b4fSmbalmer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 264ef07b4fSmbalmer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 274ef07b4fSmbalmer.\" SUCH DAMAGE. 284ef07b4fSmbalmer.\" 294ef07b4fSmbalmer.\" 304ef07b4fSmbalmer.Dd October 29, 2013 314ef07b4fSmbalmer.Dt PMF 9lua 324ef07b4fSmbalmer.Os 334ef07b4fSmbalmer.Sh NAME 344ef07b4fSmbalmer.Nm pmf 354ef07b4fSmbalmer.Nd Lua binding to the power management framework 364ef07b4fSmbalmer.Sh SYNOPSIS 374ef07b4fSmbalmer.Cd "local pmf = require 'pmf'" 384ef07b4fSmbalmer.Pp 394ef07b4fSmbalmer.Bl -tag -width XXXX -compact 404ef07b4fSmbalmer.It Dv pmf.system_shutdown(howto) 414ef07b4fSmbalmer.It Dv pmf.set_platform(key, value) 424ef07b4fSmbalmer.It Dv value = pmf.get_platform(key) 434ef07b4fSmbalmer.El 444ef07b4fSmbalmer.Sh DESCRIPTION 454ef07b4fSmbalmerThe 464ef07b4fSmbalmer.Nm 474ef07b4fSmbalmerLua binding provides access to the power management framework. 484ef07b4fSmbalmer.Pp 494ef07b4fSmbalmer.Bl -tag -width XXXX -compact 504ef07b4fSmbalmer.It Dv pmf.system_shutdown(howto) 514ef07b4fSmbalmerShutdown all attached devices. 524ef07b4fSmbalmer.Ar howto 534ef07b4fSmbalmershould contain the 544ef07b4fSmbalmer.Xr reboot 2 554ef07b4fSmbalmer.Ar howto 564ef07b4fSmbalmerargument. 574ef07b4fSmbalmerThe following values are defined as constants in the 584ef07b4fSmbalmer.Nm 594ef07b4fSmbalmertable: 604ef07b4fSmbalmer.Pp 614ef07b4fSmbalmer.Bl -tag -width XXXX -compact 624ef07b4fSmbalmer.It Dv pmf.RB_AUTOBOOT 634ef07b4fSmbalmer.It Dv pmf.RB_ASKNAME 644ef07b4fSmbalmer.It Dv pmf.RB_DUMP 654ef07b4fSmbalmer.It Dv pmf.RB_HALT 664ef07b4fSmbalmer.It Dv pmf.RB_POWERDOWN 674ef07b4fSmbalmer.It Dv pmf.RB_KDB 684ef07b4fSmbalmer.It Dv pmf.RB_NOSYNC 694ef07b4fSmbalmer.It Dv pmf.RB_RDONLY 704ef07b4fSmbalmer.It Dv pmf.RB_SINGLE 714ef07b4fSmbalmer.It Dv pmf.RB_USERCONF 724ef07b4fSmbalmer.El 734ef07b4fSmbalmer.Pp 744ef07b4fSmbalmer.It Dv pmf.set_platform(key, value) 754ef07b4fSmbalmerInsert a name-value pair into the platform information database. 764ef07b4fSmbalmer.Pp 774ef07b4fSmbalmer.It Dv value = pmf.get_platform(key) 784ef07b4fSmbalmerRetrieve the value for 794ef07b4fSmbalmer.Ar key 804ef07b4fSmbalmerfrom the platform information database. 814ef07b4fSmbalmerReturns nil if the key is not present. 824ef07b4fSmbalmer.El 834ef07b4fSmbalmer.Sh SEE ALSO 844ef07b4fSmbalmer.Xr lua 1 , 854ef07b4fSmbalmer.Xr luac 1 , 864ef07b4fSmbalmer.Xr lua 4 , 873181678dSwiz.Xr pmf 9 , 883181678dSwiz.Xr intro 9lua 894ef07b4fSmbalmer.Sh HISTORY 90*ab9bcecdSsnjA 914ef07b4fSmbalmer.Nm 924ef07b4fSmbalmerLua manual appeared in 934ef07b4fSmbalmer.Nx 7.0 . 944ef07b4fSmbalmer.Sh AUTHORS 954ef07b4fSmbalmer.An -nosplit 964ef07b4fSmbalmerThe 974ef07b4fSmbalmer.Nm 984ef07b4fSmbalmerLua binding was written by 994ef07b4fSmbalmer.An Marc Balmer Aq Mt mbalmer@NetBSD.org . 100