ecos 文档

源代码在线查看: devapi-device-driver-interface-to-the-kernel.html

软件大小: 2887 K
上传用户: a83133937
关键词: ecos 文档
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				
				
				
				
				
								>				>				>Device Driver Interface to the Kernel				>
								NAME="GENERATOR"
				CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
				">				REL="HOME"
				TITLE="eCos Reference Manual"
				HREF="ecos-ref.html">				REL="UP"
				TITLE="I/O Package (Device Drivers)"
				HREF="io.html">				REL="PREVIOUS"
				TITLE="Serial testing with ser_filter"
				HREF="io-serial-testing-with-serfilter.html">				REL="NEXT"
				TITLE="Synchronization"
				HREF="devapi-synchronization.html">				>				CLASS="CHAPTER"
				BGCOLOR="#FFFFFF"
				TEXT="#000000"
				LINK="#0000FF"
				VLINK="#840084"
				ALINK="#0000FF"
				>				CLASS="NAVHEADER"
				>				SUMMARY="Header navigation table"
				WIDTH="100%"
				BORDER="0"
				CELLPADDING="0"
				CELLSPACING="0"
				>				>				COLSPAN="3"
				ALIGN="center"
				>eCos Reference Manual				>				>				>				WIDTH="10%"
				ALIGN="left"
				VALIGN="bottom"
				>				HREF="io-serial-testing-with-serfilter.html"
				ACCESSKEY="P"
				>Prev				>				>				WIDTH="80%"
				ALIGN="center"
				VALIGN="bottom"
				>				>				WIDTH="10%"
				ALIGN="right"
				VALIGN="bottom"
				>				HREF="devapi-synchronization.html"
				ACCESSKEY="N"
				>Next				>				>				>				>				ALIGN="LEFT"
				WIDTH="100%">				>				CLASS="CHAPTER"
				>				>				NAME="DEVAPI-DEVICE-DRIVER-INTERFACE-TO-THE-KERNEL">Chapter 18. Device Driver Interface to the Kernel				>				CLASS="TOC"
				>				>				>				>Table of Contents				>				>				>				HREF="devapi-device-driver-interface-to-the-kernel.html#DEVAPI-INTERRUPT-MODEL"
				>Interrupt Model				>				>				>				HREF="devapi-synchronization.html"
				>Synchronization				>				>				>				HREF="devapi-smp-support.html"
				>SMP Support				>				>				>				HREF="devapi-device-driver-models.html"
				>Device Driver Models				>				>				>				HREF="devapi-synchronization-levels.html"
				>Synchronization Levels				>				>				>				HREF="devapi-api.html"
				>The API				>				>				>				>				>This chapter describes the API that device drivers may use
				to interact with the kernel and HAL. It is primarily concerned with
				the control and management of interrupts and the synchronization of
				ISRs, DSRs and threads.				>				>The same API will be present in configurations where the kernel
				is not present. In this case the functions will be supplied by code
				acting directly on the HAL.				>				CLASS="SECTION"
				>				CLASS="SECTION"
				>				NAME="DEVAPI-INTERRUPT-MODEL">Interrupt Model				>				>				CLASS="emphasis"
				>				CLASS="EMPHASIS"
				>eCos				>				> presents a three level interrupt model to
				device drivers. This consists of Interrupt Service Routines (ISRs) that are invoked
				in response to a hardware interrupt; Deferred
				Service Routines (DSRs) that are invoked in response to a request by
				an ISR; and threads that are the clients of the driver. 				>				>Hardware interrupts are delivered with minimal intervention to an
				ISR. The HAL decodes the hardware source of the interrupt and calls
				the ISR of the attached interrupt object. This ISR may manipulate the
				hardware but is only allowed to make a restricted set of calls on the
				driver API. When it returns, an ISR may request that its DSR should be
				scheduled to run.				>				>A DSR will be run when it is safe to do so without interfering with
				the scheduler. Most of the time the DSR will run immediately after the
				ISR, but if the current thread is in the scheduler, it will be delayed
				until the thread is finished. A DSR is allowed to make a larger set of
				driver API calls, including, in particular, being able to call
								CLASS="FUNCTION"
				>cyg_drv_cond_signal()				> to wake up waiting
				threads.				>				>Finally, threads are able to make all API calls and in particular are
				allowed to wait on mutexes and condition variables. 				>				>For a device driver to receive interrupts it must first define ISR and
				DSR routines as shown below, and then call
								CLASS="FUNCTION"
				>cyg_drv_interrupt_create()				>.  Using the handle
				returned, the driver must then call
								CLASS="FUNCTION"
				>cyg_drv_interrupt_attach()				> to actually attach the
				interrupt to the hardware vector.				>				>				>				CLASS="NAVFOOTER"
				>				ALIGN="LEFT"
				WIDTH="100%">				SUMMARY="Footer navigation table"
				WIDTH="100%"
				BORDER="0"
				CELLPADDING="0"
				CELLSPACING="0"
				>				>				WIDTH="33%"
				ALIGN="left"
				VALIGN="top"
				>				HREF="io-serial-testing-with-serfilter.html"
				ACCESSKEY="P"
				>Prev				>				>				WIDTH="34%"
				ALIGN="center"
				VALIGN="top"
				>				HREF="ecos-ref.html"
				ACCESSKEY="H"
				>Home				>				>				WIDTH="33%"
				ALIGN="right"
				VALIGN="top"
				>				HREF="devapi-synchronization.html"
				ACCESSKEY="N"
				>Next				>				>				>				>				WIDTH="33%"
				ALIGN="left"
				VALIGN="top"
				>Serial testing with ser_filter				>				WIDTH="34%"
				ALIGN="center"
				VALIGN="top"
				>				HREF="io.html"
				ACCESSKEY="U"
				>Up				>				>				WIDTH="33%"
				ALIGN="right"
				VALIGN="top"
				>Synchronization				>				>				>				>				>				>			

相关资源