Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_intr_get_hilevel_pri.9f
blob0c4df240994ae7c966ab2f8f2fd98b351b0d64c3
1 '\" te
2 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH DDI_INTR_GET_HILEVEL_PRI 9F "Apr 07, 2005"
7 .SH NAME
8 ddi_intr_get_hilevel_pri \- get minimum priority level for a high-level
9 interrupt
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/conf.h>
15 #include <sys/ddi.h>
16 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_intr_get_hilevel_pri\fR(\fBvoid\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Solaris DDI specific (Solaris DDI).
25 .SH DESCRIPTION
26 .sp
27 .LP
28 Upon a successful return, the \fBddi_intr_get_hilevel_pri()\fR function returns
29 the minimum priority level for a high-level interrupt. The return priority
30 value can be used to compare to other priority values, such as those returned
31 from \fBddi_intr_get_pri\fR(9F), to determine if a given interrupt priority is
32 a high-level interrupt.
33 .sp
34 .LP
35 High-level interrupts must be handled without using system services that
36 manipulate thread or process states, because such interrupts are not blocked by
37 the scheduler.
38 .sp
39 .LP
40 In addition, high-level interrupt handlers must take care to do a minimum of
41 work because they cannot be preempted.
42 .sp
43 .LP
44 A typical high-level interrupt handler puts data into a circular buffer and
45 schedule a soft interrupt by calling \fBddi_intr_trigger_softint()\fR. The
46 circular buffer can be protected by using a mutex that is properly initialized
47 for the interrupt handler.
48 .sp
49 .LP
50 The \fBddi_intr_get_hilevel_pri()\fR function can be used before calling
51 \fBddi_intr_add_handler()\fR to help determine which type of interrupt handler
52 can be used. Most device drivers are designed with the knowledge that supported
53 devices always generate low level interrupts. On some machines, however,
54 interrupts are high-level above the scheduler level and on other machines they
55 are not. Devices such as those those using SBus interrupts or VME bus level 6
56 or 7 interrupts must use the \fBddi_intr_get_hilevel_pri()\fR function to test
57 the type of interrupt handler that can be used.
58 .SH RETURN VALUES
59 .sp
60 .LP
61 The \fBddi_intr_get_hilevel_pri()\fR function returns the priority value for a
62 high-level interrupt.
63 .SH CONTEXT
64 .sp
65 .LP
66 The \fBddi_intr_get_hilevel_pri()\fR function can be called from either user or
67 kernel non-interrupt context.
68 .SH ATTRIBUTES
69 .sp
70 .LP
71 See \fBattributes\fR(5) for descriptions of the following attributes:
72 .sp
74 .sp
75 .TS
76 box;
77 c | c
78 l | l .
79 ATTRIBUTE TYPE  ATTRIBUTE VALUE
81 Interface Stability     Committed
82 .TE
84 .SH SEE ALSO
85 .sp
86 .LP
87 \fBattributes\fR(5), \fBddi_intr_add_handler\fR(9F), \fBddi_intr_alloc\fR(9F),
88 \fBddi_intr_enable\fR(9F), \fBddi_intr_get_pri\fR(9F),
89 \fBddi_intr_trigger_softint\fR(9F), \fBmutex\fR(9F)
90 .sp
91 .LP
92 \fIWriting Device Drivers\fR