1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Synchronization Levels</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="Device Driver Interface to the Kernel"
23 HREF="devapi-device-driver-interface-to-the-kernel.html"><LINK
25 TITLE="Device Driver Models"
26 HREF="devapi-device-driver-models.html"><LINK
29 HREF="devapi-api.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="devapi-device-driver-models.html"
65 >Chapter 18. Device Driver Interface to the Kernel</TD
71 HREF="devapi-api.html"
85 NAME="DEVAPI-SYNCHRONIZATION-LEVELS">Synchronization Levels</H1
87 >Since it would be dangerous for an ISR or DSR to make a call
88 that might reschedule the current thread (by trying to lock a mutex
89 for example) all functions in this API have an associated synchronization
90 level. These levels are:</P
100 > This function may only be called from within threads. This is
101 usually the client code that makes calls into the device driver.
102 In a non-kernel configuration, this will be code running at the
103 default non-interrupt level.
110 > This function may be called by either DSR or thread code.
117 > This function may be called from ISR, DSR or thread code.
123 >The following table shows, for each API function, the levels
124 at which is may be called:</P
132 CLASS="PROGRAMLISTING"
134 Function ISR DSR Thread
135 -------------------------------------------------------------------------
137 cyg_drv_isr_lock X X X
138 cyg_drv_isr_unlock X X X
139 cyg_drv_spinlock_init X
140 cyg_drv_spinlock_destroy X
141 cyg_drv_spinlock_spin X X X
142 cyg_drv_spinlock_clear X X X
143 cyg_drv_spinlock_try X X X
144 cyg_drv_spinlock_test X X X
145 cyg_drv_spinlock_spin_intsave X X X
146 cyg_drv_spinlock_clear_intsave X X X
148 cyg_drv_dsr_unlock X X
150 cyg_drv_mutex_destroy X
152 cyg_drv_mutex_trylock X
153 cyg_drv_mutex_unlock X
154 cyg_drv_mutex_release X
156 cyg_drv_cond_destroy X
158 cyg_drv_cond_signal X X
159 cyg_drv_cond_broadcast X X
160 cyg_drv_interrupt_create X
161 cyg_drv_interrupt_delete X
162 cyg_drv_interrupt_attach X X X
163 cyg_drv_interrupt_detach X X X
164 cyg_drv_interrupt_mask X X X
165 cyg_drv_interrupt_unmask X X X
166 cyg_drv_interrupt_acknowledge X X X
167 cyg_drv_interrupt_configure X X X
168 cyg_drv_interrupt_level X X X
169 cyg_drv_interrupt_set_cpu X X X
170 cyg_drv_interrupt_get_cpu X X X </PRE
180 SUMMARY="Footer navigation table"
191 HREF="devapi-device-driver-models.html"
209 HREF="devapi-api.html"
219 >Device Driver Models</TD
225 HREF="devapi-device-driver-interface-to-the-kernel.html"