⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hal-porting-structure.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- 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>HAL Structure</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="	Porting Guide"HREF="hal-porting-guide.html"><LINKREL="PREVIOUS"TITLE="	Porting Guide"HREF="hal-porting-guide.html"><LINKREL="NEXT"TITLE="Virtual Vectors (eCos/ROM Monitor Calling Interface)"HREF="hal-calling-if.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="hal-porting-guide.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 11. Porting Guide</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="hal-calling-if.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECTION"><H1CLASS="SECTION"><ANAME="HAL-PORTING-STRUCTURE">HAL Structure</H1><P>In order to write an eCos HAL it's a good idea to have at least apassing understanding of how the HAL interacts with the rest of thesystem.</P><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN8659">HAL Classes</H2><P>The eCos HAL consists of four HAL sub-classes. This table gives abrief description of each class and partly reiterates the descriptionin <AHREF="hal-architecture-variant-and-platform.html">Chapter 7</A>. The linksrefer to the on-line CVS tree (specifically to the sub-HALs used bythe PowerPC MBX target).</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN8663"><P></P><TABLEBORDER="1"CLASS="CALSTABLE"><THEAD><TR><THALIGN="LEFT"VALIGN="TOP">HAL type</TH><THALIGN="LEFT"VALIGN="TOP">Description</TH><THALIGN="LEFT"VALIGN="TOP">Functionality Overview</TH></TR></THEAD><TBODY><TR><TDALIGN="LEFT"VALIGN="TOP">Common HAL <AHREF="http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/ecos/packages/hal/common/current?cvsroot=ecos"TARGET="_top">(hal/common)</A></TD><TDALIGN="LEFT"VALIGN="TOP">Configuration options and functionality shared by all HALs.</TD><TDALIGN="LEFT"VALIGN="TOP">Generic debugging functionality, driver API, eCos/ROM monitor      calling interface, and tests.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">Architecture HAL <AHREF="http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/ecos/packages/hal/powerpc/arch/current?cvsroot=ecos"TARGET="_top">(hal/&lt;architecture&gt;/arch)</A></TD><TDALIGN="LEFT"VALIGN="TOP">Functionality specific to the given architecture. Also default  implementations of some functionality which can be overridden by  variant or platform HALs.</TD><TDALIGN="LEFT"VALIGN="TOP">Architecture specific debugger functionality (handles single     stepping, exception-to-signal conversion, etc.),     exception/interrupt vector definitions and handlers, cache     definition and control macros, context switching code, assembler     functions for early system initialization, configuration options,     and possibly tests. </TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">Variant HAL <AHREF="http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/ecos/packages/hal/powerpc/mpc8xx/current?cvsroot=ecos"TARGET="_top">(hal/&lt;architecture&gt;/&lt;variant&gt;)</A></TD><TDALIGN="LEFT"VALIGN="TOP">Some CPU architectures consist of a number variants, for example     MIPS CPUs come in both 32 and 64 bit versions, and some variants     have embedded features additional to the CPU core.</TD><TDALIGN="LEFT"VALIGN="TOP">Variant extensions to the architecture code (cache,     exception/interrupt), configuration options, possibly drivers for     variant on-core devices, and possibly tests.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">Platform HAL <AHREF="http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/ecos/packages/hal/powerpc/mbx/current?cvsroot=ecos"TARGET="_top">(hal/&lt;architecture&gt;/&lt;platform&gt;)</A></TD><TDALIGN="LEFT"VALIGN="TOP">Contains functionality and configuration options specific to the      platform.</TD><TDALIGN="LEFT"VALIGN="TOP">Early platform initialization code, platform memory layout     specification, configuration options (processor speed, compiler     options), diagnostic IO functions, debugger IO functions,     platform specific extensions to architecture or variant code     (off-core interrupt controller), and possibly tests.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP">Auxiliary HAL <AHREF="http://sourceware.cygnus.com/cgi-bin/cvsweb.cgi/ecos/packages/hal/powerpc/quicc/current?cvsroot=ecos"TARGET="_top">(hal/&lt;architecture&gt;/&lt;module&gt;)</A></TD><TDALIGN="LEFT"VALIGN="TOP">Some variants share common modules on the core. Motorola's PowerPC      QUICC is an example of such a module.</TD><TDALIGN="LEFT"VALIGN="TOP">Module specific functionality (interrupt controller, simple      device drivers), possibly tests.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN8696">File Descriptions</H2><P>Listed below are the files found in various HALs, with a shortdescription of what each file contains. When looking in existing HALsbeware that they do not necessarily follow this naming scheme.If you are writing a new HAL, please try to follow it asclosely as possible. Still, no two targets are the same, so sometimesit makes sense to use additional files.</P><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="AEN8699">Common HAL</H3><DIVCLASS="INFORMALTABLE"><ANAME="AEN8701"><P></P><TABLEBORDER="1"CLASS="CALSTABLE"><THEAD><TR><THALIGN="LEFT"VALIGN="TOP">File</TH><THALIGN="LEFT"VALIGN="TOP">Description</TH></TR></THEAD><TBODY><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/dbg-thread-syscall.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines the thread debugging syscall function. This is used by  the ROM monitor to access the thread debugging API in the RAM  application.  .</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/dbg-threads-api.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines the thread debugging API. .</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/drv_api.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines the driver API.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/generic-stub.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines the generic stub features.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/hal_if.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines the ROM/RAM calling interface API.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/hal_misc.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines miscellaneous helper functions shared by all HALs.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/hal_stub.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines eCos mappings of GDB stub features.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/dbg-threads-syscall.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Thread debugging implementation.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/drv_api.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Driver API implementation. Depending on configuration this  provides either wrappers for the kernel API, or a minimal  implementation of these features. This allows drivers to be written  relying only on HAL features.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/dummy.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Empty dummy file ensuring creation of libtarget.a.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/generic-stub.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Generic GDB stub implementation. This provides the  communication protocol used to communicate with GDB over a serial  device or via the network.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/hal_if.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">ROM/RAM calling interface implementation. Provides wrappers from  the calling interface API to the eCos features used for the  implementation.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/hal_misc.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Various helper functions shared by all platforms and  architectures.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/hal_stub.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Wrappers from eCos HAL features to the features required by the  generic GDB stub.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/stubrom/stubrom.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">The file used to build eCos GDB stub images. Basically a  cyg_start function with a hard coded breakpoint.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/thread-packets.c</TT></TD><TDALIGN="LEFT"VALIGN="TOP">More thread debugging related functions.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">src/thread-pkts.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Defines more thread debugging related function.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><DIVCLASS="SECTION"><H3CLASS="SECTION"><ANAME="AEN8776">Architecture HAL</H3><P>Some architecture HALs may add extra files for architecturespecific serial drivers, or for handling interrupts and exceptions if itmakes sense.</P><P>Note that many of the definitions in these files are onlyconditionally defined - if the equivalent variant or platform headersprovide the definitions, those override the generic architecturedefinitions.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN8780"><P></P><TABLEBORDER="1"CLASS="CALSTABLE"><THEAD><TR><THALIGN="LEFT"VALIGN="TOP">File</TH><THALIGN="LEFT"VALIGN="TOP">Description</TH></TR></THEAD><TBODY><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/arch.inc</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Various assembly macros used during system initialization.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/basetype.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Endian, label, alignment, and type size definitions. These  override common defaults in CYGPKG_INFRA.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/hal_arch.h</TT></TD><TDALIGN="LEFT"VALIGN="TOP">Saved register frame format, various thread, register and stack  related macros.</TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"><TTCLASS="FILENAME">include/hal_cache.h</TT></TD

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -