reboot.h revision 14484
11541Srgrimes/*
214484Shsu * Copyright (c) 1982, 1986, 1988, 1993, 1994
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * Redistribution and use in source and binary forms, with or without
61541Srgrimes * modification, are permitted provided that the following conditions
71541Srgrimes * are met:
81541Srgrimes * 1. Redistributions of source code must retain the above copyright
91541Srgrimes *    notice, this list of conditions and the following disclaimer.
101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111541Srgrimes *    notice, this list of conditions and the following disclaimer in the
121541Srgrimes *    documentation and/or other materials provided with the distribution.
131541Srgrimes * 3. All advertising materials mentioning features or use of this software
141541Srgrimes *    must display the following acknowledgement:
151541Srgrimes *	This product includes software developed by the University of
161541Srgrimes *	California, Berkeley and its contributors.
171541Srgrimes * 4. Neither the name of the University nor the names of its contributors
181541Srgrimes *    may be used to endorse or promote products derived from this software
191541Srgrimes *    without specific prior written permission.
201541Srgrimes *
211541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311541Srgrimes * SUCH DAMAGE.
321541Srgrimes *
3314484Shsu *	@(#)reboot.h	8.3 (Berkeley) 12/13/94
3414484Shsu * $Id: reboot.h,v 1.11 1996/02/24 06:46:17 hsu Exp $
351541Srgrimes */
361541Srgrimes
372165Spaul#ifndef _SYS_REBOOT_H_
382165Spaul#define _SYS_REBOOT_H_
392165Spaul
401541Srgrimes/*
4114484Shsu * Arguments to reboot system call.  These are passed to
4214484Shsu * the boot program and on to init.
431541Srgrimes */
441541Srgrimes#define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
451541Srgrimes
4614484Shsu#define	RB_ASKNAME	0x001	/* ask for file name to reboot from */
4714484Shsu#define	RB_SINGLE	0x002	/* reboot to single user only */
4814484Shsu#define	RB_NOSYNC	0x004	/* dont sync before reboot */
4914484Shsu#define	RB_HALT		0x008	/* don't reboot, just halt */
5014484Shsu#define	RB_INITNAME	0x010	/* name given for /etc/init (unused) */
5114484Shsu#define	RB_DFLTROOT	0x020	/* use compiled-in rootdev */
5214484Shsu#define	RB_KDB		0x040	/* give control to kernel debugger */
5314484Shsu#define	RB_RDONLY	0x080	/* mount root fs read-only */
541541Srgrimes#define	RB_DUMP		0x100	/* dump kernel memory before reboot */
551541Srgrimes#define	RB_MINIROOT	0x200	/* mini-root present in memory at boot time */
563893Sjkh#define RB_CONFIG	0x400	/* invoke user configuration routing */
574817Sphk#define RB_VERBOSE	0x800	/* print all potentially useful info */
585743Swpaul#define	RB_SERIAL	0x1000	/* user serial port as console */
597951Sphk#define	RB_CDROM	0x2000	/* use cdrom as root */
601541Srgrimes
615896Sbde#define	RB_BOOTINFO	0x80000000	/* have `struct bootinfo *' arg */
625896Sbde
631541Srgrimes/*
641541Srgrimes * Constants for converting boot-style device number to type,
651541Srgrimes * adaptor (uba, mba, etc), unit number and partition number.
661541Srgrimes * Type (== major device number) is in the low byte
671541Srgrimes * for backward compatibility.  Except for that of the "magic
681541Srgrimes * number", each mask applies to the shifted value.
691541Srgrimes * Format:
701541Srgrimes *	 (4) (4) (4) (4)  (8)     (8)
711541Srgrimes *	--------------------------------
721541Srgrimes *	|MA | AD| CT| UN| PART  | TYPE |
731541Srgrimes *	--------------------------------
741541Srgrimes */
751541Srgrimes#define	B_ADAPTORSHIFT		24
761541Srgrimes#define	B_ADAPTORMASK		0x0f
771541Srgrimes#define	B_ADAPTOR(val)		(((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
781541Srgrimes#define B_CONTROLLERSHIFT	20
791541Srgrimes#define B_CONTROLLERMASK	0xf
801541Srgrimes#define	B_CONTROLLER(val)	(((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
811541Srgrimes#define B_UNITSHIFT		16
821541Srgrimes#define B_UNITMASK		0xf
831541Srgrimes#define	B_UNIT(val)		(((val) >> B_UNITSHIFT) & B_UNITMASK)
841541Srgrimes#define B_PARTITIONSHIFT	8
851541Srgrimes#define B_PARTITIONMASK		0xff
861541Srgrimes#define	B_PARTITION(val)	(((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
871541Srgrimes#define	B_TYPESHIFT		0
881541Srgrimes#define	B_TYPEMASK		0xff
891541Srgrimes#define	B_TYPE(val)		(((val) >> B_TYPESHIFT) & B_TYPEMASK)
901541Srgrimes
9114484Shsu#define	B_MAGICMASK	0xf0000000
9214484Shsu#define	B_DEVMAGIC	0xa0000000
931541Srgrimes
941541Srgrimes#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
951541Srgrimes	(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
961541Srgrimes	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
971541Srgrimes	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
982165Spaul
992165Spaul#endif
100