📄 devapi-synchronization-levels.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Synchronization Levels</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="Device Driver Interface to the Kernel"HREF="devapi-device-driver-interface-to-the-kernel.html"><LINKREL="PREVIOUS"TITLE="Device Driver Models"HREF="devapi-device-driver-models.html"><LINKREL="NEXT"TITLE="The API"HREF="devapi-api.html"></HEAD><BODYCLASS="SECTION"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="devapi-device-driver-models.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 18. Device Driver Interface to the Kernel</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="devapi-api.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECTION"><H1CLASS="SECTION"><ANAME="DEVAPI-SYNCHRONIZATION-LEVELS">Synchronization Levels</H1><P>Since it would be dangerous for an ISR or DSR to make a callthat might reschedule the current thread (by trying to lock a mutexfor example) all functions in this API have an associated synchronizationlevel. These levels are:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Thread</DT><DD><P> This function may only be called from within threads. This is usually the client code that makes calls into the device driver. In a non-kernel configuration, this will be code running at the default non-interrupt level. </P></DD><DT>DSR</DT><DD><P> This function may be called by either DSR or thread code. </P></DD><DT>ISR</DT><DD><P> This function may be called from ISR, DSR or thread code. </P></DD></DL></DIV><P>The following table shows, for each API function, the levelsat which is may be called:</P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"> Callable from:Function ISR DSR Thread-------------------------------------------------------------------------cyg_drv_isr_lock X X Xcyg_drv_isr_unlock X X Xcyg_drv_spinlock_init Xcyg_drv_spinlock_destroy Xcyg_drv_spinlock_spin X X Xcyg_drv_spinlock_clear X X Xcyg_drv_spinlock_try X X Xcyg_drv_spinlock_test X X Xcyg_drv_spinlock_spin_intsave X X Xcyg_drv_spinlock_clear_intsave X X Xcyg_drv_dsr_lock X Xcyg_drv_dsr_unlock X Xcyg_drv_mutex_init Xcyg_drv_mutex_destroy Xcyg_drv_mutex_lock Xcyg_drv_mutex_trylock Xcyg_drv_mutex_unlock Xcyg_drv_mutex_release Xcyg_drv_cond_init Xcyg_drv_cond_destroy Xcyg_drv_cond_wait Xcyg_drv_cond_signal X Xcyg_drv_cond_broadcast X Xcyg_drv_interrupt_create Xcyg_drv_interrupt_delete Xcyg_drv_interrupt_attach X X Xcyg_drv_interrupt_detach X X Xcyg_drv_interrupt_mask X X Xcyg_drv_interrupt_unmask X X Xcyg_drv_interrupt_acknowledge X X Xcyg_drv_interrupt_configure X X Xcyg_drv_interrupt_level X X Xcyg_drv_interrupt_set_cpu X X Xcyg_drv_interrupt_get_cpu X X X </PRE></TD></TR></TABLE></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="devapi-device-driver-models.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="devapi-api.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Device Driver Models</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="devapi-device-driver-interface-to-the-kernel.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">The API</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -