xref: /illumos-gate/usr/src/man/man9f/ddi_in_panic.9f (revision 48edc7cf07b5dccc3ad84bf2dafe4150bd666d60)
te
Copyright (c) 2000, Sun Microsystems, Inc.
All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
DDI_IN_PANIC 9F "Jun 23, 1997"
NAME
ddi_in_panic - determine if system is in panic state
SYNOPSIS

#include <sys/ddi.h>
#include <sys/sunddi.h>



int ddi_in_panic(void);
INTERFACE LEVEL

Solaris DDI specific (Solaris DDI).

DESCRIPTION

Drivers controlling devices on which the system may write a kernel crash dump in the event of a panic can call ddi_in_panic() to determine if the system is panicking.

When the system is panicking, the calls of functions scheduled by timeout(9F) and ddi_trigger_softintr(9F) will never occur. Neither can delay(9F) be relied upon, since it is implemented via timeout(9F).

Drivers that need to enforce a time delay such as SCSI bus reset delay time must busy-wait when the system is panicking.

RETURN VALUES

ddi_in_panic() returns 1 if the system is in panic, or 0 otherwise.

CONTEXT

ddi_in_panic() may be called from any context.

SEE ALSO

dump(9E), delay(9F), ddi_trigger_softintr(9F), timeout(9F)

Writing Device Drivers