#include <sys/reboot.h>

sys/reboot.h

includes: sys/appleapiopts.h, sys/cdefs.h, stdint.h, uuid/uuid.h
33 macros · 4 functions · 1 enum · 1 typedef

macroRB_AUTOBOOT

#define RB_AUTOBOOT 0
flags for system auto-booting itself

macroRB_ASKNAME

#define RB_ASKNAME 0x01
ask for file name to reboot from

macroRB_SINGLE

#define RB_SINGLE 0x02
reboot to single user only

macroRB_NOSYNC

#define RB_NOSYNC 0x04
dont sync before reboot

macroRB_HALT

#define RB_HALT 0x08
don't reboot, just halt

macroRB_INITNAME

#define RB_INITNAME 0x10
name given for /etc/init

macroRB_DFLTROOT

#define RB_DFLTROOT 0x20
use compiled-in rootdev

macroRB_ALTBOOT

#define RB_ALTBOOT 0x40
use /boot.old vs /boot

macroRB_UNIPROC

#define RB_UNIPROC 0x80
don't start slaves

macroRB_SAFEBOOT

#define RB_SAFEBOOT 0x100
booting safe

macroRB_UPSDELAY

#define RB_UPSDELAY 0x200
Delays restart by 5 minutes

macroRB_QUICK

#define RB_QUICK 0x400
quick and ungraceful reboot with file system caches flushed

macroRB_PANIC

#define RB_PANIC 0x800
panic the kernel

macroRB_PANIC_ZPRINT

#define RB_PANIC_ZPRINT 0x1000
add zprint info to panic string

macroRB_PANIC_FORCERESET

#define RB_PANIC_FORCERESET 0x2000
do force-reset panic

enumpanic_with_data_flags

underlying type unsigned int
PANIC_WITH_DATA_FLAGS_NONE0
PANIC_WITH_DATA_FLAGS_EXCLAVE_STACKSHOT1
PANIC_WITH_DATA_FLAGS_MAX2

typedefpanic_with_data_flags

typedef enum panic_with_data_flags panic_with_data_flags;

functionusrctl

int usrctl(uint32_t flags)
userspace reboot control

functionreboot

int reboot(int howto)
The normal reboot syscall.
man page · June 4, 1993
reboot(2) — reboot system or halt processor

functionreboot_np

int reboot_np(int howto, const char *message)
Used with RB_PANIC to panic the kernel from userspace with a message. Requires an entitlement on Release.

functionpanic_with_data

int panic_with_data(
	uuid_t uuid,
	void *addr,
	uint32_t len,
	uint32_t flags,
	const char *msg
)
Used to panic the kernel from user space and add additional data to the paniclog.

macroB_ADAPTORSHIFT

Constants for converting boot-style device number to type, adaptor (uba, mba, etc), unit number and partition number. Type (== major device number) is in the low byte for backward compatibility. Except for that of the "magic number", each mask applies to the shifted value. Format: (4) (4) (4) (4) (8) (8) -------------------------------- |MA | AD| CT| UN| PART | TYPE | --------------------------------
#define B_ADAPTORSHIFT 24

macroB_ADAPTORMASK

#define B_ADAPTORMASK 0x0f

macroB_ADAPTOR

#define B_ADAPTOR(val) (((val) >> B_ADAPTORSHIFT) & B_ADAPTORMASK)

macroB_CONTROLLERSHIFT

#define B_CONTROLLERSHIFT 20

macroB_CONTROLLERMASK

#define B_CONTROLLERMASK 0xf

macroB_CONTROLLER

#define B_CONTROLLER(val) (((val)>>B_CONTROLLERSHIFT) & B_CONTROLLERMASK)

macroB_UNITSHIFT

#define B_UNITSHIFT 16

macroB_UNITMASK

#define B_UNITMASK 0xff

macroB_UNIT

#define B_UNIT(val) (((val) >> B_UNITSHIFT) & B_UNITMASK)

macroB_PARTITIONSHIFT

#define B_PARTITIONSHIFT 8

macroB_PARTITIONMASK

#define B_PARTITIONMASK 0xff

macroB_PARTITION

#define B_PARTITION(val) (((val) >> B_PARTITIONSHIFT) & B_PARTITIONMASK)

macroB_TYPESHIFT

#define B_TYPESHIFT 0

macroB_TYPEMASK

#define B_TYPEMASK 0xff

macroB_TYPE

#define B_TYPE(val) (((val) >> B_TYPESHIFT) & B_TYPEMASK)

macroB_MAGICMASK

#define B_MAGICMASK 0xf0000000

macroB_DEVMAGIC

#define B_DEVMAGIC 0xa0000000

macroMAKEBOOTDEV

#define MAKEBOOTDEV(type, adaptor, controller, unit, partition) (((type) << B_TYPESHIFT) | ((adaptor) << B_ADAPTORSHIFT) |
	((controller) << B_CONTROLLERSHIFT) | ((unit) << B_UNITSHIFT) |
	((partition) << B_PARTITIONSHIFT) | B_DEVMAGIC)