Blame sysdeps/mach/sys/reboot.h

Packit 6c4009
/*
Packit 6c4009
 * Mach Operating System
Packit 6c4009
 * Copyright (C) 1993,1991,1990 Carnegie Mellon University
Packit 6c4009
 * All Rights Reserved.
Packit 6c4009
 *
Packit 6c4009
 * Permission to use, copy, modify and distribute this software and its
Packit 6c4009
 * documentation is hereby granted, provided that both the copyright
Packit 6c4009
 * notice and this permission notice appear in all copies of the
Packit 6c4009
 * software, derivative works or modified versions, and any portions
Packit 6c4009
 * thereof, and that both notices appear in supporting documentation.
Packit 6c4009
 *
Packit 6c4009
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
Packit 6c4009
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
Packit 6c4009
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
Packit 6c4009
 *
Packit 6c4009
 * Carnegie Mellon requests users of this software to return to
Packit 6c4009
 *
Packit 6c4009
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
Packit 6c4009
 *  School of Computer Science
Packit 6c4009
 *  Carnegie Mellon University
Packit 6c4009
 *  Pittsburgh PA 15213-3890
Packit 6c4009
 *
Packit 6c4009
 * any improvements or extensions that they make and grant Carnegie Mellon
Packit 6c4009
 * the rights to redistribute these changes.
Packit 6c4009
 */
Packit 6c4009
/*
Packit 6c4009
 * (pre-GNU) HISTORY
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.8  93/03/11  13:46:40  danner
Packit 6c4009
 * 	unsigned long -> unsigned int.
Packit 6c4009
 * 	[93/03/09            danner]
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.7  92/05/21  17:25:11  jfriedl
Packit 6c4009
 * 	Appended 'U' to constants that would otherwise be signed.
Packit 6c4009
 * 	[92/05/16            jfriedl]
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.6  91/06/19  11:59:44  rvb
Packit 6c4009
 * 	Second byte of boothowto is flags for "startup" program.
Packit 6c4009
 * 	[91/06/18            rvb]
Packit 6c4009
 * 	Add ifndef __ASSEMBLER__ so that vax_init.s can include it.
Packit 6c4009
 * 	[91/06/11            rvb]
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.5  91/05/14  17:40:11  mrt
Packit 6c4009
 * 	Correcting copyright
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.4  91/02/05  17:56:48  mrt
Packit 6c4009
 * 	Changed to new Mach copyright
Packit 6c4009
 * 	[91/02/01  17:49:12  mrt]
Packit 6c4009
 *
Packit 6c4009
 * Revision 2.3  90/08/27  22:12:56  dbg
Packit 6c4009
 * 	Added definitions used by Mach Kernel: RB_DEBUGGER, RB_UNIPROC,
Packit 6c4009
 * 	RB_NOBOOTRC, RB_ALTBOOT.  Moved RB_KDB to 0x04 (Mach value).
Packit 6c4009
 * 	Removed RB_RDONLY, RB_DUMP, RB_NOSYNC.
Packit 6c4009
 * 	[90/08/14            dbg]
Packit 6c4009
 *
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
   Copyright (C) 1982, 1986, 1988 Regents of the University of California.
Packit 6c4009
   All rights reserved.
Packit 6c4009
Packit 6c4009
   Redistribution and use in source and binary forms, with or without
Packit 6c4009
   modification, are permitted provided that the following conditions
Packit 6c4009
   are met:
Packit 6c4009
Packit 6c4009
   1. Redistributions of source code must retain the above copyright
Packit 6c4009
      notice, this list of conditions and the following disclaimer.
Packit 6c4009
   2. Redistributions in binary form must reproduce the above copyright
Packit 6c4009
      notice, this list of conditions and the following disclaimer in the
Packit 6c4009
      documentation and/or other materials provided with the distribution.
Packit 6c4009
   4. Neither the name of the University nor the names of its contributors
Packit 6c4009
      may be used to endorse or promote products derived from this software
Packit 6c4009
      without specific prior written permission.
Packit 6c4009
Packit 6c4009
   THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
Packit 6c4009
   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 6c4009
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit 6c4009
   ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
Packit 6c4009
   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit 6c4009
   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit 6c4009
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit 6c4009
   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit 6c4009
   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit 6c4009
   SUCH DAMAGE.*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	@(#)reboot.h	7.5 (Berkeley) 6/27/88
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef	_SYS_REBOOT_H_
Packit 6c4009
#define	_SYS_REBOOT_H_
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Arguments to reboot system call.
Packit 6c4009
 * These are converted to switches, and passed to startup program,
Packit 6c4009
 * and on to init.
Packit 6c4009
 */
Packit 6c4009
#define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */
Packit 6c4009
Packit 6c4009
#define	RB_ASKNAME	0x01	/* -a: ask for file name to reboot from */
Packit 6c4009
#define	RB_SINGLE	0x02	/* -s: reboot to single user only */
Packit 6c4009
#define	RB_KDB		0x04	/* -d: kernel debugger symbols loaded */
Packit 6c4009
#define	RB_HALT		0x08	/* -h: enter KDB at bootup */
Packit 6c4009
				/*     for host_reboot(): don't reboot,
Packit 6c4009
				       just halt */
Packit 6c4009
#define	RB_INITNAME	0x10	/* -i: name given for /etc/init (unused) */
Packit 6c4009
#define	RB_DFLTROOT	0x20	/*     use compiled-in rootdev */
Packit 6c4009
#define	RB_NOBOOTRC	0x20	/* -b: don't run /etc/rc.boot */
Packit 6c4009
#define RB_ALTBOOT	0x40	/*     use /boot.old vs /boot */
Packit 6c4009
#define	RB_UNIPROC	0x80	/* -u: start only one processor */
Packit 6c4009
Packit 6c4009
#define	RB_SHIFT	8	/* second byte is for ux */
Packit 6c4009
Packit 6c4009
#define	RB_DEBUGGER	0x1000	/*     for host_reboot(): enter kernel
Packit 6c4009
				       debugger from user level */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Constants for converting boot-style device number to type,
Packit 6c4009
 * adaptor (uba, mba, etc), unit number and partition number.
Packit 6c4009
 * Type (== major device number) is in the low byte
Packit 6c4009
 * for backward compatibility.  Except for that of the "magic
Packit 6c4009
 * number", each mask applies to the shifted value.
Packit 6c4009
 * Format:
Packit 6c4009
 *	 (4) (4) (4) (4)  (8)     (8)
Packit 6c4009
 *	--------------------------------
Packit 6c4009
 *	|MA | AD| CT| UN| PART  | TYPE |
Packit 6c4009
 *	--------------------------------
Packit 6c4009
 */
Packit 6c4009
#define	B_ADAPTORSHIFT		24
Packit 6c4009
#define	B_ADAPTORMASK		0x0f
Packit 6c4009
#define	B_ADAPTOR(val)		(((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)
Packit 6c4009
#define B_CONTROLLERSHIFT	20
Packit 6c4009
#define B_CONTROLLERMASK	0xf
Packit 6c4009
#define	B_CONTROLLER(val)	(((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)
Packit 6c4009
#define B_UNITSHIFT		16
Packit 6c4009
#define B_UNITMASK		0xf
Packit 6c4009
#define	B_UNIT(val)		(((val) >> B_UNITSHIFT) & B_UNITMASK)
Packit 6c4009
#define B_PARTITIONSHIFT	8
Packit 6c4009
#define B_PARTITIONMASK		0xff
Packit 6c4009
#define	B_PARTITION(val)	(((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)
Packit 6c4009
#define	B_TYPESHIFT		0
Packit 6c4009
#define	B_TYPEMASK		0xff
Packit 6c4009
#define	B_TYPE(val)		(((val) >> B_TYPESHIFT) & B_TYPEMASK)
Packit 6c4009
Packit 6c4009
#define	B_MAGICMASK	0xf0000000U
Packit 6c4009
#define	B_DEVMAGIC	0xa0000000U
Packit 6c4009
Packit 6c4009
#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) \
Packit 6c4009
	(((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) | \
Packit 6c4009
	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) | \
Packit 6c4009
	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifdef	KERNEL
Packit 6c4009
#ifndef	__ASSEMBLER__
Packit 6c4009
extern int boothowto;
Packit 6c4009
#endif	/* __ASSEMBLER__ */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/* Reboot or halt the system.  */
Packit 6c4009
extern int reboot (int __howto) __THROW;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
Packit 6c4009
#endif	/* _SYS_REBOOT_H_ */