1.\" $NetBSD: cpu_reboot.9,v 1.2 1996/09/24 07:01:26 ghudson Exp $ 2.\" 3.\" Copyright (c) 1994 Christopher G. Demetriou 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.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Christopher G. Demetriou 17.\" for the NetBSD Project. 18.\" 3. The name of the author may not be used to endorse or promote products 19.\" derived from this software without specific prior written permission 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31.\" 32.Dd November 13, 1995 33.Dt BOOT 9 34.Os NetBSD 35.Sh NAME 36.Nm boot 37.Nd halt or reboot the system 38.Sh SYNOPSIS 39.Fd #include <sys/reboot.h> 40.Ft void 41.Fn boot "int howto" "char *bootstr" 42.Sh DESCRIPTION 43The 44.Fn boot 45function handles final system shutdown, and either halts or reboots 46the system. The exact action to be taken is determined by the 47flags passed in 48.Fa howto 49and by whether or not the system has finished autoconfiguration. 50.Pp 51If the system has finished autoconfiguration, 52.Fn boot 53does the following: 54.Bl -enum -offset indent 55.It 56Sets the 57.Va boothowto 58system variable from the 59.Fa howto 60argument. 61.It 62If this is the first invocation of 63.Fn boot 64and the 65.Dv RB_NOSYNC 66flag is not set in 67.Fa howto , 68syncs and unmounts the system disks by calling 69.Xr vfs_shutdown 9 70and sets the time of day clock by calling 71.Xr resettodr 9 . 72.It 73Disables interrupts. 74.It 75If rebooting after a crash (i.e. if 76.Dv RB_DUMP 77is set in 78.Fa howto , 79but 80.Dv RB_HALT 81is not), saves a system crash dump. 82.It 83Runs any shutdown hooks by calling 84.Xr doshutdownhooks 9 . 85.It 86Prints a message indicating that the system is about to be halted 87or rebooted. 88.It 89If 90.Dv RB_HALT 91is set in 92.Fa howto , 93halts the system. 94Otherwise, reboots the system. 95.El 96.Pp 97If the system has not finished autoconfiguration, 98.Fn boot 99runs any shutdown hooks by calling 100.Xr doshutdownhooks 9 , 101prints a message, and halts the system. 102.Pp 103If 104.Dv RB_STRING 105is set in 106.Pa howto , 107then the parameter 108.Fa bootstr 109is passed to the system boot loader on some ports. 110.Sh SEE ALSO 111.Xr doshutdownhooks 9 , 112.Xr resettodr 9 , 113.Xr vfs_shutdown 9 114