reboot.h revision 4817
11541Srgrimes/*
21541Srgrimes * Copyright (c) 1982, 1986, 1988, 1993
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 *
331541Srgrimes *	@(#)reboot.h	8.1 (Berkeley) 6/2/93
344817Sphk * $Id: reboot.h,v 1.6 1994/10/26 13:45:52 jkh Exp $
351541Srgrimes */
361541Srgrimes
372165Spaul#ifndef _SYS_REBOOT_H_
382165Spaul#define _SYS_REBOOT_H_
392165Spaul
401541Srgrimes/*
411541Srgrimes * Arguments to reboot system call.
421541Srgrimes * These are passed to boot program in r11,
431541Srgrimes * and on to init.
441541Srgrimes */
451541Srgrimes#define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
461541Srgrimes
471541Srgrimes#define	RB_ASKNAME	0x01	/* ask for file name to reboot from */
481541Srgrimes#define	RB_SINGLE	0x02	/* reboot to single user only */
491541Srgrimes#define	RB_NOSYNC	0x04	/* dont sync before reboot */
501541Srgrimes#define	RB_HALT		0x08	/* don't reboot, just halt */
511541Srgrimes#define	RB_INITNAME	0x10	/* name given for /etc/init (unused) */
521541Srgrimes#define	RB_DFLTROOT	0x20	/* use compiled-in rootdev */
531541Srgrimes#define	RB_KDB		0x40	/* give control to kernel debugger */
541541Srgrimes#define	RB_RDONLY	0x80	/* mount root fs read-only */
551541Srgrimes#define	RB_DUMP		0x100	/* dump kernel memory before reboot */
561541Srgrimes#define	RB_MINIROOT	0x200	/* mini-root present in memory at boot time */
573893Sjkh#define RB_CONFIG	0x400	/* invoke user configuration routing */
584817Sphk#define RB_VERBOSE	0x800	/* print all potentially useful info */
591541Srgrimes
601541Srgrimes/*
611541Srgrimes * Constants for converting boot-style device number to type,
621541Srgrimes * adaptor (uba, mba, etc), unit number and partition number.
631541Srgrimes * Type (== major device number) is in the low byte
641541Srgrimes * for backward compatibility.  Except for that of the "magic
651541Srgrimes * number", each mask applies to the shifted value.
661541Srgrimes * Format:
671541Srgrimes *	 (4) (4) (4) (4)  (8)     (8)
681541Srgrimes *	--------------------------------
691541Srgrimes *	|MA | AD| CT| UN| PART  | TYPE |
701541Srgrimes *	--------------------------------
711541Srgrimes */
721541Srgrimes#define	B_ADAPTORSHIFT		24
731541Srgrimes#define	B_ADAPTORMASK		0x0f
741541Srgrimes#define	B_ADAPTOR(val)		(((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
751541Srgrimes#define B_CONTROLLERSHIFT	20
761541Srgrimes#define B_CONTROLLERMASK	0xf
771541Srgrimes#define	B_CONTROLLER(val)	(((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
781541Srgrimes#define B_UNITSHIFT		16
791541Srgrimes#define B_UNITMASK		0xf
801541Srgrimes#define	B_UNIT(val)		(((val) >> B_UNITSHIFT) & B_UNITMASK)
811541Srgrimes#define B_PARTITIONSHIFT	8
821541Srgrimes#define B_PARTITIONMASK		0xff
831541Srgrimes#define	B_PARTITION(val)	(((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
841541Srgrimes#define	B_TYPESHIFT		0
851541Srgrimes#define	B_TYPEMASK		0xff
861541Srgrimes#define	B_TYPE(val)		(((val) >> B_TYPESHIFT) & B_TYPEMASK)
871541Srgrimes
881541Srgrimes#define	B_MAGICMASK	((u_long)0xf0000000)
891541Srgrimes#define	B_DEVMAGIC	((u_long)0xa0000000)
901541Srgrimes
911541Srgrimes#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
921541Srgrimes	(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
931541Srgrimes	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
941541Srgrimes	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
952165Spaul
962165Spaul#endif
97